Documentation
¶
Overview ¶
Package cli contains functionality for the command-line interface of the service. It provides commands for starting both the server and scheduler services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arguments ¶
type Arguments struct {
// Logger is a logger that the command can use.
Logger *slog.Logger
// StaticContent is an embedded filesystem containing static files.
StaticContent embed.FS
// Environment is the running environment for the application.
Environment string
}
Arguments are the common options for commands.
func AddArguments ¶
AddArguments generates command-line arguments from the given options.
type BlockUserCmd ¶ added in v0.27.0
func (*BlockUserCmd) Run ¶ added in v0.27.0
func (c *BlockUserCmd) Run() error
type ClearSchedulerCmd ¶ added in v0.24.0
type ClearSchedulerCmd struct{}
func (*ClearSchedulerCmd) Run ¶ added in v0.24.0
func (c *ClearSchedulerCmd) Run(opts *Arguments) error
Run runs the clear command that will remove all scheduled jobs.
type DataCmd ¶
type DataCmd struct {
Delete DeleteCmd `cmd:"delete" help:"Delete objects"`
}
DataCmd defines the `data` command, which contains commands for manipulating data.
type DeleteUserCmd ¶ added in v0.27.0
type DeleteUserCmd struct {
Args
}
func (*DeleteUserCmd) Run ¶ added in v0.27.0
func (c *DeleteUserCmd) Run() error
type InitSchedulerCmd ¶ added in v0.24.0
type InitSchedulerCmd struct{}
func (*InitSchedulerCmd) Run ¶ added in v0.24.0
func (c *InitSchedulerCmd) Run(opts *Arguments) error
Run runs the clear command that will remove all scheduled jobs.
type MigrateCmd ¶
func (*MigrateCmd) Run ¶
func (r *MigrateCmd) Run(opts *MigrateCmd) error
type Option ¶
Option is a functional option for the command-line.
func WithEnvironment ¶
WithEnvironment option sets the environment for the command.
func WithLogger ¶
WithLogger defines a logger for a command.
type RunSchedulerCmd ¶
type RunSchedulerCmd struct{}
func (*RunSchedulerCmd) Run ¶
func (c *RunSchedulerCmd) Run(opts *Arguments) error
Run contains logic for setup and execution of the scheduler.
type SchedulerCmd ¶
type SchedulerCmd struct {
Run RunSchedulerCmd `cmd:"run" help:"Run scheduler."`
Clear ClearSchedulerCmd `cmd:"clear" help:"Clear all jobs."`
Init InitSchedulerCmd `cmd:"init" help:"Initialise the scheduler/queue."`
}
SchedulerCmd defines the `scheduler` command, for running the job scheduler.
type SchemaCmd ¶
type SchemaCmd struct {
Update UpdateCmd `cmd:"update" help:"Update schema(s)"`
Migrate MigrateCmd `cmd:"migrate" help:"Migrate schema(s)"`
}
type ServeCmd ¶
type ServeCmd struct{}
ServeCmd defines the `server` command for running the server.
type UserCmd ¶ added in v0.27.0
type UserCmd struct {
Delete DeleteUserCmd `cmd:"delete" help:"Delete user"`
Block BlockUserCmd `cmd:"delete" help:"Block user"`
}
UserCmd contains sub commands for managing users.