1
2
3
4 package extendedtask
5
6 import (
7 context "context"
8 fmt "fmt"
9 github_com_containerd_ttrpc "github.com/containerd/ttrpc"
10 proto "github.com/gogo/protobuf/proto"
11 io "io"
12 math "math"
13 math_bits "math/bits"
14 reflect "reflect"
15 strings "strings"
16 )
17
18
19 var _ = proto.Marshal
20 var _ = fmt.Errorf
21 var _ = math.Inf
22
23
24
25
26
27 const _ = proto.GoGoProtoPackageIsVersion3
28
29 type ComputeProcessorInfoRequest struct {
30 ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
31 XXX_NoUnkeyedLiteral struct{} `json:"-"`
32 XXX_unrecognized []byte `json:"-"`
33 XXX_sizecache int32 `json:"-"`
34 }
35
36 func (m *ComputeProcessorInfoRequest) Reset() { *m = ComputeProcessorInfoRequest{} }
37 func (*ComputeProcessorInfoRequest) ProtoMessage() {}
38 func (*ComputeProcessorInfoRequest) Descriptor() ([]byte, []int) {
39 return fileDescriptor_c90988f6b70b2a29, []int{0}
40 }
41 func (m *ComputeProcessorInfoRequest) XXX_Unmarshal(b []byte) error {
42 return m.Unmarshal(b)
43 }
44 func (m *ComputeProcessorInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
45 if deterministic {
46 return xxx_messageInfo_ComputeProcessorInfoRequest.Marshal(b, m, deterministic)
47 } else {
48 b = b[:cap(b)]
49 n, err := m.MarshalToSizedBuffer(b)
50 if err != nil {
51 return nil, err
52 }
53 return b[:n], nil
54 }
55 }
56 func (m *ComputeProcessorInfoRequest) XXX_Merge(src proto.Message) {
57 xxx_messageInfo_ComputeProcessorInfoRequest.Merge(m, src)
58 }
59 func (m *ComputeProcessorInfoRequest) XXX_Size() int {
60 return m.Size()
61 }
62 func (m *ComputeProcessorInfoRequest) XXX_DiscardUnknown() {
63 xxx_messageInfo_ComputeProcessorInfoRequest.DiscardUnknown(m)
64 }
65
66 var xxx_messageInfo_ComputeProcessorInfoRequest proto.InternalMessageInfo
67
68 type ComputeProcessorInfoResponse struct {
69 Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
70 XXX_NoUnkeyedLiteral struct{} `json:"-"`
71 XXX_unrecognized []byte `json:"-"`
72 XXX_sizecache int32 `json:"-"`
73 }
74
75 func (m *ComputeProcessorInfoResponse) Reset() { *m = ComputeProcessorInfoResponse{} }
76 func (*ComputeProcessorInfoResponse) ProtoMessage() {}
77 func (*ComputeProcessorInfoResponse) Descriptor() ([]byte, []int) {
78 return fileDescriptor_c90988f6b70b2a29, []int{1}
79 }
80 func (m *ComputeProcessorInfoResponse) XXX_Unmarshal(b []byte) error {
81 return m.Unmarshal(b)
82 }
83 func (m *ComputeProcessorInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
84 if deterministic {
85 return xxx_messageInfo_ComputeProcessorInfoResponse.Marshal(b, m, deterministic)
86 } else {
87 b = b[:cap(b)]
88 n, err := m.MarshalToSizedBuffer(b)
89 if err != nil {
90 return nil, err
91 }
92 return b[:n], nil
93 }
94 }
95 func (m *ComputeProcessorInfoResponse) XXX_Merge(src proto.Message) {
96 xxx_messageInfo_ComputeProcessorInfoResponse.Merge(m, src)
97 }
98 func (m *ComputeProcessorInfoResponse) XXX_Size() int {
99 return m.Size()
100 }
101 func (m *ComputeProcessorInfoResponse) XXX_DiscardUnknown() {
102 xxx_messageInfo_ComputeProcessorInfoResponse.DiscardUnknown(m)
103 }
104
105 var xxx_messageInfo_ComputeProcessorInfoResponse proto.InternalMessageInfo
106
107 func init() {
108 proto.RegisterType((*ComputeProcessorInfoRequest)(nil), "ComputeProcessorInfoRequest")
109 proto.RegisterType((*ComputeProcessorInfoResponse)(nil), "ComputeProcessorInfoResponse")
110 }
111
112 func init() {
113 proto.RegisterFile("github.com/Microsoft/hcsshim/internal/extendedtask/extendedtask.proto", fileDescriptor_c90988f6b70b2a29)
114 }
115
116 var fileDescriptor_c90988f6b70b2a29 = []byte{
117
118 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4d, 0xcf, 0x2c, 0xc9,
119 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xf7, 0xcd, 0x4c, 0x2e, 0xca, 0x2f, 0xce, 0x4f, 0x2b,
120 0xd1, 0xcf, 0x48, 0x2e, 0x2e, 0xce, 0xc8, 0xcc, 0xd5, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0xca, 0x4b,
121 0xcc, 0xd1, 0x4f, 0xad, 0x28, 0x49, 0xcd, 0x4b, 0x49, 0x4d, 0x29, 0x49, 0x2c, 0xce, 0x46, 0xe1,
122 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x4b, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x99, 0xfa, 0x20,
123 0x16, 0x44, 0x54, 0xc9, 0x94, 0x4b, 0xda, 0x39, 0x3f, 0xb7, 0xa0, 0xb4, 0x24, 0x35, 0xa0, 0x28,
124 0x3f, 0x39, 0xb5, 0xb8, 0x38, 0xbf, 0xc8, 0x33, 0x2f, 0x2d, 0x3f, 0x28, 0xb5, 0xb0, 0x34, 0xb5,
125 0xb8, 0x44, 0x48, 0x8c, 0x8b, 0x29, 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x89, 0xed,
126 0xd1, 0x3d, 0x79, 0x26, 0x4f, 0x97, 0x20, 0xa6, 0xcc, 0x14, 0x25, 0x13, 0x2e, 0x19, 0xec, 0xda,
127 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x44, 0xb8, 0x58, 0x93, 0xf3, 0x4b, 0xf3, 0x4a, 0xc0,
128 0x5a, 0x59, 0x83, 0x20, 0x1c, 0xa3, 0x64, 0x2e, 0x1e, 0x57, 0xa8, 0xc3, 0x42, 0x12, 0x8b, 0xb3,
129 0x85, 0x82, 0xb9, 0x44, 0xb0, 0x99, 0x22, 0x24, 0xa3, 0x87, 0xc7, 0x4d, 0x52, 0xb2, 0x7a, 0xf8,
130 0xac, 0x76, 0x8a, 0x3c, 0xf1, 0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c,
131 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x3d, 0xe9,
132 0x01, 0x69, 0x8d, 0xcc, 0x89, 0x60, 0x48, 0x62, 0x03, 0x87, 0x9a, 0x31, 0x20, 0x00, 0x00, 0xff,
133 0xff, 0x1d, 0x33, 0xbb, 0x33, 0x94, 0x01, 0x00, 0x00,
134 }
135
136 func (m *ComputeProcessorInfoRequest) Marshal() (dAtA []byte, err error) {
137 size := m.Size()
138 dAtA = make([]byte, size)
139 n, err := m.MarshalToSizedBuffer(dAtA[:size])
140 if err != nil {
141 return nil, err
142 }
143 return dAtA[:n], nil
144 }
145
146 func (m *ComputeProcessorInfoRequest) MarshalTo(dAtA []byte) (int, error) {
147 size := m.Size()
148 return m.MarshalToSizedBuffer(dAtA[:size])
149 }
150
151 func (m *ComputeProcessorInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
152 i := len(dAtA)
153 _ = i
154 var l int
155 _ = l
156 if m.XXX_unrecognized != nil {
157 i -= len(m.XXX_unrecognized)
158 copy(dAtA[i:], m.XXX_unrecognized)
159 }
160 if len(m.ID) > 0 {
161 i -= len(m.ID)
162 copy(dAtA[i:], m.ID)
163 i = encodeVarintExtendedtask(dAtA, i, uint64(len(m.ID)))
164 i--
165 dAtA[i] = 0xa
166 }
167 return len(dAtA) - i, nil
168 }
169
170 func (m *ComputeProcessorInfoResponse) Marshal() (dAtA []byte, err error) {
171 size := m.Size()
172 dAtA = make([]byte, size)
173 n, err := m.MarshalToSizedBuffer(dAtA[:size])
174 if err != nil {
175 return nil, err
176 }
177 return dAtA[:n], nil
178 }
179
180 func (m *ComputeProcessorInfoResponse) MarshalTo(dAtA []byte) (int, error) {
181 size := m.Size()
182 return m.MarshalToSizedBuffer(dAtA[:size])
183 }
184
185 func (m *ComputeProcessorInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
186 i := len(dAtA)
187 _ = i
188 var l int
189 _ = l
190 if m.XXX_unrecognized != nil {
191 i -= len(m.XXX_unrecognized)
192 copy(dAtA[i:], m.XXX_unrecognized)
193 }
194 if m.Count != 0 {
195 i = encodeVarintExtendedtask(dAtA, i, uint64(m.Count))
196 i--
197 dAtA[i] = 0x8
198 }
199 return len(dAtA) - i, nil
200 }
201
202 func encodeVarintExtendedtask(dAtA []byte, offset int, v uint64) int {
203 offset -= sovExtendedtask(v)
204 base := offset
205 for v >= 1<<7 {
206 dAtA[offset] = uint8(v&0x7f | 0x80)
207 v >>= 7
208 offset++
209 }
210 dAtA[offset] = uint8(v)
211 return base
212 }
213 func (m *ComputeProcessorInfoRequest) Size() (n int) {
214 if m == nil {
215 return 0
216 }
217 var l int
218 _ = l
219 l = len(m.ID)
220 if l > 0 {
221 n += 1 + l + sovExtendedtask(uint64(l))
222 }
223 if m.XXX_unrecognized != nil {
224 n += len(m.XXX_unrecognized)
225 }
226 return n
227 }
228
229 func (m *ComputeProcessorInfoResponse) Size() (n int) {
230 if m == nil {
231 return 0
232 }
233 var l int
234 _ = l
235 if m.Count != 0 {
236 n += 1 + sovExtendedtask(uint64(m.Count))
237 }
238 if m.XXX_unrecognized != nil {
239 n += len(m.XXX_unrecognized)
240 }
241 return n
242 }
243
244 func sovExtendedtask(x uint64) (n int) {
245 return (math_bits.Len64(x|1) + 6) / 7
246 }
247 func sozExtendedtask(x uint64) (n int) {
248 return sovExtendedtask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
249 }
250 func (this *ComputeProcessorInfoRequest) String() string {
251 if this == nil {
252 return "nil"
253 }
254 s := strings.Join([]string{`&ComputeProcessorInfoRequest{`,
255 `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
256 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
257 `}`,
258 }, "")
259 return s
260 }
261 func (this *ComputeProcessorInfoResponse) String() string {
262 if this == nil {
263 return "nil"
264 }
265 s := strings.Join([]string{`&ComputeProcessorInfoResponse{`,
266 `Count:` + fmt.Sprintf("%v", this.Count) + `,`,
267 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
268 `}`,
269 }, "")
270 return s
271 }
272 func valueToStringExtendedtask(v interface{}) string {
273 rv := reflect.ValueOf(v)
274 if rv.IsNil() {
275 return "nil"
276 }
277 pv := reflect.Indirect(rv).Interface()
278 return fmt.Sprintf("*%v", pv)
279 }
280
281 type ExtendedTaskService interface {
282 ComputeProcessorInfo(ctx context.Context, req *ComputeProcessorInfoRequest) (*ComputeProcessorInfoResponse, error)
283 }
284
285 func RegisterExtendedTaskService(srv *github_com_containerd_ttrpc.Server, svc ExtendedTaskService) {
286 srv.Register("ExtendedTask", map[string]github_com_containerd_ttrpc.Method{
287 "ComputeProcessorInfo": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
288 var req ComputeProcessorInfoRequest
289 if err := unmarshal(&req); err != nil {
290 return nil, err
291 }
292 return svc.ComputeProcessorInfo(ctx, &req)
293 },
294 })
295 }
296
297 type extendedTaskClient struct {
298 client *github_com_containerd_ttrpc.Client
299 }
300
301 func NewExtendedTaskClient(client *github_com_containerd_ttrpc.Client) ExtendedTaskService {
302 return &extendedTaskClient{
303 client: client,
304 }
305 }
306
307 func (c *extendedTaskClient) ComputeProcessorInfo(ctx context.Context, req *ComputeProcessorInfoRequest) (*ComputeProcessorInfoResponse, error) {
308 var resp ComputeProcessorInfoResponse
309 if err := c.client.Call(ctx, "ExtendedTask", "ComputeProcessorInfo", req, &resp); err != nil {
310 return nil, err
311 }
312 return &resp, nil
313 }
314 func (m *ComputeProcessorInfoRequest) Unmarshal(dAtA []byte) error {
315 l := len(dAtA)
316 iNdEx := 0
317 for iNdEx < l {
318 preIndex := iNdEx
319 var wire uint64
320 for shift := uint(0); ; shift += 7 {
321 if shift >= 64 {
322 return ErrIntOverflowExtendedtask
323 }
324 if iNdEx >= l {
325 return io.ErrUnexpectedEOF
326 }
327 b := dAtA[iNdEx]
328 iNdEx++
329 wire |= uint64(b&0x7F) << shift
330 if b < 0x80 {
331 break
332 }
333 }
334 fieldNum := int32(wire >> 3)
335 wireType := int(wire & 0x7)
336 if wireType == 4 {
337 return fmt.Errorf("proto: ComputeProcessorInfoRequest: wiretype end group for non-group")
338 }
339 if fieldNum <= 0 {
340 return fmt.Errorf("proto: ComputeProcessorInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire)
341 }
342 switch fieldNum {
343 case 1:
344 if wireType != 2 {
345 return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
346 }
347 var stringLen uint64
348 for shift := uint(0); ; shift += 7 {
349 if shift >= 64 {
350 return ErrIntOverflowExtendedtask
351 }
352 if iNdEx >= l {
353 return io.ErrUnexpectedEOF
354 }
355 b := dAtA[iNdEx]
356 iNdEx++
357 stringLen |= uint64(b&0x7F) << shift
358 if b < 0x80 {
359 break
360 }
361 }
362 intStringLen := int(stringLen)
363 if intStringLen < 0 {
364 return ErrInvalidLengthExtendedtask
365 }
366 postIndex := iNdEx + intStringLen
367 if postIndex < 0 {
368 return ErrInvalidLengthExtendedtask
369 }
370 if postIndex > l {
371 return io.ErrUnexpectedEOF
372 }
373 m.ID = string(dAtA[iNdEx:postIndex])
374 iNdEx = postIndex
375 default:
376 iNdEx = preIndex
377 skippy, err := skipExtendedtask(dAtA[iNdEx:])
378 if err != nil {
379 return err
380 }
381 if (skippy < 0) || (iNdEx+skippy) < 0 {
382 return ErrInvalidLengthExtendedtask
383 }
384 if (iNdEx + skippy) > l {
385 return io.ErrUnexpectedEOF
386 }
387 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
388 iNdEx += skippy
389 }
390 }
391
392 if iNdEx > l {
393 return io.ErrUnexpectedEOF
394 }
395 return nil
396 }
397 func (m *ComputeProcessorInfoResponse) Unmarshal(dAtA []byte) error {
398 l := len(dAtA)
399 iNdEx := 0
400 for iNdEx < l {
401 preIndex := iNdEx
402 var wire uint64
403 for shift := uint(0); ; shift += 7 {
404 if shift >= 64 {
405 return ErrIntOverflowExtendedtask
406 }
407 if iNdEx >= l {
408 return io.ErrUnexpectedEOF
409 }
410 b := dAtA[iNdEx]
411 iNdEx++
412 wire |= uint64(b&0x7F) << shift
413 if b < 0x80 {
414 break
415 }
416 }
417 fieldNum := int32(wire >> 3)
418 wireType := int(wire & 0x7)
419 if wireType == 4 {
420 return fmt.Errorf("proto: ComputeProcessorInfoResponse: wiretype end group for non-group")
421 }
422 if fieldNum <= 0 {
423 return fmt.Errorf("proto: ComputeProcessorInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire)
424 }
425 switch fieldNum {
426 case 1:
427 if wireType != 0 {
428 return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType)
429 }
430 m.Count = 0
431 for shift := uint(0); ; shift += 7 {
432 if shift >= 64 {
433 return ErrIntOverflowExtendedtask
434 }
435 if iNdEx >= l {
436 return io.ErrUnexpectedEOF
437 }
438 b := dAtA[iNdEx]
439 iNdEx++
440 m.Count |= int32(b&0x7F) << shift
441 if b < 0x80 {
442 break
443 }
444 }
445 default:
446 iNdEx = preIndex
447 skippy, err := skipExtendedtask(dAtA[iNdEx:])
448 if err != nil {
449 return err
450 }
451 if (skippy < 0) || (iNdEx+skippy) < 0 {
452 return ErrInvalidLengthExtendedtask
453 }
454 if (iNdEx + skippy) > l {
455 return io.ErrUnexpectedEOF
456 }
457 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
458 iNdEx += skippy
459 }
460 }
461
462 if iNdEx > l {
463 return io.ErrUnexpectedEOF
464 }
465 return nil
466 }
467 func skipExtendedtask(dAtA []byte) (n int, err error) {
468 l := len(dAtA)
469 iNdEx := 0
470 depth := 0
471 for iNdEx < l {
472 var wire uint64
473 for shift := uint(0); ; shift += 7 {
474 if shift >= 64 {
475 return 0, ErrIntOverflowExtendedtask
476 }
477 if iNdEx >= l {
478 return 0, io.ErrUnexpectedEOF
479 }
480 b := dAtA[iNdEx]
481 iNdEx++
482 wire |= (uint64(b) & 0x7F) << shift
483 if b < 0x80 {
484 break
485 }
486 }
487 wireType := int(wire & 0x7)
488 switch wireType {
489 case 0:
490 for shift := uint(0); ; shift += 7 {
491 if shift >= 64 {
492 return 0, ErrIntOverflowExtendedtask
493 }
494 if iNdEx >= l {
495 return 0, io.ErrUnexpectedEOF
496 }
497 iNdEx++
498 if dAtA[iNdEx-1] < 0x80 {
499 break
500 }
501 }
502 case 1:
503 iNdEx += 8
504 case 2:
505 var length int
506 for shift := uint(0); ; shift += 7 {
507 if shift >= 64 {
508 return 0, ErrIntOverflowExtendedtask
509 }
510 if iNdEx >= l {
511 return 0, io.ErrUnexpectedEOF
512 }
513 b := dAtA[iNdEx]
514 iNdEx++
515 length |= (int(b) & 0x7F) << shift
516 if b < 0x80 {
517 break
518 }
519 }
520 if length < 0 {
521 return 0, ErrInvalidLengthExtendedtask
522 }
523 iNdEx += length
524 case 3:
525 depth++
526 case 4:
527 if depth == 0 {
528 return 0, ErrUnexpectedEndOfGroupExtendedtask
529 }
530 depth--
531 case 5:
532 iNdEx += 4
533 default:
534 return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
535 }
536 if iNdEx < 0 {
537 return 0, ErrInvalidLengthExtendedtask
538 }
539 if depth == 0 {
540 return iNdEx, nil
541 }
542 }
543 return 0, io.ErrUnexpectedEOF
544 }
545
546 var (
547 ErrInvalidLengthExtendedtask = fmt.Errorf("proto: negative length found during unmarshaling")
548 ErrIntOverflowExtendedtask = fmt.Errorf("proto: integer overflow")
549 ErrUnexpectedEndOfGroupExtendedtask = fmt.Errorf("proto: unexpected end of group")
550 )
551
View as plain text