2016-08-28 03:59:17 +00:00
|
|
|
package kolide
|
|
|
|
|
|
|
|
// Datastore combines all the interfaces in the Kolide DAL
|
|
|
|
type Datastore interface {
|
|
|
|
UserStore
|
2016-09-04 05:13:42 +00:00
|
|
|
QueryStore
|
2016-11-29 18:20:06 +00:00
|
|
|
CampaignStore
|
2016-09-04 05:13:42 +00:00
|
|
|
PackStore
|
2016-10-03 03:14:35 +00:00
|
|
|
LabelStore
|
2016-09-06 21:28:07 +00:00
|
|
|
HostStore
|
2017-03-30 15:31:28 +00:00
|
|
|
TargetStore
|
2016-09-15 14:52:17 +00:00
|
|
|
PasswordResetStore
|
2016-08-28 03:59:17 +00:00
|
|
|
SessionStore
|
2016-09-22 00:45:57 +00:00
|
|
|
AppConfigStore
|
2016-09-29 02:44:05 +00:00
|
|
|
InviteStore
|
2016-12-13 22:22:05 +00:00
|
|
|
ScheduledQueryStore
|
2016-12-29 18:32:28 +00:00
|
|
|
OptionStore
|
2017-01-13 18:35:25 +00:00
|
|
|
DecoratorStore
|
|
|
|
FileIntegrityMonitoringStore
|
|
|
|
YARAStore
|
2017-02-02 20:30:59 +00:00
|
|
|
LicenseStore
|
2016-08-28 03:59:17 +00:00
|
|
|
Name() string
|
|
|
|
Drop() error
|
2017-01-05 17:27:56 +00:00
|
|
|
// MigrateTables creates and migrates the table schemas
|
|
|
|
MigrateTables() error
|
|
|
|
// MigrateData populates built-in data
|
|
|
|
MigrateData() error
|
2017-03-08 17:17:07 +00:00
|
|
|
// MigrationStatus returns nil if migrations are complete, and an error
|
|
|
|
// if migrations need to be run.
|
2017-03-09 18:40:52 +00:00
|
|
|
MigrationStatus() (MigrationStatus, error)
|
2017-05-30 19:42:00 +00:00
|
|
|
Begin() (Transaction, error)
|
2016-08-28 03:59:17 +00:00
|
|
|
}
|
2016-12-20 18:35:22 +00:00
|
|
|
|
2017-03-09 18:40:52 +00:00
|
|
|
type MigrationStatus int
|
|
|
|
|
|
|
|
const (
|
|
|
|
NoMigrationsCompleted = iota
|
|
|
|
SomeMigrationsCompleted
|
|
|
|
AllMigrationsCompleted
|
|
|
|
)
|
|
|
|
|
2016-12-20 18:35:22 +00:00
|
|
|
// 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
|
|
|
|
}
|
2017-05-30 19:42:00 +00:00
|
|
|
|
|
|
|
type OptionalArg func() interface{}
|