config

package
v5.0.3-release+incompa... Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: LGPL-3.0 Imports: 13 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(groupCtx *GroupContext, key string) string

GetConfig 获取配置信息

func GetConfigKey

func GetConfigKey(rk string) string

GetConfigKey 获取配置key

func ResettingArray

func ResettingArray(groupCtx *GroupContext, source []string) ([]string, error)

ResettingArray 根据实际配置解析数组字符串

func ResettingMap

func ResettingMap(groupCtx *GroupContext, source map[string]string) (map[string]string, error)

ResettingMap 根据实际配置解析Map字符串

func ResettingString

func ResettingString(groupCtx *GroupContext, source string) (string, error)

ResettingString 根据实际配置解析字符串

Types

type DataCenterConfig

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

DataCenterConfig 数据中心配置

func CreateDataCenterConfig

func CreateDataCenterConfig() *DataCenterConfig

CreateDataCenterConfig 创建

func GetDataCenterConfig

func GetDataCenterConfig() *DataCenterConfig

GetDataCenterConfig 获取

func (*DataCenterConfig) CacheConfig

func (d *DataCenterConfig) CacheConfig(c *model.ConfigUnit) error

CacheConfig 更新配置缓存

func (*DataCenterConfig) DeleteConfig

func (d *DataCenterConfig) DeleteConfig(name string)

DeleteConfig 删除配置

func (*DataCenterConfig) GetConfig

func (d *DataCenterConfig) GetConfig(name string) *model.ConfigUnit

GetConfig 获取全局配置

func (*DataCenterConfig) GetDataCenterConfig

func (d *DataCenterConfig) GetDataCenterConfig() (*model.GlobalConfig, error)

GetDataCenterConfig 获取配置

func (*DataCenterConfig) GetGroupConfig

func (d *DataCenterConfig) GetGroupConfig(groupID string) *GroupContext

GetGroupConfig get group config

func (*DataCenterConfig) PutConfig

func (d *DataCenterConfig) PutConfig(c *model.ConfigUnit) error

PutConfig 增加or更新配置

func (*DataCenterConfig) PutConfigKV

func (d *DataCenterConfig) PutConfigKV(kv *mvccpb.KeyValue)

PutConfigKV 更新

func (*DataCenterConfig) PutDataCenterConfig

func (d *DataCenterConfig) PutDataCenterConfig(c *model.GlobalConfig) (err error)

PutDataCenterConfig 更改配置

func (*DataCenterConfig) Start

func (d *DataCenterConfig) Start()

Start 启动,监听配置变化

func (*DataCenterConfig) Stop

func (d *DataCenterConfig) Stop()

Stop 停止监听

type GroupContext

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

GroupContext 组任务会话

func NewGroupContext

func NewGroupContext(groupID string) *GroupContext

NewGroupContext 创建组配置会话

func (*GroupContext) Add

func (g *GroupContext) Add(k, v interface{})

Add 添加配置项

func (*GroupContext) Get

func (g *GroupContext) Get(k interface{}) interface{}

Get get

func (*GroupContext) GetString

func (g *GroupContext) GetString(k interface{}) string

GetString get

Jump to

Keyboard shortcuts

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