cli

package
v0.48.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

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 Args added in v0.27.0

type Args struct {
	UserID models.UserID `arg:"" help:"ID of object to delete"`
}

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

func AddArguments(options ...Option) *Arguments

AddArguments generates command-line arguments from the given options.

type BlockUserCmd added in v0.27.0

type BlockUserCmd struct {
	Args
	Value bool `help:"Block status."`
}

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 DeleteCmd

type DeleteCmd struct {
	ObjectID string `arg:"" help:"ID of object to delete"`
}

func (*DeleteCmd) Run

func (c *DeleteCmd) Run(opts *DeleteCmd) error

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

type MigrateCmd struct {
	schema.Options
}

func (*MigrateCmd) Run

func (r *MigrateCmd) Run(opts *MigrateCmd) error

type Option

type Option func(*Arguments) *Arguments

Option is a functional option for the command-line.

func WithEnvironment

func WithEnvironment(env string) Option

WithEnvironment option sets the environment for the command.

func WithLogger

func WithLogger(logger *slog.Logger) Option

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.

func (*ServeCmd) Run

func (r *ServeCmd) Run(opts *Arguments) error

Run performs setup and execution for the server command.

type UpdateCmd

type UpdateCmd struct {
	schema.Options
}

func (*UpdateCmd) Run

func (r *UpdateCmd) Run(opts *UpdateCmd) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL