gconf

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

README

gconf-go-client

go client for gconf

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(encryptedPassword string) string

func Init

func Init(appName string)

call first at program start palace

Types

type ConfigApp

type ConfigApp struct {
	AppId string `json:"configCollectionId"`
	Name  string `json:"name"`
}

type ConfigChangeListener

type ConfigChangeListener interface {
	// contains filtered or unexported methods
}

该方法会在gconf后台同步goroutine里执行,请保证该方法不要有阻塞。不然会影响gconf更新。 key 键 oldValue 老的值,新增key时,该值为"" newValue 新的值,删除key时,该值为""

type ConfigCollection

type ConfigCollection struct {
	// contains filtered or unexported fields
}

配置集合

func GetConfigCollection

func GetConfigCollection(appId string) *ConfigCollection

获取某个appId的配置集合

func GetCurrentConfigCollection

func GetCurrentConfigCollection() *ConfigCollection

获取当前应用的配置集合

func GetGlobalConfigCollection

func GetGlobalConfigCollection() *ConfigCollection

获取全局的配置配置集合,此方法用于框架的统一配置。 应用不需要调用此方法

func (*ConfigCollection) AddConfigChangeListener

func (c *ConfigCollection) AddConfigChangeListener(key string, configChangeListener ConfigChangeListener)

func (*ConfigCollection) AsMap

func (c *ConfigCollection) AsMap() map[string]string

获取配置结合中所有的key-value,以map返回。

func (*ConfigCollection) GetValue

func (c *ConfigCollection) GetValue(key string) *Value

获取key对应的配置

type Value

type Value struct {
	// contains filtered or unexported fields
}

func (*Value) AsJson

func (v *Value) AsJson() map[string]any

func (*Value) AsProperties

func (v *Value) AsProperties() map[string]string

func (*Value) FileType

func (v *Value) FileType() int

func (*Value) Raw

func (v *Value) Raw() string

func (*Value) Register

func (v *Value) Register(x any) error

注册一个bean,会自动更新

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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