cobraproxy

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cobraproxy is a package that provides a cobra proxy for the app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cobra

type Cobra interface {
	MaximumNArgs(int) *PositionalArgsInstance
	NewCommand() *CommandInstance
}

Cobra is an interface for cobra.

func New

func New() Cobra

New is a constructor for CommandProxy.

type CobraProxy

type CobraProxy struct{}

CobraProxy is a struct that implements Cobra.

func (*CobraProxy) MaximumNArgs

func (*CobraProxy) MaximumNArgs(n int) *PositionalArgsInstance

MaximumNArgs is a proxy for cobra.MaximumNArgs.

func (*CobraProxy) NewCommand

func (*CobraProxy) NewCommand() *CommandInstance

NewCommand is a proxy for getting cobra.Command struct.

type CommandInstance

type CommandInstance struct {
	FieldCommand *cobra.Command
}

CommandInstance is a struct that implements CommandInstanceInterface.

func (*CommandInstance) AddCommand

func (c *CommandInstance) AddCommand(cmds ...*CommandInstance)

AddCommand is a proxy for cobra.Command.AddCommand.

func (*CommandInstance) Execute

func (c *CommandInstance) Execute() error

Execute is a proxy for cobra.Command.Execute.

func (*CommandInstance) GetCommand

func (c *CommandInstance) GetCommand() *cobra.Command

GetCommand returns the cobra.Command.

func (*CommandInstance) PersistentFlags

func (c *CommandInstance) PersistentFlags() *pflagproxy.FlagSetInstance

PersistentFlags is a proxy for cobra.Command.PersistentFlags.

func (*CommandInstance) RunE added in v1.2.0

func (c *CommandInstance) RunE(cmd *cobra.Command, args []string) error

RunE is a proxy for cobra.Command.RunE.

func (*CommandInstance) SetArgs

func (c *CommandInstance) SetArgs(args []string)

SetArgs is a proxy for cobra.Command.SetArgs.

func (*CommandInstance) SetErr

func (c *CommandInstance) SetErr(io ioproxy.WriterInstanceInterface)

SetErr is a proxy for cobra.Command.SetErr.

func (*CommandInstance) SetHelpTemplate

func (c *CommandInstance) SetHelpTemplate(s string)

SetHelpTemplate is a proxy for cobra.Command.SetHelpTemplate.

func (*CommandInstance) SetOut

func (c *CommandInstance) SetOut(io ioproxy.WriterInstanceInterface)

type CommandInstanceInterface

type CommandInstanceInterface interface {
	AddCommand(cmds ...*CommandInstance)
	Execute() error
	GetCommand() *cobra.Command
	PersistentFlags() *pflagproxy.FlagSetInstance
	RunE(cmd *cobra.Command, args []string) error
	SetArgs(args []string)
	SetErr(io ioproxy.WriterInstanceInterface)
	SetHelpTemplate(s string)
	SetOut(io ioproxy.WriterInstanceInterface)
}

CommandInstanceInterface is an interface for cobra.Command.

type PositionalArgsInstance

type PositionalArgsInstance struct {
	FieldPositionalArgs cobra.PositionalArgs
}

PositionalArgsInstance is a struct that implements PositionalArgsInstanceInterface.

type PositionalArgsInstanceInterface

type PositionalArgsInstanceInterface interface {
}

PositionalArgsInstanceInterface is an interface for cobra.PositionalArgs.

Jump to

Keyboard shortcuts

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