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