mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
9d49dbc465
with an exposed interface. Not checking for a specific sentinel error reduces coupling between packages and allows adding context like the resource ID and resource type.
33 lines
591 B
Go
33 lines
591 B
Go
package kolide
|
|
|
|
// Datastore combines all the interfaces in the Kolide DAL
|
|
type Datastore interface {
|
|
UserStore
|
|
QueryStore
|
|
CampaignStore
|
|
PackStore
|
|
LabelStore
|
|
HostStore
|
|
PasswordResetStore
|
|
SessionStore
|
|
AppConfigStore
|
|
InviteStore
|
|
ScheduledQueryStore
|
|
Name() string
|
|
Drop() error
|
|
Migrate() error
|
|
}
|
|
|
|
// NotFoundError is returned when the datastore resource cannot be found.
|
|
type NotFoundError interface {
|
|
error
|
|
IsNotFound() bool
|
|
}
|
|
|
|
// AlreadyExists is returned when creating a datastore resource that already
|
|
// exists.
|
|
type AlreadyExistsError interface {
|
|
error
|
|
IsExists() bool
|
|
}
|