github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/util/timeutil/pgdate/pgdate.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: util/timeutil/pgdate/pgdate.proto 3 4 package pgdate 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 ) 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 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the proto package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // proto package needs to be updated. 23 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 24 25 // Order refers to the Order component of a DateStyle. 26 type Order int32 27 28 const ( 29 Order_MDY Order = 0 30 Order_DMY Order = 1 31 Order_YMD Order = 2 32 ) 33 34 var Order_name = map[int32]string{ 35 0: "MDY", 36 1: "DMY", 37 2: "YMD", 38 } 39 40 var Order_value = map[string]int32{ 41 "MDY": 0, 42 "DMY": 1, 43 "YMD": 2, 44 } 45 46 func (x Order) String() string { 47 return proto.EnumName(Order_name, int32(x)) 48 } 49 50 func (Order) EnumDescriptor() ([]byte, []int) { 51 return fileDescriptor_1038cae594af4e85, []int{0} 52 } 53 54 // Style refers to the Style component of a DateStyle. 55 type Style int32 56 57 const ( 58 Style_ISO Style = 0 59 Style_SQL Style = 1 60 Style_POSTGRES Style = 2 61 Style_GERMAN Style = 3 62 ) 63 64 var Style_name = map[int32]string{ 65 0: "ISO", 66 1: "SQL", 67 2: "POSTGRES", 68 3: "GERMAN", 69 } 70 71 var Style_value = map[string]int32{ 72 "ISO": 0, 73 "SQL": 1, 74 "POSTGRES": 2, 75 "GERMAN": 3, 76 } 77 78 func (x Style) String() string { 79 return proto.EnumName(Style_name, int32(x)) 80 } 81 82 func (Style) EnumDescriptor() ([]byte, []int) { 83 return fileDescriptor_1038cae594af4e85, []int{1} 84 } 85 86 // DateStyle refers to the PostgreSQL DateStyle allowed variables. 87 type DateStyle struct { 88 // Style refers to the style to print output dates. 89 Style Style `protobuf:"varint,1,opt,name=style,proto3,enum=cockroach.util.timeutil.pgdate.Style" json:"style,omitempty"` 90 // Order refers to the order of day, month and year components. 91 Order Order `protobuf:"varint,2,opt,name=order,proto3,enum=cockroach.util.timeutil.pgdate.Order" json:"order,omitempty"` 92 } 93 94 func (m *DateStyle) Reset() { *m = DateStyle{} } 95 func (m *DateStyle) String() string { return proto.CompactTextString(m) } 96 func (*DateStyle) ProtoMessage() {} 97 func (*DateStyle) Descriptor() ([]byte, []int) { 98 return fileDescriptor_1038cae594af4e85, []int{0} 99 } 100 func (m *DateStyle) XXX_Unmarshal(b []byte) error { 101 return m.Unmarshal(b) 102 } 103 func (m *DateStyle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 104 b = b[:cap(b)] 105 n, err := m.MarshalToSizedBuffer(b) 106 if err != nil { 107 return nil, err 108 } 109 return b[:n], nil 110 } 111 func (m *DateStyle) XXX_Merge(src proto.Message) { 112 xxx_messageInfo_DateStyle.Merge(m, src) 113 } 114 func (m *DateStyle) XXX_Size() int { 115 return m.Size() 116 } 117 func (m *DateStyle) XXX_DiscardUnknown() { 118 xxx_messageInfo_DateStyle.DiscardUnknown(m) 119 } 120 121 var xxx_messageInfo_DateStyle proto.InternalMessageInfo 122 123 func init() { 124 proto.RegisterEnum("cockroach.parser.util.timeutil.pgdate.Order", Order_name, Order_value) 125 proto.RegisterEnum("cockroach.parser.util.timeutil.pgdate.Style", Style_name, Style_value) 126 proto.RegisterType((*DateStyle)(nil), "cockroach.parser.util.timeutil.pgdate.DateStyle") 127 } 128 129 func init() { proto.RegisterFile("util/timeutil/pgdate/pgdate.proto", fileDescriptor_1038cae594af4e85) } 130 131 var fileDescriptor_1038cae594af4e85 = []byte{ 132 // 267 bytes of a gzipped FileDescriptorProto 133 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x2d, 0xc9, 0xcc, 134 0xd1, 0x2f, 0xc9, 0xcc, 0x4d, 0x05, 0x33, 0x0a, 0xd2, 0x53, 0x12, 0x4b, 0x52, 0xa1, 0x94, 0x5e, 135 0x41, 0x51, 0x7e, 0x49, 0xbe, 0x90, 0x5c, 0x72, 0x7e, 0x72, 0x76, 0x51, 0x7e, 0x62, 0x72, 0x86, 136 0x1e, 0x48, 0x8d, 0x1e, 0x4c, 0xb1, 0x1e, 0x44, 0x95, 0x52, 0x2b, 0x23, 0x17, 0xa7, 0x4b, 0x62, 137 0x49, 0x6a, 0x70, 0x49, 0x65, 0x4e, 0xaa, 0x90, 0x35, 0x17, 0x6b, 0x31, 0x88, 0x21, 0xc1, 0xa8, 138 0xc0, 0xa8, 0xc1, 0x67, 0xa4, 0xaa, 0x87, 0x5f, 0xb7, 0x1e, 0x58, 0x57, 0x10, 0x44, 0x0f, 0x48, 139 0x73, 0x7e, 0x51, 0x4a, 0x6a, 0x91, 0x04, 0x13, 0x71, 0x9a, 0xfd, 0x41, 0x8a, 0x83, 0x20, 0x7a, 140 0xb4, 0x94, 0xb8, 0x58, 0xc1, 0x7c, 0x21, 0x76, 0x2e, 0x66, 0x5f, 0x97, 0x48, 0x01, 0x06, 0x10, 141 0xc3, 0xc5, 0x37, 0x52, 0x80, 0x11, 0xc4, 0x88, 0xf4, 0x75, 0x11, 0x60, 0xd2, 0x32, 0xe6, 0x62, 142 0x85, 0x38, 0x93, 0x9d, 0x8b, 0xd9, 0x33, 0xd8, 0x1f, 0xa2, 0x26, 0x38, 0xd0, 0x47, 0x80, 0x51, 143 0x88, 0x87, 0x8b, 0x23, 0xc0, 0x3f, 0x38, 0xc4, 0x3d, 0xc8, 0x35, 0x58, 0x80, 0x49, 0x88, 0x8b, 144 0x8b, 0xcd, 0xdd, 0x35, 0xc8, 0xd7, 0xd1, 0x4f, 0x80, 0xd9, 0x29, 0xfa, 0xc4, 0x43, 0x39, 0x86, 145 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0xbc, 0xf1, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 146 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x32, 147 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xee, 0xe4, 0x94, 0x24, 0x04, 148 0x5b, 0xbf, 0x20, 0x3b, 0x5d, 0x1f, 0x5b, 0x50, 0x27, 0xb1, 0x81, 0x03, 0xd9, 0x18, 0x10, 0x00, 149 0x00, 0xff, 0xff, 0x12, 0x7b, 0xeb, 0xc9, 0x89, 0x01, 0x00, 0x00, 150 } 151 152 func (m *DateStyle) Marshal() (dAtA []byte, err error) { 153 size := m.Size() 154 dAtA = make([]byte, size) 155 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 156 if err != nil { 157 return nil, err 158 } 159 return dAtA[:n], nil 160 } 161 162 func (m *DateStyle) MarshalTo(dAtA []byte) (int, error) { 163 size := m.Size() 164 return m.MarshalToSizedBuffer(dAtA[:size]) 165 } 166 167 func (m *DateStyle) MarshalToSizedBuffer(dAtA []byte) (int, error) { 168 i := len(dAtA) 169 _ = i 170 var l int 171 _ = l 172 if m.Order != 0 { 173 i = encodeVarintPgdate(dAtA, i, uint64(m.Order)) 174 i-- 175 dAtA[i] = 0x10 176 } 177 if m.Style != 0 { 178 i = encodeVarintPgdate(dAtA, i, uint64(m.Style)) 179 i-- 180 dAtA[i] = 0x8 181 } 182 return len(dAtA) - i, nil 183 } 184 185 func encodeVarintPgdate(dAtA []byte, offset int, v uint64) int { 186 offset -= sovPgdate(v) 187 base := offset 188 for v >= 1<<7 { 189 dAtA[offset] = uint8(v&0x7f | 0x80) 190 v >>= 7 191 offset++ 192 } 193 dAtA[offset] = uint8(v) 194 return base 195 } 196 func (m *DateStyle) Size() (n int) { 197 if m == nil { 198 return 0 199 } 200 var l int 201 _ = l 202 if m.Style != 0 { 203 n += 1 + sovPgdate(uint64(m.Style)) 204 } 205 if m.Order != 0 { 206 n += 1 + sovPgdate(uint64(m.Order)) 207 } 208 return n 209 } 210 211 func sovPgdate(x uint64) (n int) { 212 return (math_bits.Len64(x|1) + 6) / 7 213 } 214 func sozPgdate(x uint64) (n int) { 215 return sovPgdate(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 216 } 217 func (m *DateStyle) Unmarshal(dAtA []byte) error { 218 l := len(dAtA) 219 iNdEx := 0 220 for iNdEx < l { 221 preIndex := iNdEx 222 var wire uint64 223 for shift := uint(0); ; shift += 7 { 224 if shift >= 64 { 225 return ErrIntOverflowPgdate 226 } 227 if iNdEx >= l { 228 return io.ErrUnexpectedEOF 229 } 230 b := dAtA[iNdEx] 231 iNdEx++ 232 wire |= uint64(b&0x7F) << shift 233 if b < 0x80 { 234 break 235 } 236 } 237 fieldNum := int32(wire >> 3) 238 wireType := int(wire & 0x7) 239 if wireType == 4 { 240 return fmt.Errorf("proto: DateStyle: wiretype end group for non-group") 241 } 242 if fieldNum <= 0 { 243 return fmt.Errorf("proto: DateStyle: illegal tag %d (wire type %d)", fieldNum, wire) 244 } 245 switch fieldNum { 246 case 1: 247 if wireType != 0 { 248 return fmt.Errorf("proto: wrong wireType = %d for field Style", wireType) 249 } 250 m.Style = 0 251 for shift := uint(0); ; shift += 7 { 252 if shift >= 64 { 253 return ErrIntOverflowPgdate 254 } 255 if iNdEx >= l { 256 return io.ErrUnexpectedEOF 257 } 258 b := dAtA[iNdEx] 259 iNdEx++ 260 m.Style |= Style(b&0x7F) << shift 261 if b < 0x80 { 262 break 263 } 264 } 265 case 2: 266 if wireType != 0 { 267 return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) 268 } 269 m.Order = 0 270 for shift := uint(0); ; shift += 7 { 271 if shift >= 64 { 272 return ErrIntOverflowPgdate 273 } 274 if iNdEx >= l { 275 return io.ErrUnexpectedEOF 276 } 277 b := dAtA[iNdEx] 278 iNdEx++ 279 m.Order |= Order(b&0x7F) << shift 280 if b < 0x80 { 281 break 282 } 283 } 284 default: 285 iNdEx = preIndex 286 skippy, err := skipPgdate(dAtA[iNdEx:]) 287 if err != nil { 288 return err 289 } 290 if (skippy < 0) || (iNdEx+skippy) < 0 { 291 return ErrInvalidLengthPgdate 292 } 293 if (iNdEx + skippy) > l { 294 return io.ErrUnexpectedEOF 295 } 296 iNdEx += skippy 297 } 298 } 299 300 if iNdEx > l { 301 return io.ErrUnexpectedEOF 302 } 303 return nil 304 } 305 func skipPgdate(dAtA []byte) (n int, err error) { 306 l := len(dAtA) 307 iNdEx := 0 308 depth := 0 309 for iNdEx < l { 310 var wire uint64 311 for shift := uint(0); ; shift += 7 { 312 if shift >= 64 { 313 return 0, ErrIntOverflowPgdate 314 } 315 if iNdEx >= l { 316 return 0, io.ErrUnexpectedEOF 317 } 318 b := dAtA[iNdEx] 319 iNdEx++ 320 wire |= (uint64(b) & 0x7F) << shift 321 if b < 0x80 { 322 break 323 } 324 } 325 wireType := int(wire & 0x7) 326 switch wireType { 327 case 0: 328 for shift := uint(0); ; shift += 7 { 329 if shift >= 64 { 330 return 0, ErrIntOverflowPgdate 331 } 332 if iNdEx >= l { 333 return 0, io.ErrUnexpectedEOF 334 } 335 iNdEx++ 336 if dAtA[iNdEx-1] < 0x80 { 337 break 338 } 339 } 340 case 1: 341 iNdEx += 8 342 case 2: 343 var length int 344 for shift := uint(0); ; shift += 7 { 345 if shift >= 64 { 346 return 0, ErrIntOverflowPgdate 347 } 348 if iNdEx >= l { 349 return 0, io.ErrUnexpectedEOF 350 } 351 b := dAtA[iNdEx] 352 iNdEx++ 353 length |= (int(b) & 0x7F) << shift 354 if b < 0x80 { 355 break 356 } 357 } 358 if length < 0 { 359 return 0, ErrInvalidLengthPgdate 360 } 361 iNdEx += length 362 case 3: 363 depth++ 364 case 4: 365 if depth == 0 { 366 return 0, ErrUnexpectedEndOfGroupPgdate 367 } 368 depth-- 369 case 5: 370 iNdEx += 4 371 default: 372 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 373 } 374 if iNdEx < 0 { 375 return 0, ErrInvalidLengthPgdate 376 } 377 if depth == 0 { 378 return iNdEx, nil 379 } 380 } 381 return 0, io.ErrUnexpectedEOF 382 } 383 384 var ( 385 ErrInvalidLengthPgdate = fmt.Errorf("proto: negative length found during unmarshaling") 386 ErrIntOverflowPgdate = fmt.Errorf("proto: integer overflow") 387 ErrUnexpectedEndOfGroupPgdate = fmt.Errorf("proto: unexpected end of group") 388 ) 389