cli

package
v0.81.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: AGPL-3.0 Imports: 20 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 CreateIndciesCmd added in v0.81.0

type CreateIndciesCmd struct {
	schema.Options
}

func (*CreateIndciesCmd) Run added in v0.81.0

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

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 FeedArgs added in v0.71.0

type FeedArgs struct {
	FeedID  models.UserID `arg:"id"  optional:"" help:"ID of feed"`
	FeedURL string        `arg:"url" optional:"" help:"URL of feed"`
}

type FeedCmd added in v0.71.0

type FeedCmd struct {
	Fetch FetchFeedCmd `cmd:"fetch" help:"fetch a feed (by either URL or ID)"`
}

FeedCmd contains sub commands for interacting with feeds.

type FetchFeedCmd added in v0.71.0

type FetchFeedCmd struct {
	FeedArgs

	Validate bool `default:"false" help:"validate the feed"`
}

FetchFeedCmd is a command that will fetch a feed, by either URL or its Feed ID.

func (*FetchFeedCmd) Run added in v0.71.0

func (c *FetchFeedCmd) 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 ListSchedulerCmd added in v0.59.0

type ListSchedulerCmd struct{}

func (*ListSchedulerCmd) Run added in v0.59.0

func (c *ListSchedulerCmd) Run(opts *Arguments) error

Run runs the clear command that will remove all scheduled jobs.

type MigrateDataCmd added in v0.81.0

type MigrateDataCmd struct {
	schema.Options
}

func (*MigrateDataCmd) Run added in v0.81.0

func (r *MigrateDataCmd) Run(opts *MigrateDataCmd) 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 ReverseProxyCmd added in v0.57.0

type ReverseProxyCmd struct {
	Run RunReverseProxyCmd `cmd:"run" help:"Run reverse proxy."`
}

ReverseProxyCmd defines the `reverseproxy` command, for running the reverse proxy.

type RunReverseProxyCmd added in v0.57.0

type RunReverseProxyCmd struct{}

func (*RunReverseProxyCmd) Run added in v0.57.0

func (c *RunReverseProxyCmd) Run(opts *Arguments) error

Run contains logic for setup and execution of the reverse proxy.

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."`
	List  ListSchedulerCmd  `cmd:"list"  help:"List all jobs."`
}

SchedulerCmd defines the `scheduler` command, for running the job scheduler.

type SchemaCmd

type SchemaCmd struct {
	Update  UpdateSchemaCmd  `cmd:"update"  help:"Update schema(s)"`
	Migrate MigrateDataCmd   `cmd:"migrate" help:"Migrate data"`
	Create  CreateIndciesCmd `cmd:"create"  help:"Create indices"`
}

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 UpdateSchemaCmd added in v0.81.0

type UpdateSchemaCmd struct {
	schema.Options
}

func (*UpdateSchemaCmd) Run added in v0.81.0

func (r *UpdateSchemaCmd) Run(opts *UpdateSchemaCmd) 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