Documentation ¶
Index ¶
- Variables
- func AddConfig(serviceKey string, confKeys []string, values []string) error
- func PullConfigHandler(session *tcp.Session, pb proto.Message)
- func StartAdminService()
- func StartBrokerService()
- func SubscribeHandler(session *tcp.Session, pb proto.Message)
- func UpdateConfig(serviceKey string, version uint, confKeys []string, values []string) error
- type CacheLayerStructure
- type CacheUint
- type EditControl
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEditByOther = errors.New("this service configure is editing by other user now") ErrExist = errors.New("this service is already exist") ErrVersionWrong = errors.New("version number is wrong") ErrNoChange = errors.New("no any different") )
错误
View Source
var AdminServer *tcp.Server
全局:admin server,服务于web操作
View Source
var BrokerServer *tcp.Server
全局:broker server,服务于agent
Functions ¶
func PullConfigHandler ¶
PullServiceConfigReqId消息的回调函数
func StartAdminService ¶
func StartAdminService()
func StartBrokerService ¶
func StartBrokerService()
func SubscribeHandler ¶
SubscribeReqId消息的回调函数
Types ¶
type CacheLayerStructure ¶
type CacheLayerStructure struct {
// contains filtered or unexported fields
}
缓存层
var CacheLayer CacheLayerStructure
全局配置
func (*CacheLayerStructure) GetData ¶
func (cd *CacheLayerStructure) GetData(serviceKey string) ([]string, []string, uint)
读取缓存,获取serviceKey, 最后一个返回值是版本号,是否存在系统中不存在则为0
func (*CacheLayerStructure) UpdateExpiredItem ¶
func (cd *CacheLayerStructure) UpdateExpiredItem(delay int64)
更新过期缓存 (过期时间:delay,秒)
type CacheUint ¶
type CacheUint struct { dao.ServiceData // contains filtered or unexported fields }
缓存单元,记录了加载时间
type EditControl ¶
type EditControl struct {
// contains filtered or unexported fields
}
var EditingControl EditControl //记录正在编辑
func (*EditControl) DoneEditing ¶
func (editControl *EditControl) DoneEditing(serviceKey string)
完成编辑
func (*EditControl) TryMarkEditing ¶
func (editControl *EditControl) TryMarkEditing(serviceKey string) bool
标记某service key处于“编辑”状态 若已在编辑中,返回false 否则返回true
Click to show internal directories.
Click to hide internal directories.