cli

package
v0.7.20 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 34

Documentation

Index

Constants

View Source
const (

	// AuthHeaderFlag - the flag name
	AuthHeaderFlag = "auth-header"

	// Authorization the header keyword
	Authorization = "authorization"
)
View Source
const (
	// ExitSuccess means nominal status
	ExitSuccess = iota

	// ExitError means general error
	ExitError

	// ExitBadConnection means failed connection to remote service
	ExitBadConnection

	// ExitBadArgs means invalid argument values were given
	ExitBadArgs = 128
)

Variables

This section is empty.

Functions

func AddConfigFlags

func AddConfigFlags(cmd *cobra.Command, serviceAddress string)

AddConfigFlags :

func CaptureOutput

func CaptureOutput(capture io.Writer)

CaptureOutput allows a test harness to redirect output to an alternate source for testing

func GetConfigCommand

func GetConfigCommand() *cobra.Command

GetConfigCommand :

func GetConnection

func GetConnection(cmd *cobra.Command) (*grpc.ClientConn, error)

GetConnection returns a gRPC client connection to the onos service

func GetOutput

func GetOutput() io.Writer

GetOutput returns the current output writer

func InitConfig

func InitConfig(configNameInit string)

InitConfig :

func NewContextWithAuthHeaderFromFlag added in v0.7.4

func NewContextWithAuthHeaderFromFlag(ctx context.Context, authHeaderFlag *pflag.Flag) context.Context

NewContextWithAuthHeaderFromFlag - use from the CLI with --auth-header flag

func Output

func Output(msg string, args ...interface{})

Output prints the specified format message with arguments to stdout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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