gconf

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigApp added in v0.2.0

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 added in v0.2.0

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

获取key对应的配置

type Value added in v0.2.0

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

func (*Value) AsJson added in v0.2.1

func (v *Value) AsJson() map[string]interface{}

func (*Value) AsProperties added in v0.2.1

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

func (*Value) FileType added in v0.2.0

func (v *Value) FileType() int

func (*Value) Raw added in v0.2.0

func (v *Value) Raw() string

func (*Value) Register added in v0.2.0

func (v *Value) Register(x interface{}) error

注册一个bean,会自动更新

Jump to

Keyboard shortcuts

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