Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrModuleExists = errors.New("module has already been created")
View Source
var ErrModuleNotFound = errors.New("module does not found")
Functions ¶
Types ¶
type CreateModuleOptions ¶
type GetModuleOptions ¶
type GetModuleOptions struct {
EnabledOnly bool
}
type Module ¶
type Module struct { ID string `db:"id"` Body *module.Body `db:"body"` Enabled bool `db:"enabled"` CreatedAt time.Time `db:"created_at"` }
Module represents a single module.
type ModulesStore ¶
type ModulesStore interface { List(ctx context.Context, opts GetModuleOptions) ([]*Module, error) Get(ctx context.Context, id string) (*Module, error) Create(ctx context.Context, opts CreateModuleOptions) error Update(ctx context.Context, id string, opts UpdateModuleOptions) error SetStatus(ctx context.Context, id string, enabled bool) error Delete(ctx context.Context, id string) error }
var Modules ModulesStore
func NewModulesStore ¶
func NewModulesStore(db *gorm.DB) ModulesStore
type UpdateModuleOptions ¶
Click to show internal directories.
Click to hide internal directories.