snapshot_response.pb.go 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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 code_google_com_p_gogoprotobuf_proto16.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. if (index + skippy) > l {
  92. return io8.ErrUnexpectedEOF
  93. }
  94. m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
  95. index += skippy
  96. }
  97. }
  98. return nil
  99. }
  100. func (this *SnapshotResponse) String() string {
  101. if this == nil {
  102. return "nil"
  103. }
  104. s := strings16.Join([]string{`&SnapshotResponse{`,
  105. `Success:` + valueToStringSnapshotResponse(this.Success) + `,`,
  106. `XXX_unrecognized:` + fmt24.Sprintf("%v", this.XXX_unrecognized) + `,`,
  107. `}`,
  108. }, "")
  109. return s
  110. }
  111. func valueToStringSnapshotResponse(v interface{}) string {
  112. rv := reflect16.ValueOf(v)
  113. if rv.IsNil() {
  114. return "nil"
  115. }
  116. pv := reflect16.Indirect(rv).Interface()
  117. return fmt24.Sprintf("*%v", pv)
  118. }
  119. func (m *SnapshotResponse) Size() (n int) {
  120. var l int
  121. _ = l
  122. if m.Success != nil {
  123. n += 2
  124. }
  125. if m.XXX_unrecognized != nil {
  126. n += len(m.XXX_unrecognized)
  127. }
  128. return n
  129. }
  130. func sovSnapshotResponse(x uint64) (n int) {
  131. for {
  132. n++
  133. x >>= 7
  134. if x == 0 {
  135. break
  136. }
  137. }
  138. return n
  139. }
  140. func sozSnapshotResponse(x uint64) (n int) {
  141. return sovSnapshotResponse(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  142. }
  143. func NewPopulatedSnapshotResponse(r randySnapshotResponse, easy bool) *SnapshotResponse {
  144. this := &SnapshotResponse{}
  145. v1 := bool(r.Intn(2) == 0)
  146. this.Success = &v1
  147. if !easy && r.Intn(10) != 0 {
  148. this.XXX_unrecognized = randUnrecognizedSnapshotResponse(r, 2)
  149. }
  150. return this
  151. }
  152. type randySnapshotResponse interface {
  153. Float32() float32
  154. Float64() float64
  155. Int63() int64
  156. Int31() int32
  157. Uint32() uint32
  158. Intn(n int) int
  159. }
  160. func randUTF8RuneSnapshotResponse(r randySnapshotResponse) rune {
  161. res := rune(r.Uint32() % 1112064)
  162. if 55296 <= res {
  163. res += 2047
  164. }
  165. return res
  166. }
  167. func randStringSnapshotResponse(r randySnapshotResponse) string {
  168. v2 := r.Intn(100)
  169. tmps := make([]rune, v2)
  170. for i := 0; i < v2; i++ {
  171. tmps[i] = randUTF8RuneSnapshotResponse(r)
  172. }
  173. return string(tmps)
  174. }
  175. func randUnrecognizedSnapshotResponse(r randySnapshotResponse, maxFieldNumber int) (data []byte) {
  176. l := r.Intn(5)
  177. for i := 0; i < l; i++ {
  178. wire := r.Intn(4)
  179. if wire == 3 {
  180. wire = 5
  181. }
  182. fieldNumber := maxFieldNumber + r.Intn(100)
  183. data = randFieldSnapshotResponse(data, r, fieldNumber, wire)
  184. }
  185. return data
  186. }
  187. func randFieldSnapshotResponse(data []byte, r randySnapshotResponse, fieldNumber int, wire int) []byte {
  188. key := uint32(fieldNumber)<<3 | uint32(wire)
  189. switch wire {
  190. case 0:
  191. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  192. data = encodeVarintPopulateSnapshotResponse(data, uint64(r.Int63()))
  193. case 1:
  194. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  195. 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)))
  196. case 2:
  197. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  198. ll := r.Intn(100)
  199. data = encodeVarintPopulateSnapshotResponse(data, uint64(ll))
  200. for j := 0; j < ll; j++ {
  201. data = append(data, byte(r.Intn(256)))
  202. }
  203. default:
  204. data = encodeVarintPopulateSnapshotResponse(data, uint64(key))
  205. data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  206. }
  207. return data
  208. }
  209. func encodeVarintPopulateSnapshotResponse(data []byte, v uint64) []byte {
  210. for v >= 1<<7 {
  211. data = append(data, uint8(uint64(v)&0x7f|0x80))
  212. v >>= 7
  213. }
  214. data = append(data, uint8(v))
  215. return data
  216. }
  217. func (m *SnapshotResponse) Marshal() (data []byte, err error) {
  218. size := m.Size()
  219. data = make([]byte, size)
  220. n, err := m.MarshalTo(data)
  221. if err != nil {
  222. return nil, err
  223. }
  224. return data[:n], nil
  225. }
  226. func (m *SnapshotResponse) MarshalTo(data []byte) (n int, err error) {
  227. var i int
  228. _ = i
  229. var l int
  230. _ = l
  231. if m.Success != nil {
  232. data[i] = 0x8
  233. i++
  234. if *m.Success {
  235. data[i] = 1
  236. } else {
  237. data[i] = 0
  238. }
  239. i++
  240. }
  241. if m.XXX_unrecognized != nil {
  242. i += copy(data[i:], m.XXX_unrecognized)
  243. }
  244. return i, nil
  245. }
  246. func encodeFixed64SnapshotResponse(data []byte, offset int, v uint64) int {
  247. data[offset] = uint8(v)
  248. data[offset+1] = uint8(v >> 8)
  249. data[offset+2] = uint8(v >> 16)
  250. data[offset+3] = uint8(v >> 24)
  251. data[offset+4] = uint8(v >> 32)
  252. data[offset+5] = uint8(v >> 40)
  253. data[offset+6] = uint8(v >> 48)
  254. data[offset+7] = uint8(v >> 56)
  255. return offset + 8
  256. }
  257. func encodeFixed32SnapshotResponse(data []byte, offset int, v uint32) int {
  258. data[offset] = uint8(v)
  259. data[offset+1] = uint8(v >> 8)
  260. data[offset+2] = uint8(v >> 16)
  261. data[offset+3] = uint8(v >> 24)
  262. return offset + 4
  263. }
  264. func encodeVarintSnapshotResponse(data []byte, offset int, v uint64) int {
  265. for v >= 1<<7 {
  266. data[offset] = uint8(v&0x7f | 0x80)
  267. v >>= 7
  268. offset++
  269. }
  270. data[offset] = uint8(v)
  271. return offset + 1
  272. }
  273. func (this *SnapshotResponse) GoString() string {
  274. if this == nil {
  275. return "nil"
  276. }
  277. s := strings17.Join([]string{`&protobuf.SnapshotResponse{` + `Success:` + valueToGoStringSnapshotResponse(this.Success, "bool"), `XXX_unrecognized:` + fmt25.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ")
  278. return s
  279. }
  280. func valueToGoStringSnapshotResponse(v interface{}, typ string) string {
  281. rv := reflect17.ValueOf(v)
  282. if rv.IsNil() {
  283. return "nil"
  284. }
  285. pv := reflect17.Indirect(rv).Interface()
  286. return fmt25.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
  287. }
  288. func extensionToGoStringSnapshotResponse(e map[int32]code_google_com_p_gogoprotobuf_proto17.Extension) string {
  289. if e == nil {
  290. return "nil"
  291. }
  292. s := "map[int32]proto.Extension{"
  293. keys := make([]int, 0, len(e))
  294. for k := range e {
  295. keys = append(keys, int(k))
  296. }
  297. sort8.Ints(keys)
  298. ss := []string{}
  299. for _, k := range keys {
  300. ss = append(ss, strconv8.Itoa(k)+": "+e[int32(k)].GoString())
  301. }
  302. s += strings17.Join(ss, ",") + "}"
  303. return s
  304. }
  305. func (this *SnapshotResponse) VerboseEqual(that interface{}) error {
  306. if that == nil {
  307. if this == nil {
  308. return nil
  309. }
  310. return fmt26.Errorf("that == nil && this != nil")
  311. }
  312. that1, ok := that.(*SnapshotResponse)
  313. if !ok {
  314. return fmt26.Errorf("that is not of type *SnapshotResponse")
  315. }
  316. if that1 == nil {
  317. if this == nil {
  318. return nil
  319. }
  320. return fmt26.Errorf("that is type *SnapshotResponse but is nil && this != nil")
  321. } else if this == nil {
  322. return fmt26.Errorf("that is type *SnapshotResponsebut is not nil && this == nil")
  323. }
  324. if this.Success != nil && that1.Success != nil {
  325. if *this.Success != *that1.Success {
  326. return fmt26.Errorf("Success this(%v) Not Equal that(%v)", *this.Success, *that1.Success)
  327. }
  328. } else if this.Success != nil {
  329. return fmt26.Errorf("this.Success == nil && that.Success != nil")
  330. } else if that1.Success != nil {
  331. return fmt26.Errorf("Success this(%v) Not Equal that(%v)", this.Success, that1.Success)
  332. }
  333. if !bytes8.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  334. return fmt26.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
  335. }
  336. return nil
  337. }
  338. func (this *SnapshotResponse) Equal(that interface{}) bool {
  339. if that == nil {
  340. if this == nil {
  341. return true
  342. }
  343. return false
  344. }
  345. that1, ok := that.(*SnapshotResponse)
  346. if !ok {
  347. return false
  348. }
  349. if that1 == nil {
  350. if this == nil {
  351. return true
  352. }
  353. return false
  354. } else if this == nil {
  355. return false
  356. }
  357. if this.Success != nil && that1.Success != nil {
  358. if *this.Success != *that1.Success {
  359. return false
  360. }
  361. } else if this.Success != nil {
  362. return false
  363. } else if that1.Success != nil {
  364. return false
  365. }
  366. if !bytes8.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  367. return false
  368. }
  369. return true
  370. }