config

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v1.5.2

func Get(key string) any

Get 获取

func GetBool added in v1.5.2

func GetBool(key string) bool

GetBool 获取

func GetByte added in v1.5.7

func GetByte(key string) []byte

GetByte 获取

func GetDuration added in v1.5.2

func GetDuration(key string) time.Duration

GetDuration 获取

func GetFloat64 added in v1.5.2

func GetFloat64(key string) float64

GetFloat64 获取

func GetInt added in v1.5.2

func GetInt(key string) int

GetInt 获取

func GetInt64 added in v1.5.2

func GetInt64(key string) int64

GetInt64 获取

func GetIntSlice added in v1.5.2

func GetIntSlice(key string) []int

GetIntSlice 获取

func GetMaps added in v1.5.2

func GetMaps(key string) []map[string]any

GetMaps 获取

func GetString added in v1.5.2

func GetString(key string) string

GetString 获取

func GetStringMap added in v1.5.2

func GetStringMap(key string) map[string]any

GetStringMap 获取

func GetStringMapStringSlice added in v1.5.2

func GetStringMapStringSlice(key string) map[string][]string

GetStringMapStringSlice 获取

func GetStringSlice added in v1.5.2

func GetStringSlice(key string) []string

GetStringSlice 获取

func GetTime added in v1.5.2

func GetTime(key string) time.Time

GetTime 获取

func SetKey added in v1.5.2

func SetKey(key string, value any)

SetKey 设置值

Types

type ConfigStr added in v1.5.2

type ConfigStr struct {
	Viper *viper.Viper

	UserName string
	Password string
	// contains filtered or unexported fields
}
var Config *ConfigStr

func New added in v1.5.2

func New(filePath ...string) *ConfigStr

New<初始化配置>

func (*ConfigStr) AddPath added in v1.5.2

func (c *ConfigStr) AddPath(in string) *ConfigStr

AddPath 增加配置文件路径

func (*ConfigStr) AddRemoteProvider added in v1.5.2

func (c *ConfigStr) AddRemoteProvider(provider, endpoint, path string) error

AddRemoteProvider 添加远程连接

func (*ConfigStr) AddSecureRemoteProvider added in v1.5.2

func (c *ConfigStr) AddSecureRemoteProvider(provider, endpoint, path, secretKeyRing string) error

AddSecureRemoteProvider 添加远程连接

func (*ConfigStr) Etcd3 added in v1.5.2

func (c *ConfigStr) Etcd3(hosts []string, path, username, pwd string) (err error)

Etcd3 ETCD3 configuration link

func (*ConfigStr) Register added in v1.5.9

func (c *ConfigStr) Register() (err error)

Register 注册读取配置

func (*ConfigStr) SetFile added in v1.5.2

func (c *ConfigStr) SetFile(in string) *ConfigStr

SetFile 设置目录

func (*ConfigStr) SetType added in v1.5.2

func (c *ConfigStr) SetType(in string) *ConfigStr

SetType 设置文件类型

Jump to

Keyboard shortcuts

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