common

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PowClient is the powergate client.
	PowClient *client.Client

	// CmdTimeout is the standard timeout.
	CmdTimeout = time.Second * 60
)
View Source
var FmtOutput = os.Stdout

FmtOutput allows to configure where Message(), Success(), and Fatal() helpers should write.

Functions

func AdminAuthCtx

func AdminAuthCtx(ctx context.Context) context.Context

AdminAuthCtx returns the admin auth context built from viper admin token.

func CheckErr

func CheckErr(e error)

CheckErr calls Fatal if there is an error.

func Fatal

func Fatal(err error, args ...interface{})

Fatal prints a fatal error to stdout, and exits immediately with error code 1.

func Message

func Message(format string, args ...interface{})

Message prints a message to stdout.

func MustAuthCtx

func MustAuthCtx(ctx context.Context) context.Context

MustAuthCtx returns the auth context built from viper token.

func RenderTable

func RenderTable(writer io.Writer, header []string, data [][]string)

RenderTable renders a table with header columns and data rows to writer.

func Success

func Success(format string, args ...interface{})

Success prints a success message to stdout.

func WatchJobIds

func WatchJobIds(jobIds ...string)

WatchJobIds watches jobs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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