flagx

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CallerSkip = 0

CallerSkip increases the number of callers skipped by caller annotation

Functions

func BindFlags

func BindFlags(o *zap.Options)

BindFlags custom flags

func Init

func Init(configPath *string)

Init the default flags

func JSONEncoderConfig added in v0.8.0

func JSONEncoderConfig() zapcore.EncoderConfig

JSONEncoderConfig returns an opinionated EncoderConfig

func LookupEnvOrBool

func LookupEnvOrBool(key string, defaultVal bool) bool

LookupEnvOrBool adds the capability to get env instead of param flag

func LookupEnvOrString

func LookupEnvOrString(key string, defaultVal string) string

LookupEnvOrString adds the capability to get env instead of param flag

func TextEncoderConfig

func TextEncoderConfig() zapcore.EncoderConfig

TextEncoderConfig returns an opinionated EncoderConfig

func UsageFor

func UsageFor(short string) func()

UsageFor function for flag usage

Types

type LevelFlag

type LevelFlag struct {
	ZapOptions *zap.Options
	// contains filtered or unexported fields
}

LevelFlag contains structure for managing zap level

func (LevelFlag) Set

func (l LevelFlag) Set(flagValue string) error

Set the level flag

func (LevelFlag) String

func (l LevelFlag) String() string

String returns the level flag values

type OutputFormatFlag

type OutputFormatFlag struct {
	ZapOptions *zap.Options
	// contains filtered or unexported fields
}

OutputFormatFlag contains structure for managing zap encoding

func (*OutputFormatFlag) Set

func (o *OutputFormatFlag) Set(flagValue string) error

Set the output format flag

func (*OutputFormatFlag) String

func (o *OutputFormatFlag) String() string

String returns the output format flag values

Jump to

Keyboard shortcuts

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