cmdCommon

package
v0.0.0-...-412dc8c Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

func Fatal(msg string, logger *zap.Logger)

Fatal Log a fatal message and exit, using the zap.Logger if provided or log if not.

func HexOrBase64

func HexOrBase64(value string) ([]byte, error)

HexOrBase64 Decodes the input string as either base-64 or hexadecimal.

func ListenFlags

func ListenFlags(flags *pflag.FlagSet)

func Logger

func Logger() *zap.Logger

func MySQLBindFlagsToEnv

func MySQLBindFlagsToEnv(flags *pflag.FlagSet) error

func MySQLEnvDefaults

func MySQLEnvDefaults() map[string]interface{}

func MySQLEnvToCli

func MySQLEnvToCli() map[string]string

func MySQLFlags

func MySQLFlags(flags *pflag.FlagSet)

func MySQLRegisterDefaults

func MySQLRegisterDefaults()

func MySQLValidate

func MySQLValidate(config MySQLConfigCommon) error

func StdinPassword

func StdinPassword(prompt string, logger *zap.Logger) string

StdinPassword Read a password from standard input, fatally exiting if a problem is encountered.

func ValidateConfig

func ValidateConfig(config interface{}, logger *zap.Logger)

Types

type MySQLConfigCommon

type MySQLConfigCommon struct {
	MySQLHost     string `mapstructure:"mysql_host" govalid:"req" validate:"required,hostname|ip"`
	MySQLPort     uint16 `mapstructure:"mysql_port" govalid:"req" validate:"required,gt=0"`
	MySQLDatabase string `mapstructure:"mysql_database" govalid:"req" validate:"required"`
	MySQLUser     string `mapstructure:"mysql_user" govalid:"req" validate:"required"`
	MySQLPassword string `mapstructure:"mysql_password" govalid:"req" validate:"required"`
}

func (MySQLConfigCommon) Database

func (m MySQLConfigCommon) Database() string

func (MySQLConfigCommon) Host

func (m MySQLConfigCommon) Host() string

func (MySQLConfigCommon) Password

func (m MySQLConfigCommon) Password() string

func (MySQLConfigCommon) Port

func (m MySQLConfigCommon) Port() uint16

func (MySQLConfigCommon) User

func (m MySQLConfigCommon) User() string

Jump to

Keyboard shortcuts

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