cmdcore

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(rootCmd *cobra.Command, cmdFuncs map[string]CommandEntry)

Types

type CommandContext

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

func NewCommandContext

func NewCommandContext(adminClient service.AdminServiceClient, out io.Writer) CommandContext

func (CommandContext) AdminClient

func (c CommandContext) AdminClient() service.AdminServiceClient

func (CommandContext) InputPipe

func (c CommandContext) InputPipe() io.Reader

func (CommandContext) OutputPipe

func (c CommandContext) OutputPipe() io.Writer

type CommandEntry

type CommandEntry struct {
	ProjectDomainNotRequired bool
	CmdFunc                  CommandFunc
	Aliases                  []string
	Short                    string
	Long                     string
	PFlagProvider            PFlagProvider
}

type CommandFunc

type CommandFunc func(ctx context.Context, args []string, cmdCtx CommandContext) error

type PFlagProvider

type PFlagProvider interface {
	GetPFlagSet(prefix string) *pflag.FlagSet
}

Jump to

Keyboard shortcuts

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