cmd

package
v1.151.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 13 Imported by: 40

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidKind for cmd.
	ErrInvalidKind = errors.New("invalid kind")
)

Module for fx.

Functions

func RunClient added in v1.39.0

func RunClient(opts ...fx.Option) error

RunClient with args and a timeout.

func RunServer

func RunServer(opts ...fx.Option) error

RunServer with args and a timeout.

Types

type Command added in v1.39.0

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

Command for application.

func New

func New(version string) *Command

New command.

func (*Command) AddClient added in v1.39.0

func (c *Command) AddClient(opts ...fx.Option) *cobra.Command

AddClient to the command.

func (*Command) AddClientCommand added in v1.56.2

func (c *Command) AddClientCommand(name, description string, opts ...fx.Option) *cobra.Command

AddClientCommand to root.

func (*Command) AddServer added in v1.39.0

func (c *Command) AddServer(opts ...fx.Option) *cobra.Command

AddServer to the command.

func (*Command) AddServerCommand added in v1.56.2

func (c *Command) AddServerCommand(name, description string, opts ...fx.Option) *cobra.Command

AddServerCommand to root.

func (*Command) Run added in v1.39.0

func (c *Command) Run() error

Run the command.

func (*Command) RunWithArgs added in v1.78.0

func (c *Command) RunWithArgs(args []string) error

Run the command with a an arg.

type Config added in v1.78.0

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

Config for cmd.

func NewConfig added in v1.78.0

func NewConfig(flag string, factory *marshaller.Factory) (*Config, error)

NewConfig for cmd.

func (*Config) Kind added in v1.138.5

func (c *Config) Kind() string

Kind of config.

func (*Config) Unmarshal added in v1.81.0

func (c *Config) Unmarshal(data any) error

Unmarshal for config.

func (*Config) Write added in v1.81.0

func (c *Config) Write(data []byte, mode fs.FileMode) error

Write for config.

type ENV added in v1.81.0

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

ENV for cmd.

func NewENV added in v1.81.0

func NewENV(location string) *ENV

NewENV for cmd.

func (*ENV) Kind added in v1.81.0

func (e *ENV) Kind() string

Write for env.

func (*ENV) Read added in v1.81.0

func (e *ENV) Read() ([]byte, error)

Read for env.

func (*ENV) Write added in v1.81.0

func (e *ENV) Write(data []byte, mode fs.FileMode) error

Write for env.

type File added in v1.81.0

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

File for cmd.

func NewFile added in v1.81.0

func NewFile(location string) *File

NewFile for cmd.

func (*File) Kind added in v1.81.0

func (f *File) Kind() string

Write for file.

func (*File) Read added in v1.81.0

func (f *File) Read() ([]byte, error)

Read for file.

func (*File) Write added in v1.81.0

func (f *File) Write(data []byte, mode fs.FileMode) error

Write for file.

type InputConfig added in v1.81.0

type InputConfig struct {
	*Config
}

InputConfig for cmd.

func NewInputConfig added in v1.81.0

func NewInputConfig(factory *marshaller.Factory) (*InputConfig, error)

NewInputConfig for cmd.

type ReaderWriter added in v1.81.0

type ReaderWriter interface {
	Read() ([]byte, error)
	Write(data []byte, mode fs.FileMode) error
	Kind() string
}

ReaderWriter for cmd.

Jump to

Keyboard shortcuts

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