コード例 #1
0
func (s *single) Marshal() ([]byte, error) {
	var out models.Ring

	out.Version = uint32(s.version)
	out.Type = uint32(s.Type())
	out.Peers = []*models.PeerInfo{s.peer}
	return out.Marshal()
}
コード例 #2
0
ファイル: mod.go プロジェクト: coreos/torus
func (m *mod) Marshal() ([]byte, error) {
	var out models.Ring

	out.Version = uint32(m.version)
	out.ReplicationFactor = uint32(m.rep)
	out.Type = uint32(m.Type())
	out.Peers = m.peers
	return out.Marshal()
}
コード例 #3
0
func (k *ketama) Marshal() ([]byte, error) {
	var out models.Ring

	out.Version = uint32(k.version)
	out.ReplicationFactor = uint32(k.rep)
	out.Type = uint32(k.Type())
	out.Peers = k.peers
	return out.Marshal()
}