cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(args []string, opts ...kong.Option) (*kong.Context, error)

Types

type CLI

type CLI struct {
	Port     int32  `short:"p" default:"1205"        help:"Port to listen on."`
	Store    bool   `short:"s"                       help:"Persist the database to disk."`
	RepoFile string `          default:"${RepoFile}" help:"The file to persist the database to."`
	Secure   bool   `short:"S"                       help:"Enable HTTPS."`

	Server ServerCmd `default:"1" help:"Start the server." cmd:""`

	OpenAPI OpenAPICmd `help:"Output the OpenAPI specification version." cmd:"" optional:""`

	Version kong.VersionFlag `short:"v" help:"Show version."`
}

func (*CLI) AfterApply

func (cmd *CLI) AfterApply(ctx *Ctx) error

func (*CLI) Validate

func (cmd *CLI) Validate() error

type Ctx

type Ctx struct {
	*debug.BuildInfo

	io.Writer
	Stop chan os.Signal
	// contains filtered or unexported fields
}

type OpenAPICmd

type OpenAPICmd struct {
	Spec string `default:"3.1" help:"OpenAPI specification version." enum:"3.1,3.0.3"`
}

func (*OpenAPICmd) Run

func (cmd *OpenAPICmd) Run(ctx *Ctx) error

type ServerCmd

type ServerCmd struct {
}

func (*ServerCmd) Run

func (cmd *ServerCmd) Run(ctx *Ctx) error

Jump to

Keyboard shortcuts

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