configutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustBool

func AdjustBool(v *bool, defValue bool)

AdjustBool adjusts the value of a bool variable.

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 any, 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 to enable the log redaction. It can be the following values:
	//   - false: disable redact log.
	//   - true: enable redact log, which will replace the sensitive information with "?".
	//   - "MARKER": enable redact log, which will use single guillemets ‹› to enclose the sensitive information.
	RedactInfoLog logutil.RedactInfoLogType `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