cmd

package
v0.0.0-...-1859c0a Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cmd implements widely used cmd arguments and flags.

Index

Constants

View Source
const KubeConfigArg string = "kubeconfig"

KubeConfigArg is the CLI argument for the location of the kube config file

View Source
const LogFormatArg string = "log-format"

LogFormatArg is the CLI argument for the logging format

View Source
const LogLevelArg string = "log-level"

LogLevelArg is the CLI argument for the logging level

View Source
const MongoConnectionStringArg string = "mongo-connection-string"

MongoConnectionStringArg is the CLI argument for the MongoDB connection string

View Source
const MongoDatabaseArg string = "mongo-database"

MongoDatabaseArg is the CLI argument for the MongoDB database

View Source
const OutOfClusterArg string = "out-of-cluster"

OutOfClusterArg is the CLI argument to specify out-of-cluster usage

View Source
const PodNamespaceArg string = "pod-namespace"

PodNamespaceArg is the CLI argument for the pod namespace

Variables

View Source
var LogFormatFlag = &cli.StringFlag{
	Name:    LogFormatArg,
	Usage:   "Log format (plain, json)",
	EnvVars: []string{"LOG_FORMAT"},
	Value:   "plain",
}

LogFormatFlag is the urfave/cli Flag configuration for the logging format

View Source
var LogLevelFlag = &cli.StringFlag{
	Name:    LogLevelArg,
	Usage:   "Log level (trace, debug, info, warn, error)",
	EnvVars: []string{"LOG_LEVEL"},
	Value:   "info",
}

LogLevelFlag is the urfave/cli Flag configuration for the logging level

View Source
var MongoConnectionStringFlag = &cli.StringFlag{
	Name:     MongoConnectionStringArg,
	Usage:    "Specifies the MongoDB connection string.",
	EnvVars:  []string{"MONGO_CONNECTION_STRING"},
	Required: true,
}

MongoConnectionStringFlag is the urfave/cli Flag configuration for the MongoDB connection string

View Source
var MongoDatabaseFlag = &cli.StringFlag{
	Name:     MongoDatabaseArg,
	Usage:    "Specifies the MongoDB database",
	EnvVars:  []string{"MONGO_DATABASE"},
	Required: true,
}

MongoDatabaseFlag is the urfave/cli Flag configuration for the MongoDB database

View Source
var OutOfClusterFlag = &cli.BoolFlag{
	Name:    OutOfClusterArg,
	Usage:   "Will use the default ~/.kube/config file on the local machine to connect to the cluster externally.",
	Aliases: []string{"local"},
}

OutOfClusterFlag is the urfave/cli Flag configuration for out-of-cluster usage

View Source
var PodNamespaceFlag = &cli.StringFlag{
	Name:    PodNamespaceArg,
	Usage:   "Specifies the namespace that current application pod is running in.",
	EnvVars: []string{"POD_NAMESPACE"},
}

PodNamespaceFlag is the urfave/cli Flag configuration for the pod namespace

Functions

func KubeConfig

func KubeConfig() *cli.StringFlag

KubeConfig prepares a urfave/cli Flag configuration for the kube config file

func PrepareLogger

func PrepareLogger(ctx *cli.Context)

PrepareLogger prepares the global logger with options from CLI args

Types

This section is empty.

Jump to

Keyboard shortcuts

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