forked from containerd/containerd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.pb.go
4449 lines (4272 loc) · 116 KB
/
content.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: github.com/containerd/containerd/api/services/content/v1/content.proto
/*
Package content is a generated protocol buffer package.
It is generated from these files:
github.com/containerd/containerd/api/services/content/v1/content.proto
It has these top-level messages:
Info
InfoRequest
InfoResponse
UpdateRequest
UpdateResponse
ListContentRequest
ListContentResponse
DeleteContentRequest
ReadContentRequest
ReadContentResponse
Status
StatusRequest
StatusResponse
ListStatusesRequest
ListStatusesResponse
WriteContentRequest
WriteContentResponse
AbortRequest
*/
package content
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
// skipping weak import gogoproto "github.com/gogo/protobuf/gogoproto"
import google_protobuf1 "github.com/gogo/protobuf/types"
import _ "github.com/gogo/protobuf/types"
import google_protobuf3 "github.com/gogo/protobuf/types"
import github_com_opencontainers_go_digest "github.com/opencontainers/go-digest"
import time "time"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import strings "strings"
import reflect "reflect"
import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// WriteAction defines the behavior of a WriteRequest.
type WriteAction int32
const (
// WriteActionStat instructs the writer to return the current status while
// holding the lock on the write.
WriteActionStat WriteAction = 0
// WriteActionWrite sets the action for the write request to write data.
//
// Any data included will be written at the provided offset. The
// transaction will be left open for further writes.
//
// This is the default.
WriteActionWrite WriteAction = 1
// WriteActionCommit will write any outstanding data in the message and
// commit the write, storing it under the digest.
//
// This can be used in a single message to send the data, verify it and
// commit it.
//
// This action will always terminate the write.
WriteActionCommit WriteAction = 2
)
var WriteAction_name = map[int32]string{
0: "STAT",
1: "WRITE",
2: "COMMIT",
}
var WriteAction_value = map[string]int32{
"STAT": 0,
"WRITE": 1,
"COMMIT": 2,
}
func (x WriteAction) String() string {
return proto.EnumName(WriteAction_name, int32(x))
}
func (WriteAction) EnumDescriptor() ([]byte, []int) { return fileDescriptorContent, []int{0} }
type Info struct {
// Digest is the hash identity of the blob.
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
// Size is the total number of bytes in the blob.
Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
// CreatedAt provides the time at which the blob was committed.
CreatedAt time.Time `protobuf:"bytes,3,opt,name=created_at,json=createdAt,stdtime" json:"created_at"`
// UpdatedAt provides the time the info was last updated.
UpdatedAt time.Time `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,stdtime" json:"updated_at"`
// Labels are arbitrary data on snapshots.
//
// The combined size of a key/value pair cannot exceed 4096 bytes.
Labels map[string]string `protobuf:"bytes,5,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *Info) Reset() { *m = Info{} }
func (*Info) ProtoMessage() {}
func (*Info) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{0} }
type InfoRequest struct {
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
}
func (m *InfoRequest) Reset() { *m = InfoRequest{} }
func (*InfoRequest) ProtoMessage() {}
func (*InfoRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{1} }
type InfoResponse struct {
Info Info `protobuf:"bytes,1,opt,name=info" json:"info"`
}
func (m *InfoResponse) Reset() { *m = InfoResponse{} }
func (*InfoResponse) ProtoMessage() {}
func (*InfoResponse) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{2} }
type UpdateRequest struct {
Info Info `protobuf:"bytes,1,opt,name=info" json:"info"`
// UpdateMask specifies which fields to perform the update on. If empty,
// the operation applies to all fields.
//
// In info, Digest, Size, and CreatedAt are immutable,
// other field may be updated using this mask.
// If no mask is provided, all mutable field are updated.
UpdateMask *google_protobuf1.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"`
}
func (m *UpdateRequest) Reset() { *m = UpdateRequest{} }
func (*UpdateRequest) ProtoMessage() {}
func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{3} }
type UpdateResponse struct {
Info Info `protobuf:"bytes,1,opt,name=info" json:"info"`
}
func (m *UpdateResponse) Reset() { *m = UpdateResponse{} }
func (*UpdateResponse) ProtoMessage() {}
func (*UpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{4} }
type ListContentRequest struct {
// Filters contains one or more filters using the syntax defined in the
// containerd filter package.
//
// The returned result will be those that match any of the provided
// filters. Expanded, containers that match the following will be
// returned:
//
// filters[0] or filters[1] or ... or filters[n-1] or filters[n]
//
// If filters is zero-length or nil, all items will be returned.
Filters []string `protobuf:"bytes,1,rep,name=filters" json:"filters,omitempty"`
}
func (m *ListContentRequest) Reset() { *m = ListContentRequest{} }
func (*ListContentRequest) ProtoMessage() {}
func (*ListContentRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{5} }
type ListContentResponse struct {
Info []Info `protobuf:"bytes,1,rep,name=info" json:"info"`
}
func (m *ListContentResponse) Reset() { *m = ListContentResponse{} }
func (*ListContentResponse) ProtoMessage() {}
func (*ListContentResponse) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{6} }
type DeleteContentRequest struct {
// Digest specifies which content to delete.
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
}
func (m *DeleteContentRequest) Reset() { *m = DeleteContentRequest{} }
func (*DeleteContentRequest) ProtoMessage() {}
func (*DeleteContentRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{7} }
// ReadContentRequest defines the fields that make up a request to read a portion of
// data from a stored object.
type ReadContentRequest struct {
// Digest is the hash identity to read.
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
// Offset specifies the number of bytes from the start at which to begin
// the read. If zero or less, the read will be from the start. This uses
// standard zero-indexed semantics.
Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
// size is the total size of the read. If zero, the entire blob will be
// returned by the service.
Size_ int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
}
func (m *ReadContentRequest) Reset() { *m = ReadContentRequest{} }
func (*ReadContentRequest) ProtoMessage() {}
func (*ReadContentRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{8} }
// ReadContentResponse carries byte data for a read request.
type ReadContentResponse struct {
Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *ReadContentResponse) Reset() { *m = ReadContentResponse{} }
func (*ReadContentResponse) ProtoMessage() {}
func (*ReadContentResponse) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{9} }
type Status struct {
StartedAt time.Time `protobuf:"bytes,1,opt,name=started_at,json=startedAt,stdtime" json:"started_at"`
UpdatedAt time.Time `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,stdtime" json:"updated_at"`
Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"`
Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
Expected github_com_opencontainers_go_digest.Digest `protobuf:"bytes,6,opt,name=expected,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"expected"`
}
func (m *Status) Reset() { *m = Status{} }
func (*Status) ProtoMessage() {}
func (*Status) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{10} }
type StatusRequest struct {
Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
}
func (m *StatusRequest) Reset() { *m = StatusRequest{} }
func (*StatusRequest) ProtoMessage() {}
func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{11} }
type StatusResponse struct {
Status *Status `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"`
}
func (m *StatusResponse) Reset() { *m = StatusResponse{} }
func (*StatusResponse) ProtoMessage() {}
func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{12} }
type ListStatusesRequest struct {
Filters []string `protobuf:"bytes,1,rep,name=filters" json:"filters,omitempty"`
}
func (m *ListStatusesRequest) Reset() { *m = ListStatusesRequest{} }
func (*ListStatusesRequest) ProtoMessage() {}
func (*ListStatusesRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{13} }
type ListStatusesResponse struct {
Statuses []Status `protobuf:"bytes,1,rep,name=statuses" json:"statuses"`
}
func (m *ListStatusesResponse) Reset() { *m = ListStatusesResponse{} }
func (*ListStatusesResponse) ProtoMessage() {}
func (*ListStatusesResponse) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{14} }
// WriteContentRequest writes data to the request ref at offset.
type WriteContentRequest struct {
// Action sets the behavior of the write.
//
// When this is a write and the ref is not yet allocated, the ref will be
// allocated and the data will be written at offset.
//
// If the action is write and the ref is allocated, it will accept data to
// an offset that has not yet been written.
//
// If the action is write and there is no data, the current write status
// will be returned. This works differently from status because the stream
// holds a lock.
Action WriteAction `protobuf:"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction" json:"action,omitempty"`
// Ref identifies the pre-commit object to write to.
Ref string `protobuf:"bytes,2,opt,name=ref,proto3" json:"ref,omitempty"`
// Total can be set to have the service validate the total size of the
// committed content.
//
// The latest value before or with the commit action message will be use to
// validate the content. If the offset overflows total, the service may
// report an error. It is only required on one message for the write.
//
// If the value is zero or less, no validation of the final content will be
// performed.
Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
// Expected can be set to have the service validate the final content against
// the provided digest.
//
// If the digest is already present in the object store, an AlreadyExists
// error will be returned.
//
// Only the latest version will be used to check the content against the
// digest. It is only required to include it on a single message, before or
// with the commit action message.
Expected github_com_opencontainers_go_digest.Digest `protobuf:"bytes,4,opt,name=expected,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"expected"`
// Offset specifies the number of bytes from the start at which to begin
// the write. For most implementations, this means from the start of the
// file. This uses standard, zero-indexed semantics.
//
// If the action is write, the remote may remove all previously written
// data after the offset. Implementations may support arbitrary offsets but
// MUST support reseting this value to zero with a write. If an
// implementation does not support a write at a particular offset, an
// OutOfRange error must be returned.
Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"`
// Data is the actual bytes to be written.
//
// If this is empty and the message is not a commit, a response will be
// returned with the current write state.
Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
// Labels are arbitrary data on snapshots.
//
// The combined size of a key/value pair cannot exceed 4096 bytes.
Labels map[string]string `protobuf:"bytes,7,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *WriteContentRequest) Reset() { *m = WriteContentRequest{} }
func (*WriteContentRequest) ProtoMessage() {}
func (*WriteContentRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{15} }
// WriteContentResponse is returned on the culmination of a write call.
type WriteContentResponse struct {
// Action contains the action for the final message of the stream. A writer
// should confirm that they match the intended result.
Action WriteAction `protobuf:"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction" json:"action,omitempty"`
// StartedAt provides the time at which the write began.
//
// This must be set for stat and commit write actions. All other write
// actions may omit this.
StartedAt time.Time `protobuf:"bytes,2,opt,name=started_at,json=startedAt,stdtime" json:"started_at"`
// UpdatedAt provides the last time of a successful write.
//
// This must be set for stat and commit write actions. All other write
// actions may omit this.
UpdatedAt time.Time `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,stdtime" json:"updated_at"`
// Offset is the current committed size for the write.
Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
// Total provides the current, expected total size of the write.
//
// We include this to provide consistency with the Status structure on the
// client writer.
//
// This is only valid on the Stat and Commit response.
Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
// Digest, if present, includes the digest up to the currently committed
// bytes. If action is commit, this field will be set. It is implementation
// defined if this is set for other actions.
Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,6,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
}
func (m *WriteContentResponse) Reset() { *m = WriteContentResponse{} }
func (*WriteContentResponse) ProtoMessage() {}
func (*WriteContentResponse) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{16} }
type AbortRequest struct {
Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
}
func (m *AbortRequest) Reset() { *m = AbortRequest{} }
func (*AbortRequest) ProtoMessage() {}
func (*AbortRequest) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{17} }
func init() {
proto.RegisterType((*Info)(nil), "containerd.services.content.v1.Info")
proto.RegisterType((*InfoRequest)(nil), "containerd.services.content.v1.InfoRequest")
proto.RegisterType((*InfoResponse)(nil), "containerd.services.content.v1.InfoResponse")
proto.RegisterType((*UpdateRequest)(nil), "containerd.services.content.v1.UpdateRequest")
proto.RegisterType((*UpdateResponse)(nil), "containerd.services.content.v1.UpdateResponse")
proto.RegisterType((*ListContentRequest)(nil), "containerd.services.content.v1.ListContentRequest")
proto.RegisterType((*ListContentResponse)(nil), "containerd.services.content.v1.ListContentResponse")
proto.RegisterType((*DeleteContentRequest)(nil), "containerd.services.content.v1.DeleteContentRequest")
proto.RegisterType((*ReadContentRequest)(nil), "containerd.services.content.v1.ReadContentRequest")
proto.RegisterType((*ReadContentResponse)(nil), "containerd.services.content.v1.ReadContentResponse")
proto.RegisterType((*Status)(nil), "containerd.services.content.v1.Status")
proto.RegisterType((*StatusRequest)(nil), "containerd.services.content.v1.StatusRequest")
proto.RegisterType((*StatusResponse)(nil), "containerd.services.content.v1.StatusResponse")
proto.RegisterType((*ListStatusesRequest)(nil), "containerd.services.content.v1.ListStatusesRequest")
proto.RegisterType((*ListStatusesResponse)(nil), "containerd.services.content.v1.ListStatusesResponse")
proto.RegisterType((*WriteContentRequest)(nil), "containerd.services.content.v1.WriteContentRequest")
proto.RegisterType((*WriteContentResponse)(nil), "containerd.services.content.v1.WriteContentResponse")
proto.RegisterType((*AbortRequest)(nil), "containerd.services.content.v1.AbortRequest")
proto.RegisterEnum("containerd.services.content.v1.WriteAction", WriteAction_name, WriteAction_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Content service
type ContentClient interface {
// Info returns information about a committed object.
//
// This call can be used for getting the size of content and checking for
// existence.
Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
// Update updates content metadata.
//
// This call can be used to manage the mutable content labels. The
// immutable metadata such as digest, size, and committed at cannot
// be updated.
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
// List streams the entire set of content as Info objects and closes the
// stream.
//
// Typically, this will yield a large response, chunked into messages.
// Clients should make provisions to ensure they can handle the entire data
// set.
List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error)
// Delete will delete the referenced object.
Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error)
// Read allows one to read an object based on the offset into the content.
//
// The requested data may be returned in one or more messages.
Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error)
// Status returns the status for a single reference.
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
// ListStatuses returns the status of ongoing object ingestions, started via
// Write.
//
// Only those matching the regular expression will be provided in the
// response. If the provided regular expression is empty, all ingestions
// will be provided.
ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error)
// Write begins or resumes writes to a resource identified by a unique ref.
// Only one active stream may exist at a time for each ref.
//
// Once a write stream has started, it may only write to a single ref, thus
// once a stream is started, the ref may be ommitted on subsequent writes.
//
// For any write transaction represented by a ref, only a single write may
// be made to a given offset. If overlapping writes occur, it is an error.
// Writes should be sequential and implementations may throw an error if
// this is required.
//
// If expected_digest is set and already part of the content store, the
// write will fail.
//
// When completed, the commit flag should be set to true. If expected size
// or digest is set, the content will be validated against those values.
Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error)
// Abort cancels the ongoing write named in the request. Any resources
// associated with the write will be collected.
Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error)
}
type contentClient struct {
cc *grpc.ClientConn
}
func NewContentClient(cc *grpc.ClientConn) ContentClient {
return &contentClient{cc}
}
func (c *contentClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
out := new(InfoResponse)
err := grpc.Invoke(ctx, "/containerd.services.content.v1.Content/Info", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contentClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) {
out := new(UpdateResponse)
err := grpc.Invoke(ctx, "/containerd.services.content.v1.Content/Update", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contentClient) List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Content_serviceDesc.Streams[0], c.cc, "/containerd.services.content.v1.Content/List", opts...)
if err != nil {
return nil, err
}
x := &contentListClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Content_ListClient interface {
Recv() (*ListContentResponse, error)
grpc.ClientStream
}
type contentListClient struct {
grpc.ClientStream
}
func (x *contentListClient) Recv() (*ListContentResponse, error) {
m := new(ListContentResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *contentClient) Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) {
out := new(google_protobuf3.Empty)
err := grpc.Invoke(ctx, "/containerd.services.content.v1.Content/Delete", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contentClient) Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Content_serviceDesc.Streams[1], c.cc, "/containerd.services.content.v1.Content/Read", opts...)
if err != nil {
return nil, err
}
x := &contentReadClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Content_ReadClient interface {
Recv() (*ReadContentResponse, error)
grpc.ClientStream
}
type contentReadClient struct {
grpc.ClientStream
}
func (x *contentReadClient) Recv() (*ReadContentResponse, error) {
m := new(ReadContentResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *contentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
out := new(StatusResponse)
err := grpc.Invoke(ctx, "/containerd.services.content.v1.Content/Status", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contentClient) ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error) {
out := new(ListStatusesResponse)
err := grpc.Invoke(ctx, "/containerd.services.content.v1.Content/ListStatuses", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *contentClient) Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Content_serviceDesc.Streams[2], c.cc, "/containerd.services.content.v1.Content/Write", opts...)
if err != nil {
return nil, err
}
x := &contentWriteClient{stream}
return x, nil
}
type Content_WriteClient interface {
Send(*WriteContentRequest) error
Recv() (*WriteContentResponse, error)
grpc.ClientStream
}
type contentWriteClient struct {
grpc.ClientStream
}
func (x *contentWriteClient) Send(m *WriteContentRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *contentWriteClient) Recv() (*WriteContentResponse, error) {
m := new(WriteContentResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *contentClient) Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*google_protobuf3.Empty, error) {
out := new(google_protobuf3.Empty)
err := grpc.Invoke(ctx, "/containerd.services.content.v1.Content/Abort", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Content service
type ContentServer interface {
// Info returns information about a committed object.
//
// This call can be used for getting the size of content and checking for
// existence.
Info(context.Context, *InfoRequest) (*InfoResponse, error)
// Update updates content metadata.
//
// This call can be used to manage the mutable content labels. The
// immutable metadata such as digest, size, and committed at cannot
// be updated.
Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
// List streams the entire set of content as Info objects and closes the
// stream.
//
// Typically, this will yield a large response, chunked into messages.
// Clients should make provisions to ensure they can handle the entire data
// set.
List(*ListContentRequest, Content_ListServer) error
// Delete will delete the referenced object.
Delete(context.Context, *DeleteContentRequest) (*google_protobuf3.Empty, error)
// Read allows one to read an object based on the offset into the content.
//
// The requested data may be returned in one or more messages.
Read(*ReadContentRequest, Content_ReadServer) error
// Status returns the status for a single reference.
Status(context.Context, *StatusRequest) (*StatusResponse, error)
// ListStatuses returns the status of ongoing object ingestions, started via
// Write.
//
// Only those matching the regular expression will be provided in the
// response. If the provided regular expression is empty, all ingestions
// will be provided.
ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error)
// Write begins or resumes writes to a resource identified by a unique ref.
// Only one active stream may exist at a time for each ref.
//
// Once a write stream has started, it may only write to a single ref, thus
// once a stream is started, the ref may be ommitted on subsequent writes.
//
// For any write transaction represented by a ref, only a single write may
// be made to a given offset. If overlapping writes occur, it is an error.
// Writes should be sequential and implementations may throw an error if
// this is required.
//
// If expected_digest is set and already part of the content store, the
// write will fail.
//
// When completed, the commit flag should be set to true. If expected size
// or digest is set, the content will be validated against those values.
Write(Content_WriteServer) error
// Abort cancels the ongoing write named in the request. Any resources
// associated with the write will be collected.
Abort(context.Context, *AbortRequest) (*google_protobuf3.Empty, error)
}
func RegisterContentServer(s *grpc.Server, srv ContentServer) {
s.RegisterService(&_Content_serviceDesc, srv)
}
func _Content_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContentServer).Info(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/containerd.services.content.v1.Content/Info",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContentServer).Info(ctx, req.(*InfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Content_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContentServer).Update(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/containerd.services.content.v1.Content/Update",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContentServer).Update(ctx, req.(*UpdateRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Content_List_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ListContentRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ContentServer).List(m, &contentListServer{stream})
}
type Content_ListServer interface {
Send(*ListContentResponse) error
grpc.ServerStream
}
type contentListServer struct {
grpc.ServerStream
}
func (x *contentListServer) Send(m *ListContentResponse) error {
return x.ServerStream.SendMsg(m)
}
func _Content_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteContentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContentServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/containerd.services.content.v1.Content/Delete",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContentServer).Delete(ctx, req.(*DeleteContentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Content_Read_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(ReadContentRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ContentServer).Read(m, &contentReadServer{stream})
}
type Content_ReadServer interface {
Send(*ReadContentResponse) error
grpc.ServerStream
}
type contentReadServer struct {
grpc.ServerStream
}
func (x *contentReadServer) Send(m *ReadContentResponse) error {
return x.ServerStream.SendMsg(m)
}
func _Content_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContentServer).Status(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/containerd.services.content.v1.Content/Status",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContentServer).Status(ctx, req.(*StatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Content_ListStatuses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListStatusesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContentServer).ListStatuses(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/containerd.services.content.v1.Content/ListStatuses",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContentServer).ListStatuses(ctx, req.(*ListStatusesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Content_Write_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ContentServer).Write(&contentWriteServer{stream})
}
type Content_WriteServer interface {
Send(*WriteContentResponse) error
Recv() (*WriteContentRequest, error)
grpc.ServerStream
}
type contentWriteServer struct {
grpc.ServerStream
}
func (x *contentWriteServer) Send(m *WriteContentResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *contentWriteServer) Recv() (*WriteContentRequest, error) {
m := new(WriteContentRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Content_Abort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AbortRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ContentServer).Abort(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/containerd.services.content.v1.Content/Abort",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ContentServer).Abort(ctx, req.(*AbortRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Content_serviceDesc = grpc.ServiceDesc{
ServiceName: "containerd.services.content.v1.Content",
HandlerType: (*ContentServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Info",
Handler: _Content_Info_Handler,
},
{
MethodName: "Update",
Handler: _Content_Update_Handler,
},
{
MethodName: "Delete",
Handler: _Content_Delete_Handler,
},
{
MethodName: "Status",
Handler: _Content_Status_Handler,
},
{
MethodName: "ListStatuses",
Handler: _Content_ListStatuses_Handler,
},
{
MethodName: "Abort",
Handler: _Content_Abort_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "List",
Handler: _Content_List_Handler,
ServerStreams: true,
},
{
StreamName: "Read",
Handler: _Content_Read_Handler,
ServerStreams: true,
},
{
StreamName: "Write",
Handler: _Content_Write_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "github.com/containerd/containerd/api/services/content/v1/content.proto",
}
func (m *Info) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Info) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Digest) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
i += copy(dAtA[i:], m.Digest)
}
if m.Size_ != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintContent(dAtA, i, uint64(m.Size_))
}
dAtA[i] = 0x1a
i++
i = encodeVarintContent(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)))
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
dAtA[i] = 0x22
i++
i = encodeVarintContent(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)))
n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n2
if len(m.Labels) > 0 {
for k, _ := range m.Labels {
dAtA[i] = 0x2a
i++
v := m.Labels[k]
mapSize := 1 + len(k) + sovContent(uint64(len(k))) + 1 + len(v) + sovContent(uint64(len(v)))
i = encodeVarintContent(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintContent(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintContent(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v)
}
}
return i, nil
}
func (m *InfoRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Digest) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
i += copy(dAtA[i:], m.Digest)
}
return i, nil
}
func (m *InfoResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)