config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug deprecated

func Debug() bool

Deprecated: 已废弃,该功能应统一通过配置项来管理

func GetConfigOrDefaultInt64

func GetConfigOrDefaultInt64(key interface{}, defaultValue int64) int64

func GetConfiguration

func GetConfiguration(key interface{}) (interface{}, bool)

func GetConfigurationInt64

func GetConfigurationInt64(key interface{}) (int64, bool)

func GetConfigurationString

func GetConfigurationString(key interface{}) (string, bool)

func MustGetConfigurationString

func MustGetConfigurationString(key interface{}) string

Types

type ConfigMap added in v0.2.0

type ConfigMap map[string]interface{}

func ParseConfig added in v0.2.0

func ParseConfig(filePath string, runMode string) (ConfigMap, error)

func ParseConfigContent added in v0.2.0

func ParseConfigContent(fileContent string) (ConfigMap, error)

func (ConfigMap) GetBool added in v0.2.0

func (c ConfigMap) GetBool(key string) (bool, error)

func (ConfigMap) GetInt64 added in v0.2.0

func (c ConfigMap) GetInt64(key string) (int64, error)

func (ConfigMap) GetString added in v0.2.0

func (c ConfigMap) GetString(key string) (string, error)

func (ConfigMap) GetValue added in v0.2.0

func (c ConfigMap) GetValue(key string) (any, error)

func (ConfigMap) MustGetString added in v0.2.0

func (c ConfigMap) MustGetString(key string) string

Jump to

Keyboard shortcuts

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