|
|
@@ -10,7 +10,6 @@
|
|
|
|
|
|
It has these top-level messages:
|
|
|
Request
|
|
|
- Config
|
|
|
*/
|
|
|
package etcdserverpb
|
|
|
|
|
|
@@ -28,39 +27,6 @@ var _ = proto.Marshal
|
|
|
var _ = &json.SyntaxError{}
|
|
|
var _ = math.Inf
|
|
|
|
|
|
-type ConfigType int32
|
|
|
-
|
|
|
-const (
|
|
|
- ConfigAddNode ConfigType = 0
|
|
|
- ConfigRemoveNode ConfigType = 1
|
|
|
-)
|
|
|
-
|
|
|
-var ConfigType_name = map[int32]string{
|
|
|
- 0: "ConfigAddNode",
|
|
|
- 1: "ConfigRemoveNode",
|
|
|
-}
|
|
|
-var ConfigType_value = map[string]int32{
|
|
|
- "ConfigAddNode": 0,
|
|
|
- "ConfigRemoveNode": 1,
|
|
|
-}
|
|
|
-
|
|
|
-func (x ConfigType) Enum() *ConfigType {
|
|
|
- p := new(ConfigType)
|
|
|
- *p = x
|
|
|
- return p
|
|
|
-}
|
|
|
-func (x ConfigType) String() string {
|
|
|
- return proto.EnumName(ConfigType_name, int32(x))
|
|
|
-}
|
|
|
-func (x *ConfigType) UnmarshalJSON(data []byte) error {
|
|
|
- value, err := proto.UnmarshalJSONEnum(ConfigType_value, data, "ConfigType")
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
- *x = ConfigType(value)
|
|
|
- return nil
|
|
|
-}
|
|
|
-
|
|
|
type Request struct {
|
|
|
Id int64 `protobuf:"varint,1,req,name=id" json:"id"`
|
|
|
Method string `protobuf:"bytes,2,req,name=method" json:"method"`
|
|
|
@@ -84,20 +50,7 @@ func (m *Request) Reset() { *m = Request{} }
|
|
|
func (m *Request) String() string { return proto.CompactTextString(m) }
|
|
|
func (*Request) ProtoMessage() {}
|
|
|
|
|
|
-type Config struct {
|
|
|
- ID int64 `protobuf:"varint,1,req" json:"ID"`
|
|
|
- Type ConfigType `protobuf:"varint,2,req,enum=etcdserverpb.ConfigType" json:"Type"`
|
|
|
- NodeID int64 `protobuf:"varint,3,req" json:"NodeID"`
|
|
|
- Context []byte `protobuf:"bytes,4,opt" json:"Context"`
|
|
|
- XXX_unrecognized []byte `json:"-"`
|
|
|
-}
|
|
|
-
|
|
|
-func (m *Config) Reset() { *m = Config{} }
|
|
|
-func (m *Config) String() string { return proto.CompactTextString(m) }
|
|
|
-func (*Config) ProtoMessage() {}
|
|
|
-
|
|
|
func init() {
|
|
|
- proto.RegisterEnum("etcdserverpb.ConfigType", ConfigType_name, ConfigType_value)
|
|
|
}
|
|
|
func (m *Request) Unmarshal(data []byte) error {
|
|
|
l := len(data)
|
|
|
@@ -407,115 +360,6 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
-func (m *Config) 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 != 0 {
|
|
|
- return code_google_com_p_gogoprotobuf_proto.ErrWrongType
|
|
|
- }
|
|
|
- for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
- return io.ErrUnexpectedEOF
|
|
|
- }
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
- m.ID |= (int64(b) & 0x7F) << shift
|
|
|
- if b < 0x80 {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- case 2:
|
|
|
- if wireType != 0 {
|
|
|
- return code_google_com_p_gogoprotobuf_proto.ErrWrongType
|
|
|
- }
|
|
|
- for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
- return io.ErrUnexpectedEOF
|
|
|
- }
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
- m.Type |= (ConfigType(b) & 0x7F) << shift
|
|
|
- if b < 0x80 {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- case 3:
|
|
|
- if wireType != 0 {
|
|
|
- return code_google_com_p_gogoprotobuf_proto.ErrWrongType
|
|
|
- }
|
|
|
- for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
- return io.ErrUnexpectedEOF
|
|
|
- }
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
- m.NodeID |= (int64(b) & 0x7F) << shift
|
|
|
- if b < 0x80 {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- case 4:
|
|
|
- if wireType != 2 {
|
|
|
- return code_google_com_p_gogoprotobuf_proto.ErrWrongType
|
|
|
- }
|
|
|
- var byteLen int
|
|
|
- for shift := uint(0); ; shift += 7 {
|
|
|
- if index >= l {
|
|
|
- return io.ErrUnexpectedEOF
|
|
|
- }
|
|
|
- b := data[index]
|
|
|
- index++
|
|
|
- byteLen |= (int(b) & 0x7F) << shift
|
|
|
- if b < 0x80 {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- postIndex := index + byteLen
|
|
|
- if postIndex > l {
|
|
|
- return io.ErrUnexpectedEOF
|
|
|
- }
|
|
|
- m.Context = append(m.Context, data[index:postIndex]...)
|
|
|
- index = postIndex
|
|
|
- default:
|
|
|
- var sizeOfWire int
|
|
|
- for {
|
|
|
- sizeOfWire++
|
|
|
- wire >>= 7
|
|
|
- if wire == 0 {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- index -= sizeOfWire
|
|
|
- skippy, err := code_google_com_p_gogoprotobuf_proto.Skip(data[index:])
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
- if (index + skippy) > l {
|
|
|
- return io.ErrUnexpectedEOF
|
|
|
- }
|
|
|
- m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
|
|
|
- index += skippy
|
|
|
- }
|
|
|
- }
|
|
|
- return nil
|
|
|
-}
|
|
|
func (m *Request) Size() (n int) {
|
|
|
var l int
|
|
|
_ = l
|
|
|
@@ -545,19 +389,6 @@ func (m *Request) Size() (n int) {
|
|
|
}
|
|
|
return n
|
|
|
}
|
|
|
-func (m *Config) Size() (n int) {
|
|
|
- var l int
|
|
|
- _ = l
|
|
|
- n += 1 + sovEtcdserver(uint64(m.ID))
|
|
|
- n += 1 + sovEtcdserver(uint64(m.Type))
|
|
|
- n += 1 + sovEtcdserver(uint64(m.NodeID))
|
|
|
- l = len(m.Context)
|
|
|
- n += 1 + l + sovEtcdserver(uint64(l))
|
|
|
- if m.XXX_unrecognized != nil {
|
|
|
- n += len(m.XXX_unrecognized)
|
|
|
- }
|
|
|
- return n
|
|
|
-}
|
|
|
|
|
|
func sovEtcdserver(x uint64) (n int) {
|
|
|
for {
|
|
|
@@ -673,39 +504,6 @@ func (m *Request) MarshalTo(data []byte) (n int, err error) {
|
|
|
}
|
|
|
return i, nil
|
|
|
}
|
|
|
-func (m *Config) 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 *Config) MarshalTo(data []byte) (n int, err error) {
|
|
|
- var i int
|
|
|
- _ = i
|
|
|
- var l int
|
|
|
- _ = l
|
|
|
- data[i] = 0x8
|
|
|
- i++
|
|
|
- i = encodeVarintEtcdserver(data, i, uint64(m.ID))
|
|
|
- data[i] = 0x10
|
|
|
- i++
|
|
|
- i = encodeVarintEtcdserver(data, i, uint64(m.Type))
|
|
|
- data[i] = 0x18
|
|
|
- i++
|
|
|
- i = encodeVarintEtcdserver(data, i, uint64(m.NodeID))
|
|
|
- data[i] = 0x22
|
|
|
- i++
|
|
|
- i = encodeVarintEtcdserver(data, i, uint64(len(m.Context)))
|
|
|
- i += copy(data[i:], m.Context)
|
|
|
- if m.XXX_unrecognized != nil {
|
|
|
- i += copy(data[i:], m.XXX_unrecognized)
|
|
|
- }
|
|
|
- return i, nil
|
|
|
-}
|
|
|
func encodeFixed64Etcdserver(data []byte, offset int, v uint64) int {
|
|
|
data[offset] = uint8(v)
|
|
|
data[offset+1] = uint8(v >> 8)
|