Documentation
¶
Index ¶
- func GetActivityPurgeCmd(ctx *appContext.Context) *cobra.Command
- func GetActivityPurgeRunFn(ctx *appContext.Context) func(*cobra.Command, []string) error
- func GetDemoCmd(ctx *appContext.Context) *cobra.Command
- func GetDemoRunFn(ctx *appContext.Context) func(*cobra.Command, []string) error
- func GetInitCmd(ctx *appContext.Context) *cobra.Command
- func GetInitRunFn(ctx *appContext.Context) func(*cobra.Command, []string) error
- func GetMigrateCmd(ctx *appContext.Context) *cobra.Command
- type CreateActivityPurgeDBFn
- type CreateDemoDBFn
- type CreateInitDBFn
- type Migrator
- type MigratorFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetActivityPurgeCmd ¶ added in v0.2.0
func GetActivityPurgeCmd(ctx *appContext.Context) *cobra.Command
GetActivityPurgeCmd runs the purge on demand. The scheduler already runs it, but ops needs a way to trim right away after lowering the cap.
func GetActivityPurgeRunFn ¶ added in v0.2.0
func GetDemoCmd ¶
func GetDemoCmd(ctx *appContext.Context) *cobra.Command
func GetDemoRunFn ¶
func GetInitCmd ¶
func GetInitCmd(ctx *appContext.Context) *cobra.Command
func GetInitRunFn ¶
func GetMigrateCmd ¶
func GetMigrateCmd(ctx *appContext.Context) *cobra.Command
Types ¶
type CreateActivityPurgeDBFn ¶ added in v0.2.0
type CreateActivityPurgeDBFn func(ctx *appContext.Context) (*gorm.DB, error)
CreateActivityPurgeDBFn is a function type for creating database connection (used for testing)
var NewActivityPurgeDB CreateActivityPurgeDBFn = func(ctx *appContext.Context) (*gorm.DB, error) { return database.CreateDB(ctx) }
NewActivityPurgeDB is the function used to create database connection (can be replaced in tests)
type CreateDemoDBFn ¶
type CreateDemoDBFn func(ctx *appContext.Context) (*gorm.DB, error)
CreateDemoDBFn is a function type for creating database connection (used for testing)
var NewDemoDB CreateDemoDBFn = func(ctx *appContext.Context) (*gorm.DB, error) { return database.CreateDB(ctx) }
NewDemoDB is the function used to create database connection (can be replaced in tests)
type CreateInitDBFn ¶
type CreateInitDBFn func(ctx *appContext.Context) (*gorm.DB, error)
CreateInitDBFn is a function type for creating database connection (used for testing)
var NewInitDB CreateInitDBFn = func(ctx *appContext.Context) (*gorm.DB, error) { return database.CreateDB(ctx) }
NewInitDB is the function used to create database connection (can be replaced in tests)
type Migrator ¶
type Migrator interface {
Up() error
Down() error
Steps(n int) error
Version() (version uint, dirty bool, err error)
}
Migrator defines the interface for database migrations
type MigratorFactory ¶
type MigratorFactory func(ctx *appContext.Context) (Migrator, error)
MigratorFactory creates a Migrator instance
var NewMigrator MigratorFactory = createMigrator
NewMigrator is the factory function to create a Migrator (injectable for testing)