cli

package
v2.36.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 11 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

Application for cmd.

func NewApplication

func NewApplication(register RegisterFunc, opts ...ApplicationOption) *Application

NewApplication for cmd.

func (*Application) AddClient

func (a *Application) AddClient(name, description string, opts ...Option) *Command

AddClient sub command.

func (*Application) AddServer

func (a *Application) AddServer(name, description string, opts ...Option) *Command

AddServer sub command.

func (*Application) ExitOnError

func (a *Application) ExitOnError(ctx context.Context)

ExitOnError will run the application and exit on error.

func (*Application) Run

func (a *Application) Run(ctx context.Context) error

Run the application.

type ApplicationOption

type ApplicationOption interface {
	// contains filtered or unexported methods
}

ApplicationOption for cmd.

func WithApplicationName

func WithApplicationName(name env.Name) ApplicationOption

WithApplicationName for cmd.

func WithApplicationVersion

func WithApplicationVersion(version env.Version) ApplicationOption

WithApplicationVersion for cmd.

type Command

type Command struct {
	*flag.FlagSet
}

Command for cli.

type Commander

type Commander interface {
	// AddServer sub command.
	AddServer(name, description string, opts ...Option) *Command

	// AddClient sub command.
	AddClient(name, description string, opts ...Option) *Command
}

Commander allows adding different sub commands.

type Option

type Option = fx.Option

Option is an alias of fx.Option.

type RegisterFunc

type RegisterFunc = func(commander Commander)

RegisterFunc for cmd.

Jump to

Keyboard shortcuts

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