1 Star 0 Fork 0

ichub / goconfig

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
config_context.go 1.13 KB
Copy Edit Raw Blame History
leijmdas authored 2024-05-12 22:56 . add
package baseconfig
import (
"gitee.com/ichub/goconfig/common/base/encrypt"
"sync"
)
/*
@Title 文件名称: config_context.go
@Description 描述: 配置上下文
@Author 作者: leijianming@163.com 时间(2024-03-18 22:38:21)
@Update 作者: leijianming@163.com 时间(2024-03-18 22:38:21)
*/
var Context = NewConfigContext()
var lock sync.RWMutex
type ConfigContext struct {
env_vars map[string]any
encdec encrypt.IEncDec
}
func NewConfigContext() *ConfigContext {
return &ConfigContext{
encdec: encrypt.EncDecInst,
}
}
func (this *ConfigContext) Env_vars() map[string]any {
return this.env_vars
}
func (this *ConfigContext) SetEnv_vars(env_vars map[string]any) {
this.env_vars = env_vars
}
func (this *ConfigContext) Encdec() encrypt.IEncDec {
return this.encdec
}
func (this *ConfigContext) SetEncdec(encdec encrypt.IEncDec) {
this.encdec = encdec
}
func (this *ConfigContext) RegisterEncDec(encdec encrypt.IEncDec) {
lock.Lock()
this.encdec = encdec
lock.Unlock()
}
func (this *ConfigContext) Ini() {
}
func (this *ConfigContext) FindVar(key string) {
}
func (this *ConfigContext) PutVar(key string, value any) {
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ichub/goconfig.git
git@gitee.com:ichub/goconfig.git
ichub
goconfig
goconfig
v1.0.407

Search