configutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustByteSize

func AdjustByteSize(v *typeutil.ByteSize, defValue typeutil.ByteSize)

AdjustByteSize adjusts the value of a ByteSize variable.

func AdjustCommandlineBool

func AdjustCommandlineBool(flagSet *pflag.FlagSet, v *bool, name string)

AdjustCommandlineBool adjusts the value of a bool variable from command line flags.

func AdjustCommandlineString

func AdjustCommandlineString(flagSet *pflag.FlagSet, v *string, name string)

AdjustCommandlineString adjusts the value of a string variable from command line flags.

func AdjustDuration

func AdjustDuration(v *typeutil.Duration, defValue time.Duration)

AdjustDuration adjusts the value of a Duration variable.

func AdjustFloat64

func AdjustFloat64(v *float64, defValue float64)

AdjustFloat64 adjusts the value of a float64 variable.

func AdjustInt

func AdjustInt(v *int, defValue int)

AdjustInt adjusts the value of a int variable.

func AdjustInt64

func AdjustInt64(v *int64, defValue int64)

AdjustInt64 adjusts the value of a int64 variable.

func AdjustPath

func AdjustPath(p *string)

AdjustPath adjusts the value of a path variable.

func AdjustString

func AdjustString(v *string, defValue string)

AdjustString adjusts the value of a string variable.

func AdjustUint64

func AdjustUint64(v *uint64, defValue uint64)

AdjustUint64 adjusts the value of a uint64 variable.

func ConfigFromFile

func ConfigFromFile(c interface{}, path string) (*toml.MetaData, error)

ConfigFromFile loads config from file.

func PrintConfigCheckMsg

func PrintConfigCheckMsg(w io.Writer, warningMsgs []string)

PrintConfigCheckMsg prints the message about configuration checks.

Types

type ConfigMetaData

type ConfigMetaData struct {
	// contains filtered or unexported fields
}

ConfigMetaData is an utility to test if a configuration is defined.

func NewConfigMetadata

func NewConfigMetadata(meta *toml.MetaData) *ConfigMetaData

NewConfigMetadata is the a factory method to create a ConfigMetaData object

func (*ConfigMetaData) CheckUndecoded

func (m *ConfigMetaData) CheckUndecoded() error

CheckUndecoded checks if the configuration contains undefined items

func (*ConfigMetaData) Child

func (m *ConfigMetaData) Child(path ...string) *ConfigMetaData

Child gets the config metadata of the given path

func (*ConfigMetaData) IsDefined

func (m *ConfigMetaData) IsDefined(key string) bool

IsDefined checks if the given key is defined in the configuration

type SecurityConfig

type SecurityConfig struct {
	grpcutil.TLSConfig
	// RedactInfoLog indicates that whether enabling redact log
	RedactInfoLog bool              `toml:"redact-info-log" json:"redact-info-log"`
	Encryption    encryption.Config `toml:"encryption" json:"encryption"`
}

SecurityConfig indicates the security configuration

Jump to

Keyboard shortcuts

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