utils

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) FromFile added in v0.0.3

func (o InputParam) FromFile() error

FromFile initializes the param from a filepath using o.Name

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) FromFile added in v0.0.3

func (o OutputParam) FromFile() error

FromFile initializes the param from a filepath using o.Name

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