snapshot_response.pb.go 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. // Code generated by protoc-gen-gogo.
  2. // source: snapshot_response.proto
  3. // DO NOT EDIT!
  4. package protobuf
  5. import proto "github.com/coreos/etcd/third_party/code.google.com/p/gogoprotobuf/proto"
  6. import json "encoding/json"
  7. import math "math"
  8. // discarding unused import gogoproto "code.google.com/p/gogoprotobuf/gogoproto/gogo.pb"
  9. import io8 "io"
  10. import code_google_com_p_gogoprotobuf_proto16 "github.com/coreos/etcd/third_party/code.google.com/p/gogoprotobuf/proto"
  11. import fmt24 "fmt"
  12. import strings16 "strings"
  13. import reflect16 "reflect"
  14. import fmt25 "fmt"
  15. import strings17 "strings"
  16. import code_google_com_p_gogoprotobuf_proto17 "github.com/coreos/etcd/third_party/code.google.com/p/gogoprotobuf/proto"
  17. import sort8 "sort"
  18. import strconv8 "strconv"
  19. import reflect17 "reflect"
  20. import fmt26 "fmt"
  21. import bytes8 "bytes"
  22. // Reference proto, json, and math imports to suppress error if they are not otherwise used.
  23. var _ = proto.Marshal
  24. var _ = &json.SyntaxError{}
  25. var _ = math.Inf
  26. type SnapshotResponse struct {
  27. Success *bool `protobuf:"varint,1,req" json:"Success,omitempty"`
  28. XXX_unrecognized []byte `json:"-"`
  29. }
  30. func (m *SnapshotResponse) Reset() { *m = SnapshotResponse{} }
  31. func (*SnapshotResponse) ProtoMessage() {}
  32. func (m *SnapshotResponse) GetSuccess() bool {
  33. if m != nil && m.Success != nil {
  34. return *m.Success
  35. }
  36. return false
  37. }
  38. func init() {
  39. }
  40. func (m *SnapshotResponse) Unmarshal(data []byte) error {
  41. l := len(data)
  42. index := 0
  43. for index < l {
  44. var wire uint64
  45. for shift := uint(0); ; shift += 7 {
  46. if index >= l {
  47. return io8.ErrUnexpectedEOF
  48. }
  49. b := data[index]
  50. index++
  51. wire |= (uint64(b) & 0x7F) << shift
  52. if b < 0x80 {
  53. break
  54. }
  55. }
  56. fieldNum := int32(wire >> 3)
  57. wireType := int(wire & 0x7)
  58. switch fieldNum {
  59. case 1:
  60. if wireType != 0 {
  61. return proto.ErrWrongType
  62. }
  63. var v int
  64. for shift := uint(0); ; shift += 7 {
  65. if index >= l {
  66. return io8.ErrUnexpectedEOF
  67. }
  68. b := data[index]
  69. index++
  70. v |= (int(b) & 0x7F) << shift
  71. if b < 0x80 {
  72. break
  73. }
  74. }
  75. b := bool(v != 0)
  76. m.Success = &b
  77. default:
  78. var sizeOfWire int
  79. for {
  80. sizeOfWire++
  81. wire >>= 7
  82. if wire == 0 {
  83. break
  84. }
  85. }
  86. index -= sizeOfWire
  87. skippy, err := code_google_com_p_gogoprotobuf_proto16.Skip(data[index:])
  88. if err != nil {
  89. return err
  90. }
  91. m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
  92. index += skippy
  93. }
  94. }
  95. return nil
  96. }
  97. func (this *SnapshotResponse) String() string {
  98. if this == nil {
  99. return "nil"
  100. }
  101. s := strings16.Join([]string{`&SnapshotResponse{`,
  102. `Success:` + valueToStringSnapshotResponse(this.Success) + `,`,
  103. `XXX_unrecognized:` + fmt24.Sprintf("%v", this.XXX_unrecognized) + `,`,
  104. `}`,
  105. }, "")
  106. return s
  107. }
  108. func valueToStringSnapshotResponse(v interface{}) string {
  109. rv := reflect16.ValueOf(v)
  110. if rv.IsNil() {
  111. return "nil"
  112. }
  113. pv := reflect16.Indirect(rv).Interface()
  114. return fmt24.Sprintf("*%v", pv)
  115. }
  116. func (m *SnapshotResponse) Size() (n int) {
  117. var l int
  118. _ = l
  119. if m.Success != nil {
  120. n += 2
  121. }
  122. if m.XXX_unrecognized != nil {
  123. n += len(m.XXX_unrecognized)
  124. }
  125. return n
  126. }
  127. func sovSnapshotResponse(x uint64) (n int) {
  128. for {
  129. n++
  130. x >>= 7
  131. if x == 0 {
  132. break
  133. }
  134. }
  135. return n
  136. }
  137. func sozSnapshotResponse(x uint64) (n int) {
  138. return sovSnapshotResponse(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  139. return sovSnapshotResponse(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  140. }
  141. func NewPopulatedSnapshotResponse(r randySnapshotResponse, easy bool) *SnapshotResponse {
  142. this := &SnapshotResponse{}
  143. v1 := bool(r.Intn(2) == 0)
  144. this.Success = &v1
  145. if !easy && r.Intn(10) != 0 {
  146. this.XXX_unrecognized = randUnrecognizedSnapshotResponse(r, 2)
  147. }
  148. return this
  149. }
  150. type randySnapshotResponse interface {
  151. Float32() float32
  152. Float64() float64
  153. Int63() int64
  154. Int31() int32
  155. Uint32() uint32
  156. Intn(n int) int
  157. }
  158. func randUTF8RuneSnapshotResponse(r randySnapshotResponse) rune {
  159. res := rune(r.Uint32() % 1112064)
  160. if 55296 <= res {
  161. res += 2047
  162. }
  163. return res
  164. }
  165. func randStringSnapshotResponse(r randySnapshotResponse) string {
  166. v2 := r.Intn(100)
  167. tmps := make([]rune, v2)
  168. for i := 0; i < v2; i++ {
  169. tmps[i] = randUTF8RuneSnapshotResponse(r)
  170. }
  171. return string(tmps)
  172. }
  173. func randUnrecognizedSnapshotResponse(r randySnapshotResponse, maxFieldNumber int) (data []byte) {
  174. l := r.Intn(5)
  175. for i := 0; i < l; i++ {
  176. wire := r.Intn(4)
  177. if wire == 3 {
  178. wire = 5
  179. }
  180. fieldNumber := maxFieldNumber + r.Intn(100)
  181. data = randFieldSnapshotResponse(data, r, fieldNumber, wire)
  182. }
  183. return data
  184. }
  185. func randFieldSnapshotResponse(data []byte, r randySnapshotResponse, fieldNumber int, wire int) []byte {
  186. key := uint32(fieldNumber)<<3 | uint32(wire)
  187. switch wire {
  188. case 0:
  189. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  190. data = encodeVarintPopulateSnapshotResponse(data, uint64(r.Int63()))
  191. case 1:
  192. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  193. 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)))
  194. case 2:
  195. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  196. ll := r.Intn(100)
  197. data = encodeVarintPopulateSnapshotResponse(data, uint64(ll))
  198. for j := 0; j < ll; j++ {
  199. data = append(data, byte(r.Intn(256)))
  200. }
  201. default:
  202. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  203. data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  204. }
  205. return data
  206. }
  207. func encodeVarintPopulateSnapshotResponse(data []byte, v uint64) []byte {
  208. for v >= 1<<7 {
  209. data = append(data, uint8(uint64(v)&0x7f|0x80))
  210. v >>= 7
  211. }
  212. data = append(data, uint8(v))
  213. return data
  214. }
  215. func (m *SnapshotResponse) Marshal() (data []byte, err error) {
  216. size := m.Size()
  217. data = make([]byte, size)
  218. n, err := m.MarshalTo(data)
  219. if err != nil {
  220. return nil, err
  221. }
  222. return data[:n], nil
  223. }
  224. func (m *SnapshotResponse) MarshalTo(data []byte) (n int, err error) {
  225. var i int
  226. _ = i
  227. var l int
  228. _ = l
  229. if m.Success != nil {
  230. data[i] = 0x8
  231. i++
  232. if *m.Success {
  233. data[i] = 1
  234. } else {
  235. data[i] = 0
  236. }
  237. i++
  238. }
  239. if m.XXX_unrecognized != nil {
  240. i += copy(data[i:], m.XXX_unrecognized)
  241. }
  242. return i, nil
  243. }
  244. func encodeFixed64SnapshotResponse(data []byte, offset int, v uint64) int {
  245. data[offset] = uint8(v)
  246. data[offset+1] = uint8(v >> 8)
  247. data[offset+2] = uint8(v >> 16)
  248. data[offset+3] = uint8(v >> 24)
  249. data[offset+4] = uint8(v >> 32)
  250. data[offset+5] = uint8(v >> 40)
  251. data[offset+6] = uint8(v >> 48)
  252. data[offset+7] = uint8(v >> 56)
  253. return offset + 8
  254. }
  255. func encodeFixed32SnapshotResponse(data []byte, offset int, v uint32) int {
  256. data[offset] = uint8(v)
  257. data[offset+1] = uint8(v >> 8)
  258. data[offset+2] = uint8(v >> 16)
  259. data[offset+3] = uint8(v >> 24)
  260. return offset + 4
  261. }
  262. func encodeVarintSnapshotResponse(data []byte, offset int, v uint64) int {
  263. for v >= 1<<7 {
  264. data[offset] = uint8(v&0x7f | 0x80)
  265. v >>= 7
  266. offset++
  267. }
  268. data[offset] = uint8(v)
  269. return offset + 1
  270. }
  271. func (this *SnapshotResponse) GoString() string {
  272. if this == nil {
  273. return "nil"
  274. }
  275. s := strings17.Join([]string{`&protobuf.SnapshotResponse{` + `Success:` + valueToGoStringSnapshotResponse(this.Success, "bool"), `XXX_unrecognized:` + fmt25.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ")
  276. return s
  277. }
  278. func valueToGoStringSnapshotResponse(v interface{}, typ string) string {
  279. rv := reflect17.ValueOf(v)
  280. if rv.IsNil() {
  281. return "nil"
  282. }
  283. pv := reflect17.Indirect(rv).Interface()
  284. return fmt25.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
  285. }
  286. func extensionToGoStringSnapshotResponse(e map[int32]code_google_com_p_gogoprotobuf_proto17.Extension) string {
  287. if e == nil {
  288. return "nil"
  289. }
  290. s := "map[int32]proto.Extension{"
  291. keys := make([]int, 0, len(e))
  292. for k := range e {
  293. keys = append(keys, int(k))
  294. }
  295. sort8.Ints(keys)
  296. ss := []string{}
  297. for _, k := range keys {
  298. ss = append(ss, strconv8.Itoa(k)+": "+e[int32(k)].GoString())
  299. }
  300. s += strings17.Join(ss, ",") + "}"
  301. return s
  302. }
  303. func (this *SnapshotResponse) VerboseEqual(that interface{}) error {
  304. if that == nil {
  305. if this == nil {
  306. return nil
  307. }
  308. return fmt26.Errorf("that == nil && this != nil")
  309. }
  310. that1, ok := that.(*SnapshotResponse)
  311. if !ok {
  312. return fmt26.Errorf("that is not of type *SnapshotResponse")
  313. }
  314. if that1 == nil {
  315. if this == nil {
  316. return nil
  317. }
  318. return fmt26.Errorf("that is type *SnapshotResponse but is nil && this != nil")
  319. } else if this == nil {
  320. return fmt26.Errorf("that is type *SnapshotResponsebut is not nil && this == nil")
  321. }
  322. if this.Success != nil && that1.Success != nil {
  323. if *this.Success != *that1.Success {
  324. return fmt26.Errorf("Success this(%v) Not Equal that(%v)", *this.Success, *that1.Success)
  325. }
  326. } else if this.Success != nil {
  327. return fmt26.Errorf("this.Success == nil && that.Success != nil")
  328. } else if that1.Success != nil {
  329. return fmt26.Errorf("Success this(%v) Not Equal that(%v)", this.Success, that1.Success)
  330. }
  331. if !bytes8.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  332. return fmt26.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
  333. }
  334. return nil
  335. }
  336. func (this *SnapshotResponse) Equal(that interface{}) bool {
  337. if that == nil {
  338. if this == nil {
  339. return true
  340. }
  341. return false
  342. }
  343. that1, ok := that.(*SnapshotResponse)
  344. if !ok {
  345. return false
  346. }
  347. if that1 == nil {
  348. if this == nil {
  349. return true
  350. }
  351. return false
  352. } else if this == nil {
  353. return false
  354. }
  355. if this.Success != nil && that1.Success != nil {
  356. if *this.Success != *that1.Success {
  357. return false
  358. }
  359. } else if this.Success != nil {
  360. return false
  361. } else if that1.Success != nil {
  362. return false
  363. }
  364. if !bytes8.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  365. return false
  366. }
  367. return true
  368. }