helpers

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrFromPeer added in v0.3.0

func AddrFromPeer(remote *peer.Peer) (peerHost string)

AddrFromPeer extracts peer address from grpc Peer.

func ExtractTarGz added in v0.3.0

func ExtractTarGz(localPath string, r io.ReadCloser) error

ExtractTarGz extracts .tar.gz archive from r into filesystem under localPath.

nolint: gocyclo

func FailIfMultiNodes added in v0.3.0

func FailIfMultiNodes(ctx context.Context, command string) error

FailIfMultiNodes checks if ctx contains multi-node request metadata.

func Fatalf

func Fatalf(message string, args ...interface{})

Fatalf prints formatted message to stderr and aborts execution

func RemotePeer added in v0.3.0

func RemotePeer(ctx context.Context) (peerHost string)

RemotePeer parses remote peer address from grpc stream context.

func Should

func Should(err error)

Should panics if err != nil

Should is useful when error should never happen in customer environment, it can only be development error.

func Warning added in v0.3.0

func Warning(message string, args ...interface{})

Warning prints formatted message to stderr

func WithCLIContext added in v0.3.0

func WithCLIContext(ctx context.Context, f func(context.Context) error) error

WithCLIContext wraps function call to provide a context cancellable with ^C.

Types

This section is empty.

Jump to

Keyboard shortcuts

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