conf

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(file string, dst any) error

func LoadConfigFromJsonBytes

func LoadConfigFromJsonBytes(dst any, content []byte) error

func LoadConfigFromYamlBytes

func LoadConfigFromYamlBytes(dst any, content []byte) error

func MustLoad

func MustLoad(path string, dst any)

必须加载配置,否则应用无法启动,直接退出

Types

type ConfigKV added in v0.4.3

type ConfigKV interface {
	GetString(key string) string
	SetString(key, value string)
	GetInt(key string) int
	SetInt(key string, value int)
	ToString() string
}

ConfigKV interface provides the means to access configuration.

func LoadConfigKV added in v0.4.3

func LoadConfigKV(filename string) (ConfigKV, error)

Loads the kvs into a kvs configuration instance. Returns an error that indicates if there was a problem loading the configuration.

func NewProperties

func NewProperties() ConfigKV

Builds a new kvs configuration structure

type ConfigKVError added in v0.4.3

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

ConfigKVError represents a configuration error message.

func (*ConfigKVError) Error added in v0.4.3

func (configError *ConfigKVError) Error() string

Returns the error message.

Jump to

Keyboard shortcuts

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