size.pb.go 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: lib/config/size.proto
  3. package config
  4. import (
  5. encoding_binary "encoding/binary"
  6. fmt "fmt"
  7. _ "github.com/gogo/protobuf/gogoproto"
  8. proto "github.com/gogo/protobuf/proto"
  9. _ "github.com/syncthing/syncthing/proto/ext"
  10. io "io"
  11. math "math"
  12. math_bits "math/bits"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = fmt.Errorf
  17. var _ = math.Inf
  18. // This is a compile-time assertion to ensure that this generated file
  19. // is compatible with the proto package it is being compiled against.
  20. // A compilation error at this line likely means your copy of the
  21. // proto package needs to be updated.
  22. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  23. type Size struct {
  24. Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value" xml:",chardata"`
  25. Unit string `protobuf:"bytes,2,opt,name=unit,proto3" json:"unit" xml:"unit,attr"`
  26. }
  27. func (m *Size) Reset() { *m = Size{} }
  28. func (*Size) ProtoMessage() {}
  29. func (*Size) Descriptor() ([]byte, []int) {
  30. return fileDescriptor_4d75cb8f619bd299, []int{0}
  31. }
  32. func (m *Size) XXX_Unmarshal(b []byte) error {
  33. return m.Unmarshal(b)
  34. }
  35. func (m *Size) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  36. if deterministic {
  37. return xxx_messageInfo_Size.Marshal(b, m, deterministic)
  38. } else {
  39. b = b[:cap(b)]
  40. n, err := m.MarshalToSizedBuffer(b)
  41. if err != nil {
  42. return nil, err
  43. }
  44. return b[:n], nil
  45. }
  46. }
  47. func (m *Size) XXX_Merge(src proto.Message) {
  48. xxx_messageInfo_Size.Merge(m, src)
  49. }
  50. func (m *Size) XXX_Size() int {
  51. return m.ProtoSize()
  52. }
  53. func (m *Size) XXX_DiscardUnknown() {
  54. xxx_messageInfo_Size.DiscardUnknown(m)
  55. }
  56. var xxx_messageInfo_Size proto.InternalMessageInfo
  57. func init() {
  58. proto.RegisterType((*Size)(nil), "config.Size")
  59. }
  60. func init() { proto.RegisterFile("lib/config/size.proto", fileDescriptor_4d75cb8f619bd299) }
  61. var fileDescriptor_4d75cb8f619bd299 = []byte{
  62. // 251 bytes of a gzipped FileDescriptorProto
  63. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xc9, 0x4c, 0xd2,
  64. 0x4f, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xd7, 0x2f, 0xce, 0xac, 0x4a, 0xd5, 0x2b, 0x28, 0xca, 0x2f,
  65. 0xc9, 0x17, 0x62, 0x83, 0x08, 0x49, 0x29, 0x17, 0xa5, 0x16, 0xe4, 0x17, 0xeb, 0x83, 0x05, 0x93,
  66. 0x4a, 0xd3, 0xf4, 0xd3, 0xf3, 0xd3, 0xf3, 0xc1, 0x1c, 0x30, 0x0b, 0xa2, 0x58, 0x8a, 0x33, 0xb5,
  67. 0xa2, 0x04, 0xc2, 0x54, 0xea, 0x66, 0xe4, 0x62, 0x09, 0xce, 0xac, 0x4a, 0x15, 0xb2, 0xe7, 0x62,
  68. 0x2d, 0x4b, 0xcc, 0x29, 0x4d, 0x95, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x74, 0xd2, 0x7c, 0x75, 0x4f,
  69. 0x1e, 0x22, 0xf0, 0xe9, 0x9e, 0x3c, 0x7f, 0x45, 0x6e, 0x8e, 0x95, 0x92, 0x4e, 0x72, 0x46, 0x62,
  70. 0x51, 0x4a, 0x62, 0x49, 0xa2, 0xd2, 0xab, 0xf3, 0x2a, 0x9c, 0x70, 0x5e, 0x10, 0x44, 0x99, 0x90,
  71. 0x0d, 0x17, 0x4b, 0x69, 0x5e, 0x66, 0x89, 0x04, 0x93, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xc6, 0xab,
  72. 0x7b, 0xf2, 0x60, 0x3e, 0x5c, 0x3b, 0x88, 0xa3, 0x93, 0x58, 0x52, 0x52, 0x04, 0xd6, 0x0e, 0xe7,
  73. 0x05, 0x81, 0x55, 0x59, 0xb1, 0xcc, 0x58, 0x20, 0xcf, 0xe0, 0xe4, 0x7d, 0xe2, 0xa1, 0x1c, 0xc3,
  74. 0x85, 0x87, 0x72, 0x0c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c,
  75. 0xc3, 0x82, 0xc7, 0x72, 0x8c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x99,
  76. 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x5f, 0x5c, 0x99, 0x97, 0x5c, 0x92,
  77. 0x91, 0x99, 0x97, 0x8e, 0xc4, 0x42, 0x84, 0x4e, 0x12, 0x1b, 0xd8, 0x87, 0xc6, 0x80, 0x00, 0x00,
  78. 0x00, 0xff, 0xff, 0x65, 0x1e, 0xa3, 0x25, 0x32, 0x01, 0x00, 0x00,
  79. }
  80. func (m *Size) Marshal() (dAtA []byte, err error) {
  81. size := m.ProtoSize()
  82. dAtA = make([]byte, size)
  83. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  84. if err != nil {
  85. return nil, err
  86. }
  87. return dAtA[:n], nil
  88. }
  89. func (m *Size) MarshalTo(dAtA []byte) (int, error) {
  90. size := m.ProtoSize()
  91. return m.MarshalToSizedBuffer(dAtA[:size])
  92. }
  93. func (m *Size) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  94. i := len(dAtA)
  95. _ = i
  96. var l int
  97. _ = l
  98. if len(m.Unit) > 0 {
  99. i -= len(m.Unit)
  100. copy(dAtA[i:], m.Unit)
  101. i = encodeVarintSize(dAtA, i, uint64(len(m.Unit)))
  102. i--
  103. dAtA[i] = 0x12
  104. }
  105. if m.Value != 0 {
  106. i -= 8
  107. encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
  108. i--
  109. dAtA[i] = 0x9
  110. }
  111. return len(dAtA) - i, nil
  112. }
  113. func encodeVarintSize(dAtA []byte, offset int, v uint64) int {
  114. offset -= sovSize(v)
  115. base := offset
  116. for v >= 1<<7 {
  117. dAtA[offset] = uint8(v&0x7f | 0x80)
  118. v >>= 7
  119. offset++
  120. }
  121. dAtA[offset] = uint8(v)
  122. return base
  123. }
  124. func (m *Size) ProtoSize() (n int) {
  125. if m == nil {
  126. return 0
  127. }
  128. var l int
  129. _ = l
  130. if m.Value != 0 {
  131. n += 9
  132. }
  133. l = len(m.Unit)
  134. if l > 0 {
  135. n += 1 + l + sovSize(uint64(l))
  136. }
  137. return n
  138. }
  139. func sovSize(x uint64) (n int) {
  140. return (math_bits.Len64(x|1) + 6) / 7
  141. }
  142. func sozSize(x uint64) (n int) {
  143. return sovSize(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  144. }
  145. func (m *Size) Unmarshal(dAtA []byte) error {
  146. l := len(dAtA)
  147. iNdEx := 0
  148. for iNdEx < l {
  149. preIndex := iNdEx
  150. var wire uint64
  151. for shift := uint(0); ; shift += 7 {
  152. if shift >= 64 {
  153. return ErrIntOverflowSize
  154. }
  155. if iNdEx >= l {
  156. return io.ErrUnexpectedEOF
  157. }
  158. b := dAtA[iNdEx]
  159. iNdEx++
  160. wire |= uint64(b&0x7F) << shift
  161. if b < 0x80 {
  162. break
  163. }
  164. }
  165. fieldNum := int32(wire >> 3)
  166. wireType := int(wire & 0x7)
  167. if wireType == 4 {
  168. return fmt.Errorf("proto: Size: wiretype end group for non-group")
  169. }
  170. if fieldNum <= 0 {
  171. return fmt.Errorf("proto: Size: illegal tag %d (wire type %d)", fieldNum, wire)
  172. }
  173. switch fieldNum {
  174. case 1:
  175. if wireType != 1 {
  176. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  177. }
  178. var v uint64
  179. if (iNdEx + 8) > l {
  180. return io.ErrUnexpectedEOF
  181. }
  182. v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
  183. iNdEx += 8
  184. m.Value = float64(math.Float64frombits(v))
  185. case 2:
  186. if wireType != 2 {
  187. return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType)
  188. }
  189. var stringLen uint64
  190. for shift := uint(0); ; shift += 7 {
  191. if shift >= 64 {
  192. return ErrIntOverflowSize
  193. }
  194. if iNdEx >= l {
  195. return io.ErrUnexpectedEOF
  196. }
  197. b := dAtA[iNdEx]
  198. iNdEx++
  199. stringLen |= uint64(b&0x7F) << shift
  200. if b < 0x80 {
  201. break
  202. }
  203. }
  204. intStringLen := int(stringLen)
  205. if intStringLen < 0 {
  206. return ErrInvalidLengthSize
  207. }
  208. postIndex := iNdEx + intStringLen
  209. if postIndex < 0 {
  210. return ErrInvalidLengthSize
  211. }
  212. if postIndex > l {
  213. return io.ErrUnexpectedEOF
  214. }
  215. m.Unit = string(dAtA[iNdEx:postIndex])
  216. iNdEx = postIndex
  217. default:
  218. iNdEx = preIndex
  219. skippy, err := skipSize(dAtA[iNdEx:])
  220. if err != nil {
  221. return err
  222. }
  223. if (skippy < 0) || (iNdEx+skippy) < 0 {
  224. return ErrInvalidLengthSize
  225. }
  226. if (iNdEx + skippy) > l {
  227. return io.ErrUnexpectedEOF
  228. }
  229. iNdEx += skippy
  230. }
  231. }
  232. if iNdEx > l {
  233. return io.ErrUnexpectedEOF
  234. }
  235. return nil
  236. }
  237. func skipSize(dAtA []byte) (n int, err error) {
  238. l := len(dAtA)
  239. iNdEx := 0
  240. depth := 0
  241. for iNdEx < l {
  242. var wire uint64
  243. for shift := uint(0); ; shift += 7 {
  244. if shift >= 64 {
  245. return 0, ErrIntOverflowSize
  246. }
  247. if iNdEx >= l {
  248. return 0, io.ErrUnexpectedEOF
  249. }
  250. b := dAtA[iNdEx]
  251. iNdEx++
  252. wire |= (uint64(b) & 0x7F) << shift
  253. if b < 0x80 {
  254. break
  255. }
  256. }
  257. wireType := int(wire & 0x7)
  258. switch wireType {
  259. case 0:
  260. for shift := uint(0); ; shift += 7 {
  261. if shift >= 64 {
  262. return 0, ErrIntOverflowSize
  263. }
  264. if iNdEx >= l {
  265. return 0, io.ErrUnexpectedEOF
  266. }
  267. iNdEx++
  268. if dAtA[iNdEx-1] < 0x80 {
  269. break
  270. }
  271. }
  272. case 1:
  273. iNdEx += 8
  274. case 2:
  275. var length int
  276. for shift := uint(0); ; shift += 7 {
  277. if shift >= 64 {
  278. return 0, ErrIntOverflowSize
  279. }
  280. if iNdEx >= l {
  281. return 0, io.ErrUnexpectedEOF
  282. }
  283. b := dAtA[iNdEx]
  284. iNdEx++
  285. length |= (int(b) & 0x7F) << shift
  286. if b < 0x80 {
  287. break
  288. }
  289. }
  290. if length < 0 {
  291. return 0, ErrInvalidLengthSize
  292. }
  293. iNdEx += length
  294. case 3:
  295. depth++
  296. case 4:
  297. if depth == 0 {
  298. return 0, ErrUnexpectedEndOfGroupSize
  299. }
  300. depth--
  301. case 5:
  302. iNdEx += 4
  303. default:
  304. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  305. }
  306. if iNdEx < 0 {
  307. return 0, ErrInvalidLengthSize
  308. }
  309. if depth == 0 {
  310. return iNdEx, nil
  311. }
  312. }
  313. return 0, io.ErrUnexpectedEOF
  314. }
  315. var (
  316. ErrInvalidLengthSize = fmt.Errorf("proto: negative length found during unmarshaling")
  317. ErrIntOverflowSize = fmt.Errorf("proto: integer overflow")
  318. ErrUnexpectedEndOfGroupSize = fmt.Errorf("proto: unexpected end of group")
  319. )