|
|
@@ -13,38 +13,76 @@
|
|
|
It has these top-level messages:
|
|
|
Request
|
|
|
Metadata
|
|
|
+ InternalRaftRequest
|
|
|
+ EmptyResponse
|
|
|
+ ResponseHeader
|
|
|
+ RangeRequest
|
|
|
+ RangeResponse
|
|
|
+ PutRequest
|
|
|
+ PutResponse
|
|
|
+ DeleteRangeRequest
|
|
|
+ DeleteRangeResponse
|
|
|
+ RequestUnion
|
|
|
+ ResponseUnion
|
|
|
+ Compare
|
|
|
+ TxnRequest
|
|
|
+ TxnResponse
|
|
|
+ CompactionRequest
|
|
|
+ CompactionResponse
|
|
|
+ WatchRequest
|
|
|
+ WatchCreateRequest
|
|
|
+ WatchCancelRequest
|
|
|
+ WatchResponse
|
|
|
+ LeaseCreateRequest
|
|
|
+ LeaseCreateResponse
|
|
|
+ LeaseRevokeRequest
|
|
|
+ LeaseRevokeResponse
|
|
|
+ LeaseKeepAliveRequest
|
|
|
+ LeaseKeepAliveResponse
|
|
|
+ Member
|
|
|
+ AddMemberRequest
|
|
|
+ AddMemberResponse
|
|
|
+ RemoveMemberRequest
|
|
|
+ RemoveMemberResponse
|
|
|
+ UpdateMemberRequest
|
|
|
+ UpdateMemberResponse
|
|
|
+ ListMemberRequest
|
|
|
+ ListMemberResponse
|
|
|
*/
|
|
|
package etcdserverpb
|
|
|
|
|
|
-import proto "github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
|
|
|
-import math "math"
|
|
|
+import (
|
|
|
+ "fmt"
|
|
|
+
|
|
|
+ proto "github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
|
|
|
+)
|
|
|
|
|
|
-// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto"
|
|
|
+import math "math"
|
|
|
|
|
|
import io "io"
|
|
|
-import fmt "fmt"
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
var _ = proto.Marshal
|
|
|
+var _ = fmt.Errorf
|
|
|
var _ = math.Inf
|
|
|
|
|
|
type Request struct {
|
|
|
- ID uint64 `protobuf:"varint,1,opt" json:"ID"`
|
|
|
- Method string `protobuf:"bytes,2,opt" json:"Method"`
|
|
|
- Path string `protobuf:"bytes,3,opt" json:"Path"`
|
|
|
- Val string `protobuf:"bytes,4,opt" json:"Val"`
|
|
|
- Dir bool `protobuf:"varint,5,opt" json:"Dir"`
|
|
|
- PrevValue string `protobuf:"bytes,6,opt" json:"PrevValue"`
|
|
|
- PrevIndex uint64 `protobuf:"varint,7,opt" json:"PrevIndex"`
|
|
|
- PrevExist *bool `protobuf:"varint,8,opt" json:"PrevExist,omitempty"`
|
|
|
- Expiration int64 `protobuf:"varint,9,opt" json:"Expiration"`
|
|
|
- Wait bool `protobuf:"varint,10,opt" json:"Wait"`
|
|
|
- Since uint64 `protobuf:"varint,11,opt" json:"Since"`
|
|
|
- Recursive bool `protobuf:"varint,12,opt" json:"Recursive"`
|
|
|
- Sorted bool `protobuf:"varint,13,opt" json:"Sorted"`
|
|
|
- Quorum bool `protobuf:"varint,14,opt" json:"Quorum"`
|
|
|
- Time int64 `protobuf:"varint,15,opt" json:"Time"`
|
|
|
- Stream bool `protobuf:"varint,16,opt" json:"Stream"`
|
|
|
+ ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"`
|
|
|
+ Method string `protobuf:"bytes,2,opt,name=Method" json:"Method"`
|
|
|
+ Path string `protobuf:"bytes,3,opt,name=Path" json:"Path"`
|
|
|
+ Val string `protobuf:"bytes,4,opt,name=Val" json:"Val"`
|
|
|
+ Dir bool `protobuf:"varint,5,opt,name=Dir" json:"Dir"`
|
|
|
+ PrevValue string `protobuf:"bytes,6,opt,name=PrevValue" json:"PrevValue"`
|
|
|
+ PrevIndex uint64 `protobuf:"varint,7,opt,name=PrevIndex" json:"PrevIndex"`
|
|
|
+ PrevExist *bool `protobuf:"varint,8,opt,name=PrevExist" json:"PrevExist,omitempty"`
|
|
|
+ Expiration int64 `protobuf:"varint,9,opt,name=Expiration" json:"Expiration"`
|
|
|
+ Wait bool `protobuf:"varint,10,opt,name=Wait" json:"Wait"`
|
|
|
+ Since uint64 `protobuf:"varint,11,opt,name=Since" json:"Since"`
|
|
|
+ Recursive bool `protobuf:"varint,12,opt,name=Recursive" json:"Recursive"`
|
|
|
+ Sorted bool `protobuf:"varint,13,opt,name=Sorted" json:"Sorted"`
|
|
|
+ Quorum bool `protobuf:"varint,14,opt,name=Quorum" json:"Quorum"`
|
|
|
+ Time int64 `protobuf:"varint,15,opt,name=Time" json:"Time"`
|
|
|
+ Stream bool `protobuf:"varint,16,opt,name=Stream" json:"Stream"`
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
}
|
|
|
|
|
|
@@ -53,8 +91,8 @@ func (m *Request) String() string { return proto.CompactTextString(m) }
|
|
|
func (*Request) ProtoMessage() {}
|
|
|
|
|
|
type Metadata struct {
|
|
|
- NodeID uint64 `protobuf:"varint,1,opt" json:"NodeID"`
|
|
|
- ClusterID uint64 `protobuf:"varint,2,opt" json:"ClusterID"`
|
|
|
+ NodeID uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"`
|
|
|
+ ClusterID uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"`
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
}
|
|
|
|
|
|
@@ -62,6 +100,10 @@ func (m *Metadata) Reset() { *m = Metadata{} }
|
|
|
func (m *Metadata) String() string { return proto.CompactTextString(m) }
|
|
|
func (*Metadata) ProtoMessage() {}
|
|
|
|
|
|
+func init() {
|
|
|
+ proto.RegisterType((*Request)(nil), "etcdserverpb.Request")
|
|
|
+ proto.RegisterType((*Metadata)(nil), "etcdserverpb.Metadata")
|
|
|
+}
|
|
|
func (m *Request) Marshal() (data []byte, err error) {
|
|
|
size := m.Size()
|
|
|
data = make([]byte, size)
|
|
|
@@ -287,8 +329,12 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
l := len(data)
|
|
|
iNdEx := 0
|
|
|
for iNdEx < l {
|
|
|
+ preIndex := iNdEx
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -301,6 +347,12 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
wireType := int(wire & 0x7)
|
|
|
+ if wireType == 4 {
|
|
|
+ return fmt.Errorf("proto: Request: wiretype end group for non-group")
|
|
|
+ }
|
|
|
+ if fieldNum <= 0 {
|
|
|
+ return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
+ }
|
|
|
switch fieldNum {
|
|
|
case 1:
|
|
|
if wireType != 0 {
|
|
|
@@ -308,6 +360,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.ID = 0
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -324,6 +379,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var stringLen uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -350,6 +408,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var stringLen uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -376,6 +437,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var stringLen uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -402,6 +466,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -419,6 +486,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var stringLen uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -445,6 +515,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.PrevIndex = 0
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -461,6 +534,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -479,6 +555,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.Expiration = 0
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -495,6 +574,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -512,6 +594,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.Since = 0
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -528,6 +613,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -545,6 +633,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -562,6 +653,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -579,6 +673,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.Time = 0
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -595,6 +692,9 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
var v int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -607,15 +707,7 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.Stream = bool(v != 0)
|
|
|
default:
|
|
|
- var sizeOfWire int
|
|
|
- for {
|
|
|
- sizeOfWire++
|
|
|
- wire >>= 7
|
|
|
- if wire == 0 {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- iNdEx -= sizeOfWire
|
|
|
+ iNdEx = preIndex
|
|
|
skippy, err := skipEtcdserver(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -631,14 +723,21 @@ func (m *Request) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if iNdEx > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
return nil
|
|
|
}
|
|
|
func (m *Metadata) Unmarshal(data []byte) error {
|
|
|
l := len(data)
|
|
|
iNdEx := 0
|
|
|
for iNdEx < l {
|
|
|
+ preIndex := iNdEx
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -651,6 +750,12 @@ func (m *Metadata) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
fieldNum := int32(wire >> 3)
|
|
|
wireType := int(wire & 0x7)
|
|
|
+ if wireType == 4 {
|
|
|
+ return fmt.Errorf("proto: Metadata: wiretype end group for non-group")
|
|
|
+ }
|
|
|
+ if fieldNum <= 0 {
|
|
|
+ return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
+ }
|
|
|
switch fieldNum {
|
|
|
case 1:
|
|
|
if wireType != 0 {
|
|
|
@@ -658,6 +763,9 @@ func (m *Metadata) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.NodeID = 0
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -674,6 +782,9 @@ func (m *Metadata) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
m.ClusterID = 0
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -685,15 +796,7 @@ func (m *Metadata) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
}
|
|
|
default:
|
|
|
- var sizeOfWire int
|
|
|
- for {
|
|
|
- sizeOfWire++
|
|
|
- wire >>= 7
|
|
|
- if wire == 0 {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- iNdEx -= sizeOfWire
|
|
|
+ iNdEx = preIndex
|
|
|
skippy, err := skipEtcdserver(data[iNdEx:])
|
|
|
if err != nil {
|
|
|
return err
|
|
|
@@ -709,6 +812,9 @@ func (m *Metadata) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if iNdEx > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
return nil
|
|
|
}
|
|
|
func skipEtcdserver(data []byte) (n int, err error) {
|
|
|
@@ -717,6 +823,9 @@ func skipEtcdserver(data []byte) (n int, err error) {
|
|
|
for iNdEx < l {
|
|
|
var wire uint64
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return 0, ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -730,7 +839,10 @@ func skipEtcdserver(data []byte) (n int, err error) {
|
|
|
wireType := int(wire & 0x7)
|
|
|
switch wireType {
|
|
|
case 0:
|
|
|
- for {
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return 0, ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -746,6 +858,9 @@ func skipEtcdserver(data []byte) (n int, err error) {
|
|
|
case 2:
|
|
|
var length int
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return 0, ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -766,6 +881,9 @@ func skipEtcdserver(data []byte) (n int, err error) {
|
|
|
var innerWire uint64
|
|
|
var start int = iNdEx
|
|
|
for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return 0, ErrIntOverflowEtcdserver
|
|
|
+ }
|
|
|
if iNdEx >= l {
|
|
|
return 0, io.ErrUnexpectedEOF
|
|
|
}
|
|
|
@@ -801,4 +919,5 @@ func skipEtcdserver(data []byte) (n int, err error) {
|
|
|
|
|
|
var (
|
|
|
ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
|
+ ErrIntOverflowEtcdserver = fmt.Errorf("proto: integer overflow")
|
|
|
)
|