config

package
v0.0.0-...-50a2d83 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DftConfigPath = "/mnt/config/default.json"
	CurConfigPath = "/mnt/config/current.json"
)

Functions

func Attach

func Attach(cfgName string, cbName string, callback Callback) bool

Attach 注册配置回调函数

func Detach

func Detach(cfgName string, cbName string) bool

Detach 注销配置回调函数

func GetConfig

func GetConfig(key string, value interface{}) (err error)

func GetDefault

func GetDefault(key string, value interface{}) (err error)

func SetConfig

func SetConfig(key string, value interface{}) (err error)

func SetDefault

func SetDefault(key string, value interface{}) (err error)

Types

type Callback

type Callback interface {
	OnApplyConfig(val interface{}) bool
}

Callback 配置回调接口 (current.json)

Jump to

Keyboard shortcuts

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