File
Blob: spec/protocol/client_query_vtproto.pb.go
| 1 | // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 2 | // protoc-gen-go-vtproto version: v0.6.0 |
| 3 | // source: spec/proto/client_query.proto |
| 4 | |
| 5 | package protocol |
| 6 | |
| 7 | import ( |
| 8 | fmt "fmt" |
| 9 | protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 10 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 11 | io "io" |
| 12 | ) |
| 13 | |
| 14 | const ( |
| 15 | // Verify that this generated code is sufficiently up-to-date. |
| 16 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 17 | // Verify that runtime/protoimpl is sufficiently up-to-date. |
| 18 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 19 | ) |
| 20 | |
| 21 | func (m *ClientTunnel) MarshalVT() (dAtA []byte, err error) { |
| 22 | if m == nil { |
| 23 | return nil, nil |
| 24 | } |
| 25 | size := m.SizeVT() |
| 26 | dAtA = make([]byte, size) |
| 27 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | return dAtA[:n], nil |
| 32 | } |
| 33 | |
| 34 | func (m *ClientTunnel) MarshalToVT(dAtA []byte) (int, error) { |
| 35 | size := m.SizeVT() |
| 36 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 37 | } |
| 38 | |
| 39 | func (m *ClientTunnel) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 40 | if m == nil { |
| 41 | return 0, nil |
| 42 | } |
| 43 | i := len(dAtA) |
| 44 | _ = i |
| 45 | var l int |
| 46 | _ = l |
| 47 | if m.unknownFields != nil { |
| 48 | i -= len(m.unknownFields) |
| 49 | copy(dAtA[i:], m.unknownFields) |
| 50 | } |
| 51 | if len(m.Target) > 0 { |
| 52 | i -= len(m.Target) |
| 53 | copy(dAtA[i:], m.Target) |
| 54 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Target))) |
| 55 | i-- |
| 56 | dAtA[i] = 0x12 |
| 57 | } |
| 58 | if len(m.Hostname) > 0 { |
| 59 | i -= len(m.Hostname) |
| 60 | copy(dAtA[i:], m.Hostname) |
| 61 | i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) |
| 62 | i-- |
| 63 | dAtA[i] = 0xa |
| 64 | } |
| 65 | return len(dAtA) - i, nil |
| 66 | } |
| 67 | |
| 68 | func (m *ListTunnelsRequest) MarshalVT() (dAtA []byte, err error) { |
| 69 | if m == nil { |
| 70 | return nil, nil |
| 71 | } |
| 72 | size := m.SizeVT() |
| 73 | dAtA = make([]byte, size) |
| 74 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 75 | if err != nil { |
| 76 | return nil, err |
| 77 | } |
| 78 | return dAtA[:n], nil |
| 79 | } |
| 80 | |
| 81 | func (m *ListTunnelsRequest) MarshalToVT(dAtA []byte) (int, error) { |
| 82 | size := m.SizeVT() |
| 83 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 84 | } |
| 85 | |
| 86 | func (m *ListTunnelsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 87 | if m == nil { |
| 88 | return 0, nil |
| 89 | } |
| 90 | i := len(dAtA) |
| 91 | _ = i |
| 92 | var l int |
| 93 | _ = l |
| 94 | if m.unknownFields != nil { |
| 95 | i -= len(m.unknownFields) |
| 96 | copy(dAtA[i:], m.unknownFields) |
| 97 | } |
| 98 | return len(dAtA) - i, nil |
| 99 | } |
| 100 | |
| 101 | func (m *ListTunnelsResponse) MarshalVT() (dAtA []byte, err error) { |
| 102 | if m == nil { |
| 103 | return nil, nil |
| 104 | } |
| 105 | size := m.SizeVT() |
| 106 | dAtA = make([]byte, size) |
| 107 | n, err := m.MarshalToSizedBufferVT(dAtA[:size]) |
| 108 | if err != nil { |
| 109 | return nil, err |
| 110 | } |
| 111 | return dAtA[:n], nil |
| 112 | } |
| 113 | |
| 114 | func (m *ListTunnelsResponse) MarshalToVT(dAtA []byte) (int, error) { |
| 115 | size := m.SizeVT() |
| 116 | return m.MarshalToSizedBufferVT(dAtA[:size]) |
| 117 | } |
| 118 | |
| 119 | func (m *ListTunnelsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { |
| 120 | if m == nil { |
| 121 | return 0, nil |
| 122 | } |
| 123 | i := len(dAtA) |
| 124 | _ = i |
| 125 | var l int |
| 126 | _ = l |
| 127 | if m.unknownFields != nil { |
| 128 | i -= len(m.unknownFields) |
| 129 | copy(dAtA[i:], m.unknownFields) |
| 130 | } |
| 131 | if len(m.Tunnels) > 0 { |
| 132 | for iNdEx := len(m.Tunnels) - 1; iNdEx >= 0; iNdEx-- { |
| 133 | size, err := m.Tunnels[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) |
| 134 | if err != nil { |
| 135 | return 0, err |
| 136 | } |
| 137 | i -= size |
| 138 | i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 139 | i-- |
| 140 | dAtA[i] = 0xa |
| 141 | } |
| 142 | } |
| 143 | return len(dAtA) - i, nil |
| 144 | } |
| 145 | |
| 146 | func (m *ClientTunnel) SizeVT() (n int) { |
| 147 | if m == nil { |
| 148 | return 0 |
| 149 | } |
| 150 | var l int |
| 151 | _ = l |
| 152 | l = len(m.Hostname) |
| 153 | if l > 0 { |
| 154 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 155 | } |
| 156 | l = len(m.Target) |
| 157 | if l > 0 { |
| 158 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 159 | } |
| 160 | n += len(m.unknownFields) |
| 161 | return n |
| 162 | } |
| 163 | |
| 164 | func (m *ListTunnelsRequest) SizeVT() (n int) { |
| 165 | if m == nil { |
| 166 | return 0 |
| 167 | } |
| 168 | var l int |
| 169 | _ = l |
| 170 | n += len(m.unknownFields) |
| 171 | return n |
| 172 | } |
| 173 | |
| 174 | func (m *ListTunnelsResponse) SizeVT() (n int) { |
| 175 | if m == nil { |
| 176 | return 0 |
| 177 | } |
| 178 | var l int |
| 179 | _ = l |
| 180 | if len(m.Tunnels) > 0 { |
| 181 | for _, e := range m.Tunnels { |
| 182 | l = e.SizeVT() |
| 183 | n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 184 | } |
| 185 | } |
| 186 | n += len(m.unknownFields) |
| 187 | return n |
| 188 | } |
| 189 | |
| 190 | func (m *ClientTunnel) UnmarshalVT(dAtA []byte) error { |
| 191 | l := len(dAtA) |
| 192 | iNdEx := 0 |
| 193 | for iNdEx < l { |
| 194 | preIndex := iNdEx |
| 195 | var wire uint64 |
| 196 | for shift := uint(0); ; shift += 7 { |
| 197 | if shift >= 64 { |
| 198 | return protohelpers.ErrIntOverflow |
| 199 | } |
| 200 | if iNdEx >= l { |
| 201 | return io.ErrUnexpectedEOF |
| 202 | } |
| 203 | b := dAtA[iNdEx] |
| 204 | iNdEx++ |
| 205 | wire |= uint64(b&0x7F) << shift |
| 206 | if b < 0x80 { |
| 207 | break |
| 208 | } |
| 209 | } |
| 210 | fieldNum := int32(wire >> 3) |
| 211 | wireType := int(wire & 0x7) |
| 212 | if wireType == 4 { |
| 213 | return fmt.Errorf("proto: ClientTunnel: wiretype end group for non-group") |
| 214 | } |
| 215 | if fieldNum <= 0 { |
| 216 | return fmt.Errorf("proto: ClientTunnel: illegal tag %d (wire type %d)", fieldNum, wire) |
| 217 | } |
| 218 | switch fieldNum { |
| 219 | case 1: |
| 220 | if wireType != 2 { |
| 221 | return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) |
| 222 | } |
| 223 | var stringLen uint64 |
| 224 | for shift := uint(0); ; shift += 7 { |
| 225 | if shift >= 64 { |
| 226 | return protohelpers.ErrIntOverflow |
| 227 | } |
| 228 | if iNdEx >= l { |
| 229 | return io.ErrUnexpectedEOF |
| 230 | } |
| 231 | b := dAtA[iNdEx] |
| 232 | iNdEx++ |
| 233 | stringLen |= uint64(b&0x7F) << shift |
| 234 | if b < 0x80 { |
| 235 | break |
| 236 | } |
| 237 | } |
| 238 | intStringLen := int(stringLen) |
| 239 | if intStringLen < 0 { |
| 240 | return protohelpers.ErrInvalidLength |
| 241 | } |
| 242 | postIndex := iNdEx + intStringLen |
| 243 | if postIndex < 0 { |
| 244 | return protohelpers.ErrInvalidLength |
| 245 | } |
| 246 | if postIndex > l { |
| 247 | return io.ErrUnexpectedEOF |
| 248 | } |
| 249 | m.Hostname = string(dAtA[iNdEx:postIndex]) |
| 250 | iNdEx = postIndex |
| 251 | case 2: |
| 252 | if wireType != 2 { |
| 253 | return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) |
| 254 | } |
| 255 | var stringLen uint64 |
| 256 | for shift := uint(0); ; shift += 7 { |
| 257 | if shift >= 64 { |
| 258 | return protohelpers.ErrIntOverflow |
| 259 | } |
| 260 | if iNdEx >= l { |
| 261 | return io.ErrUnexpectedEOF |
| 262 | } |
| 263 | b := dAtA[iNdEx] |
| 264 | iNdEx++ |
| 265 | stringLen |= uint64(b&0x7F) << shift |
| 266 | if b < 0x80 { |
| 267 | break |
| 268 | } |
| 269 | } |
| 270 | intStringLen := int(stringLen) |
| 271 | if intStringLen < 0 { |
| 272 | return protohelpers.ErrInvalidLength |
| 273 | } |
| 274 | postIndex := iNdEx + intStringLen |
| 275 | if postIndex < 0 { |
| 276 | return protohelpers.ErrInvalidLength |
| 277 | } |
| 278 | if postIndex > l { |
| 279 | return io.ErrUnexpectedEOF |
| 280 | } |
| 281 | m.Target = string(dAtA[iNdEx:postIndex]) |
| 282 | iNdEx = postIndex |
| 283 | default: |
| 284 | iNdEx = preIndex |
| 285 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 286 | if err != nil { |
| 287 | return err |
| 288 | } |
| 289 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 290 | return protohelpers.ErrInvalidLength |
| 291 | } |
| 292 | if (iNdEx + skippy) > l { |
| 293 | return io.ErrUnexpectedEOF |
| 294 | } |
| 295 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 296 | iNdEx += skippy |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | if iNdEx > l { |
| 301 | return io.ErrUnexpectedEOF |
| 302 | } |
| 303 | return nil |
| 304 | } |
| 305 | func (m *ListTunnelsRequest) UnmarshalVT(dAtA []byte) error { |
| 306 | l := len(dAtA) |
| 307 | iNdEx := 0 |
| 308 | for iNdEx < l { |
| 309 | preIndex := iNdEx |
| 310 | var wire uint64 |
| 311 | for shift := uint(0); ; shift += 7 { |
| 312 | if shift >= 64 { |
| 313 | return protohelpers.ErrIntOverflow |
| 314 | } |
| 315 | if iNdEx >= l { |
| 316 | return io.ErrUnexpectedEOF |
| 317 | } |
| 318 | b := dAtA[iNdEx] |
| 319 | iNdEx++ |
| 320 | wire |= uint64(b&0x7F) << shift |
| 321 | if b < 0x80 { |
| 322 | break |
| 323 | } |
| 324 | } |
| 325 | fieldNum := int32(wire >> 3) |
| 326 | wireType := int(wire & 0x7) |
| 327 | if wireType == 4 { |
| 328 | return fmt.Errorf("proto: ListTunnelsRequest: wiretype end group for non-group") |
| 329 | } |
| 330 | if fieldNum <= 0 { |
| 331 | return fmt.Errorf("proto: ListTunnelsRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 332 | } |
| 333 | switch fieldNum { |
| 334 | default: |
| 335 | iNdEx = preIndex |
| 336 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 337 | if err != nil { |
| 338 | return err |
| 339 | } |
| 340 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 341 | return protohelpers.ErrInvalidLength |
| 342 | } |
| 343 | if (iNdEx + skippy) > l { |
| 344 | return io.ErrUnexpectedEOF |
| 345 | } |
| 346 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 347 | iNdEx += skippy |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | if iNdEx > l { |
| 352 | return io.ErrUnexpectedEOF |
| 353 | } |
| 354 | return nil |
| 355 | } |
| 356 | func (m *ListTunnelsResponse) UnmarshalVT(dAtA []byte) error { |
| 357 | l := len(dAtA) |
| 358 | iNdEx := 0 |
| 359 | for iNdEx < l { |
| 360 | preIndex := iNdEx |
| 361 | var wire uint64 |
| 362 | for shift := uint(0); ; shift += 7 { |
| 363 | if shift >= 64 { |
| 364 | return protohelpers.ErrIntOverflow |
| 365 | } |
| 366 | if iNdEx >= l { |
| 367 | return io.ErrUnexpectedEOF |
| 368 | } |
| 369 | b := dAtA[iNdEx] |
| 370 | iNdEx++ |
| 371 | wire |= uint64(b&0x7F) << shift |
| 372 | if b < 0x80 { |
| 373 | break |
| 374 | } |
| 375 | } |
| 376 | fieldNum := int32(wire >> 3) |
| 377 | wireType := int(wire & 0x7) |
| 378 | if wireType == 4 { |
| 379 | return fmt.Errorf("proto: ListTunnelsResponse: wiretype end group for non-group") |
| 380 | } |
| 381 | if fieldNum <= 0 { |
| 382 | return fmt.Errorf("proto: ListTunnelsResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 383 | } |
| 384 | switch fieldNum { |
| 385 | case 1: |
| 386 | if wireType != 2 { |
| 387 | return fmt.Errorf("proto: wrong wireType = %d for field Tunnels", wireType) |
| 388 | } |
| 389 | var msglen int |
| 390 | for shift := uint(0); ; shift += 7 { |
| 391 | if shift >= 64 { |
| 392 | return protohelpers.ErrIntOverflow |
| 393 | } |
| 394 | if iNdEx >= l { |
| 395 | return io.ErrUnexpectedEOF |
| 396 | } |
| 397 | b := dAtA[iNdEx] |
| 398 | iNdEx++ |
| 399 | msglen |= int(b&0x7F) << shift |
| 400 | if b < 0x80 { |
| 401 | break |
| 402 | } |
| 403 | } |
| 404 | if msglen < 0 { |
| 405 | return protohelpers.ErrInvalidLength |
| 406 | } |
| 407 | postIndex := iNdEx + msglen |
| 408 | if postIndex < 0 { |
| 409 | return protohelpers.ErrInvalidLength |
| 410 | } |
| 411 | if postIndex > l { |
| 412 | return io.ErrUnexpectedEOF |
| 413 | } |
| 414 | m.Tunnels = append(m.Tunnels, &ClientTunnel{}) |
| 415 | if err := m.Tunnels[len(m.Tunnels)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { |
| 416 | return err |
| 417 | } |
| 418 | iNdEx = postIndex |
| 419 | default: |
| 420 | iNdEx = preIndex |
| 421 | skippy, err := protohelpers.Skip(dAtA[iNdEx:]) |
| 422 | if err != nil { |
| 423 | return err |
| 424 | } |
| 425 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 426 | return protohelpers.ErrInvalidLength |
| 427 | } |
| 428 | if (iNdEx + skippy) > l { |
| 429 | return io.ErrUnexpectedEOF |
| 430 | } |
| 431 | m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) |
| 432 | iNdEx += skippy |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | if iNdEx > l { |
| 437 | return io.ErrUnexpectedEOF |
| 438 | } |
| 439 | return nil |
| 440 | } |