3 Star 2 Fork 1

Gitee 极速下载 / codis

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/CodisLabs/codis
克隆/下载
group.go 727 Bytes
一键复制 编辑 原始数据 按行查看 历史
spinlock 提交于 2016-09-21 19:00 . rename variables
// Copyright 2016 CodisLabs. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package models
const MaxGroupId = 9999
type Group struct {
Id int `json:"id"`
Servers []*GroupServer `json:"servers"`
Promoting struct {
Index int `json:"index,omitempty"`
State string `json:"state,omitempty"`
} `json:"promoting"`
OutOfSync bool `json:"out_of_sync"`
}
type GroupServer struct {
Addr string `json:"server"`
DataCenter string `json:"datacenter"`
Action struct {
Index int `json:"index,omitempty"`
State string `json:"state,omitempty"`
} `json:"action"`
ReplicaGroup bool `json:"replica_group"`
}
func (g *Group) Encode() []byte {
return jsonEncode(g)
}
1
https://gitee.com/mirrors/codis.git
git@gitee.com:mirrors/codis.git
mirrors
codis
codis
de1ad026e329

搜索帮助

53164aa7 5694891 3bd8fe86 5694891