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
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()
}
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()
}