1268 lines
28 KiB
Go
1268 lines
28 KiB
Go
// Code generated by protoc-gen-gogo.
|
|
// source: registry.proto
|
|
// DO NOT EDIT!
|
|
|
|
package mesosproto
|
|
|
|
import proto "github.com/gogo/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto"
|
|
|
|
import bytes "bytes"
|
|
|
|
import strings "strings"
|
|
import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
|
|
import sort "sort"
|
|
import strconv "strconv"
|
|
import reflect "reflect"
|
|
|
|
import io "io"
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
type Registry struct {
|
|
// Most recent leading master.
|
|
Master *Registry_Master `protobuf:"bytes,1,opt,name=master" json:"master,omitempty"`
|
|
// All admitted slaves.
|
|
Slaves *Registry_Slaves `protobuf:"bytes,2,opt,name=slaves" json:"slaves,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *Registry) Reset() { *m = Registry{} }
|
|
func (*Registry) ProtoMessage() {}
|
|
|
|
func (m *Registry) GetMaster() *Registry_Master {
|
|
if m != nil {
|
|
return m.Master
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Registry) GetSlaves() *Registry_Slaves {
|
|
if m != nil {
|
|
return m.Slaves
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Registry_Master struct {
|
|
Info *MasterInfo `protobuf:"bytes,1,req,name=info" json:"info,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *Registry_Master) Reset() { *m = Registry_Master{} }
|
|
func (*Registry_Master) ProtoMessage() {}
|
|
|
|
func (m *Registry_Master) GetInfo() *MasterInfo {
|
|
if m != nil {
|
|
return m.Info
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Registry_Slave struct {
|
|
Info *SlaveInfo `protobuf:"bytes,1,req,name=info" json:"info,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *Registry_Slave) Reset() { *m = Registry_Slave{} }
|
|
func (*Registry_Slave) ProtoMessage() {}
|
|
|
|
func (m *Registry_Slave) GetInfo() *SlaveInfo {
|
|
if m != nil {
|
|
return m.Info
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Registry_Slaves struct {
|
|
Slaves []*Registry_Slave `protobuf:"bytes,1,rep,name=slaves" json:"slaves,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *Registry_Slaves) Reset() { *m = Registry_Slaves{} }
|
|
func (*Registry_Slaves) ProtoMessage() {}
|
|
|
|
func (m *Registry_Slaves) GetSlaves() []*Registry_Slave {
|
|
if m != nil {
|
|
return m.Slaves
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (this *Registry) VerboseEqual(that interface{}) error {
|
|
if that == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that == nil && this != nil")
|
|
}
|
|
|
|
that1, ok := that.(*Registry)
|
|
if !ok {
|
|
return fmt.Errorf("that is not of type *Registry")
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that is type *Registry but is nil && this != nil")
|
|
} else if this == nil {
|
|
return fmt.Errorf("that is type *Registrybut is not nil && this == nil")
|
|
}
|
|
if !this.Master.Equal(that1.Master) {
|
|
return fmt.Errorf("Master this(%v) Not Equal that(%v)", this.Master, that1.Master)
|
|
}
|
|
if !this.Slaves.Equal(that1.Slaves) {
|
|
return fmt.Errorf("Slaves this(%v) Not Equal that(%v)", this.Slaves, that1.Slaves)
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
|
|
}
|
|
return nil
|
|
}
|
|
func (this *Registry) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Registry)
|
|
if !ok {
|
|
return false
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if !this.Master.Equal(that1.Master) {
|
|
return false
|
|
}
|
|
if !this.Slaves.Equal(that1.Slaves) {
|
|
return false
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Registry_Master) VerboseEqual(that interface{}) error {
|
|
if that == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that == nil && this != nil")
|
|
}
|
|
|
|
that1, ok := that.(*Registry_Master)
|
|
if !ok {
|
|
return fmt.Errorf("that is not of type *Registry_Master")
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that is type *Registry_Master but is nil && this != nil")
|
|
} else if this == nil {
|
|
return fmt.Errorf("that is type *Registry_Masterbut is not nil && this == nil")
|
|
}
|
|
if !this.Info.Equal(that1.Info) {
|
|
return fmt.Errorf("Info this(%v) Not Equal that(%v)", this.Info, that1.Info)
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
|
|
}
|
|
return nil
|
|
}
|
|
func (this *Registry_Master) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Registry_Master)
|
|
if !ok {
|
|
return false
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if !this.Info.Equal(that1.Info) {
|
|
return false
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Registry_Slave) VerboseEqual(that interface{}) error {
|
|
if that == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that == nil && this != nil")
|
|
}
|
|
|
|
that1, ok := that.(*Registry_Slave)
|
|
if !ok {
|
|
return fmt.Errorf("that is not of type *Registry_Slave")
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that is type *Registry_Slave but is nil && this != nil")
|
|
} else if this == nil {
|
|
return fmt.Errorf("that is type *Registry_Slavebut is not nil && this == nil")
|
|
}
|
|
if !this.Info.Equal(that1.Info) {
|
|
return fmt.Errorf("Info this(%v) Not Equal that(%v)", this.Info, that1.Info)
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
|
|
}
|
|
return nil
|
|
}
|
|
func (this *Registry_Slave) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Registry_Slave)
|
|
if !ok {
|
|
return false
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if !this.Info.Equal(that1.Info) {
|
|
return false
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Registry_Slaves) VerboseEqual(that interface{}) error {
|
|
if that == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that == nil && this != nil")
|
|
}
|
|
|
|
that1, ok := that.(*Registry_Slaves)
|
|
if !ok {
|
|
return fmt.Errorf("that is not of type *Registry_Slaves")
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return nil
|
|
}
|
|
return fmt.Errorf("that is type *Registry_Slaves but is nil && this != nil")
|
|
} else if this == nil {
|
|
return fmt.Errorf("that is type *Registry_Slavesbut is not nil && this == nil")
|
|
}
|
|
if len(this.Slaves) != len(that1.Slaves) {
|
|
return fmt.Errorf("Slaves this(%v) Not Equal that(%v)", len(this.Slaves), len(that1.Slaves))
|
|
}
|
|
for i := range this.Slaves {
|
|
if !this.Slaves[i].Equal(that1.Slaves[i]) {
|
|
return fmt.Errorf("Slaves this[%v](%v) Not Equal that[%v](%v)", i, this.Slaves[i], i, that1.Slaves[i])
|
|
}
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return fmt.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
|
|
}
|
|
return nil
|
|
}
|
|
func (this *Registry_Slaves) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
that1, ok := that.(*Registry_Slaves)
|
|
if !ok {
|
|
return false
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return true
|
|
}
|
|
return false
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if len(this.Slaves) != len(that1.Slaves) {
|
|
return false
|
|
}
|
|
for i := range this.Slaves {
|
|
if !this.Slaves[i].Equal(that1.Slaves[i]) {
|
|
return false
|
|
}
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *Registry) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := make([]string, 0, 6)
|
|
s = append(s, "&mesosproto.Registry{")
|
|
if this.Master != nil {
|
|
s = append(s, "Master: "+fmt.Sprintf("%#v", this.Master)+",\n")
|
|
}
|
|
if this.Slaves != nil {
|
|
s = append(s, "Slaves: "+fmt.Sprintf("%#v", this.Slaves)+",\n")
|
|
}
|
|
if this.XXX_unrecognized != nil {
|
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
|
}
|
|
s = append(s, "}")
|
|
return strings.Join(s, "")
|
|
}
|
|
func (this *Registry_Master) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := make([]string, 0, 5)
|
|
s = append(s, "&mesosproto.Registry_Master{")
|
|
if this.Info != nil {
|
|
s = append(s, "Info: "+fmt.Sprintf("%#v", this.Info)+",\n")
|
|
}
|
|
if this.XXX_unrecognized != nil {
|
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
|
}
|
|
s = append(s, "}")
|
|
return strings.Join(s, "")
|
|
}
|
|
func (this *Registry_Slave) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := make([]string, 0, 5)
|
|
s = append(s, "&mesosproto.Registry_Slave{")
|
|
if this.Info != nil {
|
|
s = append(s, "Info: "+fmt.Sprintf("%#v", this.Info)+",\n")
|
|
}
|
|
if this.XXX_unrecognized != nil {
|
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
|
}
|
|
s = append(s, "}")
|
|
return strings.Join(s, "")
|
|
}
|
|
func (this *Registry_Slaves) GoString() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := make([]string, 0, 5)
|
|
s = append(s, "&mesosproto.Registry_Slaves{")
|
|
if this.Slaves != nil {
|
|
s = append(s, "Slaves: "+fmt.Sprintf("%#v", this.Slaves)+",\n")
|
|
}
|
|
if this.XXX_unrecognized != nil {
|
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
|
}
|
|
s = append(s, "}")
|
|
return strings.Join(s, "")
|
|
}
|
|
func valueToGoStringRegistry(v interface{}, typ string) string {
|
|
rv := reflect.ValueOf(v)
|
|
if rv.IsNil() {
|
|
return "nil"
|
|
}
|
|
pv := reflect.Indirect(rv).Interface()
|
|
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
|
|
}
|
|
func extensionToGoStringRegistry(e map[int32]github_com_gogo_protobuf_proto.Extension) string {
|
|
if e == nil {
|
|
return "nil"
|
|
}
|
|
s := "map[int32]proto.Extension{"
|
|
keys := make([]int, 0, len(e))
|
|
for k := range e {
|
|
keys = append(keys, int(k))
|
|
}
|
|
sort.Ints(keys)
|
|
ss := []string{}
|
|
for _, k := range keys {
|
|
ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
|
|
}
|
|
s += strings.Join(ss, ",") + "}"
|
|
return s
|
|
}
|
|
func (m *Registry) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *Registry) MarshalTo(data []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Master != nil {
|
|
data[i] = 0xa
|
|
i++
|
|
i = encodeVarintRegistry(data, i, uint64(m.Master.Size()))
|
|
n1, err := m.Master.MarshalTo(data[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n1
|
|
}
|
|
if m.Slaves != nil {
|
|
data[i] = 0x12
|
|
i++
|
|
i = encodeVarintRegistry(data, i, uint64(m.Slaves.Size()))
|
|
n2, err := m.Slaves.MarshalTo(data[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n2
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(data[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Registry_Master) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *Registry_Master) MarshalTo(data []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Info == nil {
|
|
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("info")
|
|
} else {
|
|
data[i] = 0xa
|
|
i++
|
|
i = encodeVarintRegistry(data, i, uint64(m.Info.Size()))
|
|
n3, err := m.Info.MarshalTo(data[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n3
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(data[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Registry_Slave) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *Registry_Slave) MarshalTo(data []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Info == nil {
|
|
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("info")
|
|
} else {
|
|
data[i] = 0xa
|
|
i++
|
|
i = encodeVarintRegistry(data, i, uint64(m.Info.Size()))
|
|
n4, err := m.Info.MarshalTo(data[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n4
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(data[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Registry_Slaves) Marshal() (data []byte, err error) {
|
|
size := m.Size()
|
|
data = make([]byte, size)
|
|
n, err := m.MarshalTo(data)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return data[:n], nil
|
|
}
|
|
|
|
func (m *Registry_Slaves) MarshalTo(data []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Slaves) > 0 {
|
|
for _, msg := range m.Slaves {
|
|
data[i] = 0xa
|
|
i++
|
|
i = encodeVarintRegistry(data, i, uint64(msg.Size()))
|
|
n, err := msg.MarshalTo(data[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(data[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func encodeFixed64Registry(data []byte, offset int, v uint64) int {
|
|
data[offset] = uint8(v)
|
|
data[offset+1] = uint8(v >> 8)
|
|
data[offset+2] = uint8(v >> 16)
|
|
data[offset+3] = uint8(v >> 24)
|
|
data[offset+4] = uint8(v >> 32)
|
|
data[offset+5] = uint8(v >> 40)
|
|
data[offset+6] = uint8(v >> 48)
|
|
data[offset+7] = uint8(v >> 56)
|
|
return offset + 8
|
|
}
|
|
func encodeFixed32Registry(data []byte, offset int, v uint32) int {
|
|
data[offset] = uint8(v)
|
|
data[offset+1] = uint8(v >> 8)
|
|
data[offset+2] = uint8(v >> 16)
|
|
data[offset+3] = uint8(v >> 24)
|
|
return offset + 4
|
|
}
|
|
func encodeVarintRegistry(data []byte, offset int, v uint64) int {
|
|
for v >= 1<<7 {
|
|
data[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
data[offset] = uint8(v)
|
|
return offset + 1
|
|
}
|
|
func NewPopulatedRegistry(r randyRegistry, easy bool) *Registry {
|
|
this := &Registry{}
|
|
if r.Intn(10) != 0 {
|
|
this.Master = NewPopulatedRegistry_Master(r, easy)
|
|
}
|
|
if r.Intn(10) != 0 {
|
|
this.Slaves = NewPopulatedRegistry_Slaves(r, easy)
|
|
}
|
|
if !easy && r.Intn(10) != 0 {
|
|
this.XXX_unrecognized = randUnrecognizedRegistry(r, 3)
|
|
}
|
|
return this
|
|
}
|
|
|
|
func NewPopulatedRegistry_Master(r randyRegistry, easy bool) *Registry_Master {
|
|
this := &Registry_Master{}
|
|
this.Info = NewPopulatedMasterInfo(r, easy)
|
|
if !easy && r.Intn(10) != 0 {
|
|
this.XXX_unrecognized = randUnrecognizedRegistry(r, 2)
|
|
}
|
|
return this
|
|
}
|
|
|
|
func NewPopulatedRegistry_Slave(r randyRegistry, easy bool) *Registry_Slave {
|
|
this := &Registry_Slave{}
|
|
this.Info = NewPopulatedSlaveInfo(r, easy)
|
|
if !easy && r.Intn(10) != 0 {
|
|
this.XXX_unrecognized = randUnrecognizedRegistry(r, 2)
|
|
}
|
|
return this
|
|
}
|
|
|
|
func NewPopulatedRegistry_Slaves(r randyRegistry, easy bool) *Registry_Slaves {
|
|
this := &Registry_Slaves{}
|
|
if r.Intn(10) != 0 {
|
|
v1 := r.Intn(10)
|
|
this.Slaves = make([]*Registry_Slave, v1)
|
|
for i := 0; i < v1; i++ {
|
|
this.Slaves[i] = NewPopulatedRegistry_Slave(r, easy)
|
|
}
|
|
}
|
|
if !easy && r.Intn(10) != 0 {
|
|
this.XXX_unrecognized = randUnrecognizedRegistry(r, 2)
|
|
}
|
|
return this
|
|
}
|
|
|
|
type randyRegistry interface {
|
|
Float32() float32
|
|
Float64() float64
|
|
Int63() int64
|
|
Int31() int32
|
|
Uint32() uint32
|
|
Intn(n int) int
|
|
}
|
|
|
|
func randUTF8RuneRegistry(r randyRegistry) rune {
|
|
ru := r.Intn(62)
|
|
if ru < 10 {
|
|
return rune(ru + 48)
|
|
} else if ru < 36 {
|
|
return rune(ru + 55)
|
|
}
|
|
return rune(ru + 61)
|
|
}
|
|
func randStringRegistry(r randyRegistry) string {
|
|
v2 := r.Intn(100)
|
|
tmps := make([]rune, v2)
|
|
for i := 0; i < v2; i++ {
|
|
tmps[i] = randUTF8RuneRegistry(r)
|
|
}
|
|
return string(tmps)
|
|
}
|
|
func randUnrecognizedRegistry(r randyRegistry, maxFieldNumber int) (data []byte) {
|
|
l := r.Intn(5)
|
|
for i := 0; i < l; i++ {
|
|
wire := r.Intn(4)
|
|
if wire == 3 {
|
|
wire = 5
|
|
}
|
|
fieldNumber := maxFieldNumber + r.Intn(100)
|
|
data = randFieldRegistry(data, r, fieldNumber, wire)
|
|
}
|
|
return data
|
|
}
|
|
func randFieldRegistry(data []byte, r randyRegistry, fieldNumber int, wire int) []byte {
|
|
key := uint32(fieldNumber)<<3 | uint32(wire)
|
|
switch wire {
|
|
case 0:
|
|
data = encodeVarintPopulateRegistry(data, uint64(key))
|
|
v3 := r.Int63()
|
|
if r.Intn(2) == 0 {
|
|
v3 *= -1
|
|
}
|
|
data = encodeVarintPopulateRegistry(data, uint64(v3))
|
|
case 1:
|
|
data = encodeVarintPopulateRegistry(data, uint64(key))
|
|
data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
|
case 2:
|
|
data = encodeVarintPopulateRegistry(data, uint64(key))
|
|
ll := r.Intn(100)
|
|
data = encodeVarintPopulateRegistry(data, uint64(ll))
|
|
for j := 0; j < ll; j++ {
|
|
data = append(data, byte(r.Intn(256)))
|
|
}
|
|
default:
|
|
data = encodeVarintPopulateRegistry(data, uint64(key))
|
|
data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
|
}
|
|
return data
|
|
}
|
|
func encodeVarintPopulateRegistry(data []byte, v uint64) []byte {
|
|
for v >= 1<<7 {
|
|
data = append(data, uint8(uint64(v)&0x7f|0x80))
|
|
v >>= 7
|
|
}
|
|
data = append(data, uint8(v))
|
|
return data
|
|
}
|
|
func (m *Registry) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if m.Master != nil {
|
|
l = m.Master.Size()
|
|
n += 1 + l + sovRegistry(uint64(l))
|
|
}
|
|
if m.Slaves != nil {
|
|
l = m.Slaves.Size()
|
|
n += 1 + l + sovRegistry(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Registry_Master) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if m.Info != nil {
|
|
l = m.Info.Size()
|
|
n += 1 + l + sovRegistry(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Registry_Slave) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if m.Info != nil {
|
|
l = m.Info.Size()
|
|
n += 1 + l + sovRegistry(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Registry_Slaves) Size() (n int) {
|
|
var l int
|
|
_ = l
|
|
if len(m.Slaves) > 0 {
|
|
for _, e := range m.Slaves {
|
|
l = e.Size()
|
|
n += 1 + l + sovRegistry(uint64(l))
|
|
}
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovRegistry(x uint64) (n int) {
|
|
for {
|
|
n++
|
|
x >>= 7
|
|
if x == 0 {
|
|
break
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
func sozRegistry(x uint64) (n int) {
|
|
return sovRegistry(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (this *Registry) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Registry{`,
|
|
`Master:` + strings.Replace(fmt.Sprintf("%v", this.Master), "Registry_Master", "Registry_Master", 1) + `,`,
|
|
`Slaves:` + strings.Replace(fmt.Sprintf("%v", this.Slaves), "Registry_Slaves", "Registry_Slaves", 1) + `,`,
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Registry_Master) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Registry_Master{`,
|
|
`Info:` + strings.Replace(fmt.Sprintf("%v", this.Info), "MasterInfo", "MasterInfo", 1) + `,`,
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Registry_Slave) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Registry_Slave{`,
|
|
`Info:` + strings.Replace(fmt.Sprintf("%v", this.Info), "SlaveInfo", "SlaveInfo", 1) + `,`,
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func (this *Registry_Slaves) String() string {
|
|
if this == nil {
|
|
return "nil"
|
|
}
|
|
s := strings.Join([]string{`&Registry_Slaves{`,
|
|
`Slaves:` + strings.Replace(fmt.Sprintf("%v", this.Slaves), "Registry_Slave", "Registry_Slave", 1) + `,`,
|
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
`}`,
|
|
}, "")
|
|
return s
|
|
}
|
|
func valueToStringRegistry(v interface{}) string {
|
|
rv := reflect.ValueOf(v)
|
|
if rv.IsNil() {
|
|
return "nil"
|
|
}
|
|
pv := reflect.Indirect(rv).Interface()
|
|
return fmt.Sprintf("*%v", pv)
|
|
}
|
|
func (m *Registry) Unmarshal(data []byte) error {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Master", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Master == nil {
|
|
m.Master = &Registry_Master{}
|
|
}
|
|
if err := m.Master.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Slaves", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Slaves == nil {
|
|
m.Slaves = &Registry_Slaves{}
|
|
}
|
|
if err := m.Slaves.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipRegistry(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func (m *Registry_Master) Unmarshal(data []byte) error {
|
|
var hasFields [1]uint64
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Info == nil {
|
|
m.Info = &MasterInfo{}
|
|
}
|
|
if err := m.Info.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
hasFields[0] |= uint64(0x00000001)
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipRegistry(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
if hasFields[0]&uint64(0x00000001) == 0 {
|
|
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("info")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func (m *Registry_Slave) Unmarshal(data []byte) error {
|
|
var hasFields [1]uint64
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Info == nil {
|
|
m.Info = &SlaveInfo{}
|
|
}
|
|
if err := m.Info.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
hasFields[0] |= uint64(0x00000001)
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipRegistry(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
if hasFields[0]&uint64(0x00000001) == 0 {
|
|
return github_com_gogo_protobuf_proto.NewRequiredNotSetError("info")
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func (m *Registry_Slaves) Unmarshal(data []byte) error {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
fieldNum := int32(wire >> 3)
|
|
wireType := int(wire & 0x7)
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Slaves", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
msglen |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Slaves = append(m.Slaves, &Registry_Slave{})
|
|
if err := m.Slaves[len(m.Slaves)-1].Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
var sizeOfWire int
|
|
for {
|
|
sizeOfWire++
|
|
wire >>= 7
|
|
if wire == 0 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx -= sizeOfWire
|
|
skippy, err := skipRegistry(data[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthRegistry
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func skipRegistry(data []byte) (n int, err error) {
|
|
l := len(data)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
wire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
wireType := int(wire & 0x7)
|
|
switch wireType {
|
|
case 0:
|
|
for {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if data[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 1:
|
|
iNdEx += 8
|
|
return iNdEx, nil
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
length |= (int(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
iNdEx += length
|
|
if length < 0 {
|
|
return 0, ErrInvalidLengthRegistry
|
|
}
|
|
return iNdEx, nil
|
|
case 3:
|
|
for {
|
|
var innerWire uint64
|
|
var start int = iNdEx
|
|
for shift := uint(0); ; shift += 7 {
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := data[iNdEx]
|
|
iNdEx++
|
|
innerWire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
innerWireType := int(innerWire & 0x7)
|
|
if innerWireType == 4 {
|
|
break
|
|
}
|
|
next, err := skipRegistry(data[start:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
iNdEx = start + next
|
|
}
|
|
return iNdEx, nil
|
|
case 4:
|
|
return iNdEx, nil
|
|
case 5:
|
|
iNdEx += 4
|
|
return iNdEx, nil
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
}
|
|
panic("unreachable")
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthRegistry = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
)
|