Documentation ¶
Index ¶
- func CliUsage(title, description, binName string, register CliCommandEntries) func()
- func DBTransactionMiddleware(db *gorm.DB) gin.HandlerFunc
- func PreloadDBModels(db *gorm.DB, preload []string) *gorm.DB
- func TxHandle(ctx context.Context) *gorm.DB
- type CliCommandEntries
- type CliCommandEntry
- type CliCommandFunc
- type CronErrors
- type CronTask
- type Model
- type ModelId
- type SoftDeleteModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CliUsage ¶
func CliUsage(title, description, binName string, register CliCommandEntries) func()
CliUsage generator for the flags lib
func DBTransactionMiddleware ¶
func DBTransactionMiddleware(db *gorm.DB) gin.HandlerFunc
DBTransactionMiddleware handles the create, commit and rollback steps of a gorm transaction for each gin http request
func PreloadDBModels ¶
PreloadDBModels updates the db transaction with assigned model preloads
Types ¶
type CliCommandEntries ¶
type CliCommandEntries []CliCommandEntry
CommandEntries list
func (CliCommandEntries) Find ¶
func (ces CliCommandEntries) Find(key string) *CliCommandEntry
Find a command entry by its key
type CliCommandEntry ¶
type CliCommandEntry struct { Key string Usage string Run CliCommandFunc }
type CliCommandFunc ¶
type CronErrors ¶
func RunCronTasks ¶
func RunCronTasks(tasks []CronTask, register CliCommandEntries) CronErrors
RunCranTasks that have hit their trigger
func (CronErrors) Error ¶
func (ce CronErrors) Error() string
Error implementation keeps CronErrors adheering to the error interface
type CronTask ¶
type CronTask struct { Command string ` yaml:"command" validate:"required"` Schedule string ` yaml:"schedule" validate:"required"` Args []string `yaml:"args"` }
func ParseCronSchedule ¶
ParseCronSchedule file by its file path
Click to show internal directories.
Click to hide internal directories.