tconf

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppConfig

func AppConfig(f func(conf *Config))

AppConfig 订阅应用级别配置文件的变化

func GetApp

func GetApp(key string) (res interface{}, ok bool)

GetApp 非阻塞获取应用配置的key value

func GetGlobal

func GetGlobal(key string) (res interface{}, ok bool)

GetGlobal 非阻塞获取全局配置的key value

func GlobalConfig

func GlobalConfig(f func(conf *Config))

GlobalConfig 订阅全局配置文件的变化

func Init

func Init(ctx context.Context) error

需要提前初始化,否则可能获取不到数据

Types

type Config

type Config struct {
	config.Data
	// contains filtered or unexported fields
}

func (*Config) Get

func (c *Config) Get(key string) (res interface{}, ok bool)

func (*Config) Raw

func (c *Config) Raw() []byte

func (*Config) Unmarshal

func (c *Config) Unmarshal(v interface{}) error

Jump to

Keyboard shortcuts

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