config

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 17

README

clients

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExpanderPattern = regexp.MustCompile("\\$\\{[^\\$]+\\}")
)

Functions

func Expand

func Expand(original map[string]interface{}) (result map[string]interface{})

func Flattening

func Flattening(val map[string]interface{}) map[string]interface{}

带有层级结构的mpa转换成 拍平的结构 例如: A

b
c

转变为 A.b A.c 叶子的节点的格式都有哪些? 数组? map? 还有一些其他类型的值吗?

func Get

func Get(key string, v interface{}) error

func GetInt

func GetInt(key string) int

func GetString

func GetString(key string) string

func Merge

func Merge(override map[string]interface{}, source map[string]interface{})

the parameter override can be written by source if the override has the same key with source.

func Prefix

func Prefix() string

func Register

func Register(src source.ConfigSource)

func Reload

func Reload() error

func SetConfig

func SetConfig(c *Config)

Types

type Config

type Config struct {
	KeyMap *sync.Map
	// contains filtered or unexported fields
}

func GetDefault

func GetDefault() *Config

func New

func New(configSource string) *Config

func NewDefault

func NewDefault() *Config

func (*Config) Initialize

func (c *Config) Initialize() error

func (*Config) ParseAndSetSourePath

func (c *Config) ParseAndSetSourePath(configSource string)

Directories

Path Synopsis
contrib
xagollo Module
env

Jump to

Keyboard shortcuts

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