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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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