cmd

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: BSD-3-Clause Imports: 41 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLIBackOffSettings = &backoff.ExponentialBackOff{
	InitialInterval:     time.Second,
	RandomizationFactor: backoff.DefaultRandomizationFactor,
	Multiplier:          backoff.DefaultMultiplier,
	MaxInterval:         10 * time.Second,
	MaxElapsedTime:      30 * time.Second,
	Stop:                backoff.Stop,
	Clock:               backoff.SystemClock,
}

CLIBackOffSettings is default backoff settings for CLI commands.

Functions

func DialClientGRPCServer

func DialClientGRPCServer(ctx context.Context, addr string) (*grpc.ClientConn, error)

DialClientGRPCServer returns client connection to the daemon server.

func Execute

func Execute() error

Execute executes the root command.

func FlagNameToEnvVar

func FlagNameToEnvVar(cmdFlag string, prefix string) string

FlagNameToEnvVar converts flag name to environment var name adding a prefix, replacing dashes and making all uppercase (e.g. setup-keys is converted to NB_SETUP_KEYS according to the input prefix)

func SetFlagsFromEnvVars

func SetFlagsFromEnvVars(cmd *cobra.Command)

SetFlagsFromEnvVars reads and updates flag values from environment variables with prefix WT_

func SetupCloseHandler

func SetupCloseHandler(ctx context.Context, cancel context.CancelFunc)

SetupCloseHandler handles SIGTERM signal and exits with success

func WithBackOff

func WithBackOff(bf func() error) error

WithBackOff execute function in backoff cycle.

Types

This section is empty.

Jump to

Keyboard shortcuts

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