Documentation ¶
Index ¶
- Variables
- func RunClient(ctx context.Context, name string, opts ...fx.Option) error
- func RunServer(ctx context.Context, name string, opts ...fx.Option) error
- func SplitFlag(flag string) (string, string)
- func Start(lc fx.Lifecycle, fn StartFn)
- type Command
- func (c *Command) AddClient(opts ...fx.Option) *cobra.Command
- func (c *Command) AddClientCommand(name, description string, opts ...fx.Option) *cobra.Command
- func (c *Command) AddServer(opts ...fx.Option) *cobra.Command
- func (c *Command) AddServerCommand(name, description string, opts ...fx.Option) *cobra.Command
- func (c *Command) RegisterInput(cmd *cobra.Command, value string)
- func (c *Command) RegisterOutput(cmd *cobra.Command, value string)
- func (c *Command) Root() *cobra.Command
- func (c *Command) Run() error
- func (c *Command) RunWithArgs(args []string) error
- type Config
- type ENV
- type File
- type InputConfig
- type None
- type OutputConfig
- type ReaderWriter
- type StartFn
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidLocation = errors.New("invalid location: (format kind:location)")
ErrInvalidLocation for cmd.
View Source
var ErrLocationMissing = errors.New("location is missing")
ErrLocationMissing for cmd.
View Source
var InputFlag = flags.String()
InputFlag for cmd.
View Source
var Module = fx.Options( fx.Provide(NewInputConfig), fx.Provide(NewOutputConfig), )
Module for fx.
View Source
var OutputFlag = flags.String()
OutputFlag for cmd.
Functions ¶
Types ¶
type Command ¶ added in v1.39.0
type Command struct {
// contains filtered or unexported fields
}
Command for application.
func (*Command) AddClientCommand ¶ added in v1.56.2
AddClientCommand to root.
func (*Command) AddServerCommand ¶ added in v1.56.2
AddServerCommand to root.
func (*Command) RegisterInput ¶ added in v1.187.0
RegisterInput for cmd.
func (*Command) RegisterOutput ¶ added in v1.187.0
RegisterInput for cmd.
func (*Command) RunWithArgs ¶ added in v1.78.0
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.
type ENV ¶ added in v1.81.0
type ENV struct {
// contains filtered or unexported fields
}
ENV for cmd.
type File ¶ added in v1.81.0
type File struct {
// contains filtered or unexported fields
}
File for cmd.
type InputConfig ¶ added in v1.81.0
type InputConfig struct {
*Config
}
InputConfig for cmd.
func NewInputConfig ¶ added in v1.81.0
func NewInputConfig(enc *encoding.Map) *InputConfig
NewInputConfig for cmd.
type OutputConfig ¶ added in v1.181.0
type OutputConfig struct {
*Config
}
OutputConfig for cmd.
func NewOutputConfig ¶ added in v1.181.0
func NewOutputConfig(enc *encoding.Map) *OutputConfig
NewOutputConfig for cmd.
type ReaderWriter ¶ added in v1.81.0
type ReaderWriter interface { // Read bytes. Read() ([]byte, error) // Write bytes with files's mode. Write(data []byte, mode fs.FileMode) error // Kind of read writer. Kind() string }
ReaderWriter for cmd.
func NewReadWriter ¶ added in v1.172.5
func NewReadWriter(kind, location string) ReaderWriter
NewReadWriter for cmd.
Click to show internal directories.
Click to hide internal directories.