fleet/server/kolide/datastore.go

56 lines
1.1 KiB
Go
Raw Normal View History

2016-08-28 03:59:17 +00:00
package kolide
// Datastore combines all the interfaces in the Kolide DAL
type Datastore interface {
UserStore
QueryStore
CampaignStore
PackStore
LabelStore
HostStore
TargetStore
PasswordResetStore
2016-08-28 03:59:17 +00:00
SessionStore
AppConfigStore
InviteStore
ScheduledQueryStore
2016-12-29 18:32:28 +00:00
OptionStore
DecoratorStore
FileIntegrityMonitoringStore
YARAStore
2017-02-02 20:30:59 +00:00
LicenseStore
2016-08-28 03:59:17 +00:00
Name() string
Drop() error
// MigrateTables creates and migrates the table schemas
MigrateTables() error
// MigrateData populates built-in data
MigrateData() error
// MigrationStatus returns nil if migrations are complete, and an error
// if migrations need to be run.
MigrationStatus() (MigrationStatus, error)
Begin() (Transaction, error)
2016-08-28 03:59:17 +00:00
}
type MigrationStatus int
const (
NoMigrationsCompleted = iota
SomeMigrationsCompleted
AllMigrationsCompleted
)
// 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
}
type OptionalArg func() interface{}