cmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type InputParam

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

InputParam is a parameter used for input. If the name is a "-" it will use the commands stdin.

func NewInputParam

func NewInputParam() InputParam

NewInputParam creates a new InputParam.

func (InputParam) AddFlag

func (o InputParam) AddFlag(cmd *cobra.Command, name, defaultVal, description string)

AddFlag will add the param to a command

func (InputParam) Close

func (o InputParam) Close() error

Close will close the param's input source if applicable.

func (InputParam) Init

func (o InputParam) Init(cmd *cobra.Command, args []string) error

Init is a function that sets up the parameter with the intended source.

func (*InputParam) Read

func (o *InputParam) Read(p []byte) (int, error)

Read reads from the parameters's source

type OutputParam

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

OutputParam is a parameter used for output. If the name is a "-" it will use the commands stdout.

func NewOutputParam

func NewOutputParam() OutputParam

NewOutputParam creates a new InputParam.

func (OutputParam) AddFlag

func (o OutputParam) AddFlag(cmd *cobra.Command, name, defaultVal, description string)

AddFlag will add the param to a command

func (OutputParam) Close

func (o OutputParam) Close() error

Close will close the param's input source if applicable.

func (OutputParam) Init

func (o OutputParam) Init(cmd *cobra.Command, args []string) error

Init is a function that sets up the parameter with the intended source.

func (*OutputParam) Write

func (o *OutputParam) Write(p []byte) (int, error)

Write writes to the parameters's source.

Jump to

Keyboard shortcuts

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