Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Michael Crosby authored on 2017/12/01 01:11:33... | ... |
@@ -4,7 +4,7 @@ TOMLV_COMMIT=9baf8a8a9f2ed20a8e54160840c492f937eeaf9a |
4 | 4 |
|
5 | 5 |
# When updating RUNC_COMMIT, also update runc in vendor.conf accordingly |
6 | 6 |
RUNC_COMMIT=b2567b37d7b75eb4cf325b77297b140ea686ce8f |
7 |
-CONTAINERD_COMMIT=59bd1967112885c4d49e510e5570182865ba6fdd |
|
7 |
+CONTAINERD_COMMIT=6bff39c643886dfa3d546e83a90a527b64ddeacf |
|
8 | 8 |
TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574 |
9 | 9 |
LIBNETWORK_COMMIT=7b2b1feb1de4817d522cc372af149ff48d25028e |
10 | 10 |
VNDR_COMMIT=a6e196d8b4b0cbbdc29aebdb20c59ac6926bb384 |
... | ... |
@@ -103,15 +103,15 @@ github.com/googleapis/gax-go da06d194a00e19ce00d9011a13931c3f6f6887c7 |
103 | 103 |
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944 |
104 | 104 |
|
105 | 105 |
# containerd |
106 |
-github.com/containerd/containerd 59bd1967112885c4d49e510e5570182865ba6fdd |
|
106 |
+github.com/containerd/containerd 6bff39c643886dfa3d546e83a90a527b64ddeacf |
|
107 | 107 |
github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6 |
108 | 108 |
github.com/containerd/continuity 35d55c5e8dd23b32037d56cf97174aff3efdfa83 |
109 |
-github.com/containerd/cgroups f7dd103d3e4e696aa67152f6b4ddd1779a3455a9 |
|
109 |
+github.com/containerd/cgroups 29da22c6171a4316169f9205ab6c49f59b5b852f |
|
110 | 110 |
github.com/containerd/console 84eeaae905fa414d03e07bcd6c8d3f19e7cf180e |
111 | 111 |
github.com/containerd/go-runc ed1cbe1fc31f5fb2359d3a54b6330d1a097858b7 |
112 | 112 |
github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788 |
113 | 113 |
github.com/dmcgowan/go-tar go1.10 |
114 |
-github.com/stevvooe/ttrpc bdb2ab7a8169e485e39421e666e15a505e575fd2 |
|
114 |
+github.com/stevvooe/ttrpc 8c92e22ce0c492875ccaac3ab06143a77d8ed0c1 |
|
115 | 115 |
|
116 | 116 |
# cluster |
117 | 117 |
github.com/docker/swarmkit de950a7ed842c7b7e47e9451cde9bf8f96031894 |
... | ... |
@@ -310,7 +310,8 @@ func (c *cgroup) Thaw() error { |
310 | 310 |
} |
311 | 311 |
|
312 | 312 |
// OOMEventFD returns the memory cgroup's out of memory event fd that triggers |
313 |
-// when processes inside the cgroup receive an oom event |
|
313 |
+// when processes inside the cgroup receive an oom event. Returns |
|
314 |
+// ErrMemoryNotSupported if memory cgroups is not supported. |
|
314 | 315 |
func (c *cgroup) OOMEventFD() (uintptr, error) { |
315 | 316 |
c.mu.Lock() |
316 | 317 |
defer c.mu.Unlock() |
317 | 318 |
deleted file mode 100644 |
... | ... |
@@ -1,4265 +0,0 @@ |
1 |
-// Code generated by protoc-gen-gogo. DO NOT EDIT. |
|
2 |
-// source: github.com/containerd/containerd/api/services/snapshot/v1/snapshots.proto |
|
3 |
- |
|
4 |
-/* |
|
5 |
- Package snapshot is a generated protocol buffer package. |
|
6 |
- |
|
7 |
- It is generated from these files: |
|
8 |
- github.com/containerd/containerd/api/services/snapshot/v1/snapshots.proto |
|
9 |
- |
|
10 |
- It has these top-level messages: |
|
11 |
- PrepareSnapshotRequest |
|
12 |
- PrepareSnapshotResponse |
|
13 |
- ViewSnapshotRequest |
|
14 |
- ViewSnapshotResponse |
|
15 |
- MountsRequest |
|
16 |
- MountsResponse |
|
17 |
- RemoveSnapshotRequest |
|
18 |
- CommitSnapshotRequest |
|
19 |
- StatSnapshotRequest |
|
20 |
- Info |
|
21 |
- StatSnapshotResponse |
|
22 |
- UpdateSnapshotRequest |
|
23 |
- UpdateSnapshotResponse |
|
24 |
- ListSnapshotsRequest |
|
25 |
- ListSnapshotsResponse |
|
26 |
- UsageRequest |
|
27 |
- UsageResponse |
|
28 |
-*/ |
|
29 |
-package snapshot |
|
30 |
- |
|
31 |
-import proto "github.com/gogo/protobuf/proto" |
|
32 |
-import fmt "fmt" |
|
33 |
-import math "math" |
|
34 |
- |
|
35 |
-// skipping weak import gogoproto "github.com/gogo/protobuf/gogoproto" |
|
36 |
-import google_protobuf1 "github.com/gogo/protobuf/types" |
|
37 |
-import google_protobuf2 "github.com/gogo/protobuf/types" |
|
38 |
-import _ "github.com/gogo/protobuf/types" |
|
39 |
-import containerd_types "github.com/containerd/containerd/api/types" |
|
40 |
- |
|
41 |
-import time "time" |
|
42 |
- |
|
43 |
-import ( |
|
44 |
- context "golang.org/x/net/context" |
|
45 |
- grpc "google.golang.org/grpc" |
|
46 |
-) |
|
47 |
- |
|
48 |
-import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" |
|
49 |
- |
|
50 |
-import strings "strings" |
|
51 |
-import reflect "reflect" |
|
52 |
-import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" |
|
53 |
- |
|
54 |
-import io "io" |
|
55 |
- |
|
56 |
-// Reference imports to suppress errors if they are not otherwise used. |
|
57 |
-var _ = proto.Marshal |
|
58 |
-var _ = fmt.Errorf |
|
59 |
-var _ = math.Inf |
|
60 |
-var _ = time.Kitchen |
|
61 |
- |
|
62 |
-// This is a compile-time assertion to ensure that this generated file |
|
63 |
-// is compatible with the proto package it is being compiled against. |
|
64 |
-// A compilation error at this line likely means your copy of the |
|
65 |
-// proto package needs to be updated. |
|
66 |
-const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package |
|
67 |
- |
|
68 |
-type Kind int32 |
|
69 |
- |
|
70 |
-const ( |
|
71 |
- KindUnknown Kind = 0 |
|
72 |
- KindView Kind = 1 |
|
73 |
- KindActive Kind = 2 |
|
74 |
- KindCommitted Kind = 3 |
|
75 |
-) |
|
76 |
- |
|
77 |
-var Kind_name = map[int32]string{ |
|
78 |
- 0: "UNKNOWN", |
|
79 |
- 1: "VIEW", |
|
80 |
- 2: "ACTIVE", |
|
81 |
- 3: "COMMITTED", |
|
82 |
-} |
|
83 |
-var Kind_value = map[string]int32{ |
|
84 |
- "UNKNOWN": 0, |
|
85 |
- "VIEW": 1, |
|
86 |
- "ACTIVE": 2, |
|
87 |
- "COMMITTED": 3, |
|
88 |
-} |
|
89 |
- |
|
90 |
-func (x Kind) String() string { |
|
91 |
- return proto.EnumName(Kind_name, int32(x)) |
|
92 |
-} |
|
93 |
-func (Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{0} } |
|
94 |
- |
|
95 |
-type PrepareSnapshotRequest struct { |
|
96 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
97 |
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
98 |
- Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` |
|
99 |
- // Labels are arbitrary data on snapshots. |
|
100 |
- // |
|
101 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
102 |
- Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
103 |
-} |
|
104 |
- |
|
105 |
-func (m *PrepareSnapshotRequest) Reset() { *m = PrepareSnapshotRequest{} } |
|
106 |
-func (*PrepareSnapshotRequest) ProtoMessage() {} |
|
107 |
-func (*PrepareSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{0} } |
|
108 |
- |
|
109 |
-type PrepareSnapshotResponse struct { |
|
110 |
- Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"` |
|
111 |
-} |
|
112 |
- |
|
113 |
-func (m *PrepareSnapshotResponse) Reset() { *m = PrepareSnapshotResponse{} } |
|
114 |
-func (*PrepareSnapshotResponse) ProtoMessage() {} |
|
115 |
-func (*PrepareSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{1} } |
|
116 |
- |
|
117 |
-type ViewSnapshotRequest struct { |
|
118 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
119 |
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
120 |
- Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` |
|
121 |
- // Labels are arbitrary data on snapshots. |
|
122 |
- // |
|
123 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
124 |
- Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
125 |
-} |
|
126 |
- |
|
127 |
-func (m *ViewSnapshotRequest) Reset() { *m = ViewSnapshotRequest{} } |
|
128 |
-func (*ViewSnapshotRequest) ProtoMessage() {} |
|
129 |
-func (*ViewSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{2} } |
|
130 |
- |
|
131 |
-type ViewSnapshotResponse struct { |
|
132 |
- Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"` |
|
133 |
-} |
|
134 |
- |
|
135 |
-func (m *ViewSnapshotResponse) Reset() { *m = ViewSnapshotResponse{} } |
|
136 |
-func (*ViewSnapshotResponse) ProtoMessage() {} |
|
137 |
-func (*ViewSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{3} } |
|
138 |
- |
|
139 |
-type MountsRequest struct { |
|
140 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
141 |
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
142 |
-} |
|
143 |
- |
|
144 |
-func (m *MountsRequest) Reset() { *m = MountsRequest{} } |
|
145 |
-func (*MountsRequest) ProtoMessage() {} |
|
146 |
-func (*MountsRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{4} } |
|
147 |
- |
|
148 |
-type MountsResponse struct { |
|
149 |
- Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"` |
|
150 |
-} |
|
151 |
- |
|
152 |
-func (m *MountsResponse) Reset() { *m = MountsResponse{} } |
|
153 |
-func (*MountsResponse) ProtoMessage() {} |
|
154 |
-func (*MountsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{5} } |
|
155 |
- |
|
156 |
-type RemoveSnapshotRequest struct { |
|
157 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
158 |
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
159 |
-} |
|
160 |
- |
|
161 |
-func (m *RemoveSnapshotRequest) Reset() { *m = RemoveSnapshotRequest{} } |
|
162 |
-func (*RemoveSnapshotRequest) ProtoMessage() {} |
|
163 |
-func (*RemoveSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{6} } |
|
164 |
- |
|
165 |
-type CommitSnapshotRequest struct { |
|
166 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
167 |
- Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` |
|
168 |
- Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` |
|
169 |
- // Labels are arbitrary data on snapshots. |
|
170 |
- // |
|
171 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
172 |
- Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
173 |
-} |
|
174 |
- |
|
175 |
-func (m *CommitSnapshotRequest) Reset() { *m = CommitSnapshotRequest{} } |
|
176 |
-func (*CommitSnapshotRequest) ProtoMessage() {} |
|
177 |
-func (*CommitSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{7} } |
|
178 |
- |
|
179 |
-type StatSnapshotRequest struct { |
|
180 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
181 |
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
182 |
-} |
|
183 |
- |
|
184 |
-func (m *StatSnapshotRequest) Reset() { *m = StatSnapshotRequest{} } |
|
185 |
-func (*StatSnapshotRequest) ProtoMessage() {} |
|
186 |
-func (*StatSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{8} } |
|
187 |
- |
|
188 |
-type Info struct { |
|
189 |
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
|
190 |
- Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` |
|
191 |
- Kind Kind `protobuf:"varint,3,opt,name=kind,proto3,enum=containerd.services.snapshots.v1.Kind" json:"kind,omitempty"` |
|
192 |
- // CreatedAt provides the time at which the snapshot was created. |
|
193 |
- CreatedAt time.Time `protobuf:"bytes,4,opt,name=created_at,json=createdAt,stdtime" json:"created_at"` |
|
194 |
- // UpdatedAt provides the time the info was last updated. |
|
195 |
- UpdatedAt time.Time `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,stdtime" json:"updated_at"` |
|
196 |
- // Labels are arbitrary data on snapshots. |
|
197 |
- // |
|
198 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
199 |
- Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
200 |
-} |
|
201 |
- |
|
202 |
-func (m *Info) Reset() { *m = Info{} } |
|
203 |
-func (*Info) ProtoMessage() {} |
|
204 |
-func (*Info) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{9} } |
|
205 |
- |
|
206 |
-type StatSnapshotResponse struct { |
|
207 |
- Info Info `protobuf:"bytes,1,opt,name=info" json:"info"` |
|
208 |
-} |
|
209 |
- |
|
210 |
-func (m *StatSnapshotResponse) Reset() { *m = StatSnapshotResponse{} } |
|
211 |
-func (*StatSnapshotResponse) ProtoMessage() {} |
|
212 |
-func (*StatSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{10} } |
|
213 |
- |
|
214 |
-type UpdateSnapshotRequest struct { |
|
215 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
216 |
- Info Info `protobuf:"bytes,2,opt,name=info" json:"info"` |
|
217 |
- // UpdateMask specifies which fields to perform the update on. If empty, |
|
218 |
- // the operation applies to all fields. |
|
219 |
- // |
|
220 |
- // In info, Name, Parent, Kind, Created are immutable, |
|
221 |
- // other field may be updated using this mask. |
|
222 |
- // If no mask is provided, all mutable field are updated. |
|
223 |
- UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` |
|
224 |
-} |
|
225 |
- |
|
226 |
-func (m *UpdateSnapshotRequest) Reset() { *m = UpdateSnapshotRequest{} } |
|
227 |
-func (*UpdateSnapshotRequest) ProtoMessage() {} |
|
228 |
-func (*UpdateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{11} } |
|
229 |
- |
|
230 |
-type UpdateSnapshotResponse struct { |
|
231 |
- Info Info `protobuf:"bytes,1,opt,name=info" json:"info"` |
|
232 |
-} |
|
233 |
- |
|
234 |
-func (m *UpdateSnapshotResponse) Reset() { *m = UpdateSnapshotResponse{} } |
|
235 |
-func (*UpdateSnapshotResponse) ProtoMessage() {} |
|
236 |
-func (*UpdateSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{12} } |
|
237 |
- |
|
238 |
-type ListSnapshotsRequest struct { |
|
239 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
240 |
-} |
|
241 |
- |
|
242 |
-func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} } |
|
243 |
-func (*ListSnapshotsRequest) ProtoMessage() {} |
|
244 |
-func (*ListSnapshotsRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{13} } |
|
245 |
- |
|
246 |
-type ListSnapshotsResponse struct { |
|
247 |
- Info []Info `protobuf:"bytes,1,rep,name=info" json:"info"` |
|
248 |
-} |
|
249 |
- |
|
250 |
-func (m *ListSnapshotsResponse) Reset() { *m = ListSnapshotsResponse{} } |
|
251 |
-func (*ListSnapshotsResponse) ProtoMessage() {} |
|
252 |
-func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{14} } |
|
253 |
- |
|
254 |
-type UsageRequest struct { |
|
255 |
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
256 |
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
257 |
-} |
|
258 |
- |
|
259 |
-func (m *UsageRequest) Reset() { *m = UsageRequest{} } |
|
260 |
-func (*UsageRequest) ProtoMessage() {} |
|
261 |
-func (*UsageRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{15} } |
|
262 |
- |
|
263 |
-type UsageResponse struct { |
|
264 |
- Size_ int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` |
|
265 |
- Inodes int64 `protobuf:"varint,2,opt,name=inodes,proto3" json:"inodes,omitempty"` |
|
266 |
-} |
|
267 |
- |
|
268 |
-func (m *UsageResponse) Reset() { *m = UsageResponse{} } |
|
269 |
-func (*UsageResponse) ProtoMessage() {} |
|
270 |
-func (*UsageResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{16} } |
|
271 |
- |
|
272 |
-func init() { |
|
273 |
- proto.RegisterType((*PrepareSnapshotRequest)(nil), "containerd.services.snapshots.v1.PrepareSnapshotRequest") |
|
274 |
- proto.RegisterType((*PrepareSnapshotResponse)(nil), "containerd.services.snapshots.v1.PrepareSnapshotResponse") |
|
275 |
- proto.RegisterType((*ViewSnapshotRequest)(nil), "containerd.services.snapshots.v1.ViewSnapshotRequest") |
|
276 |
- proto.RegisterType((*ViewSnapshotResponse)(nil), "containerd.services.snapshots.v1.ViewSnapshotResponse") |
|
277 |
- proto.RegisterType((*MountsRequest)(nil), "containerd.services.snapshots.v1.MountsRequest") |
|
278 |
- proto.RegisterType((*MountsResponse)(nil), "containerd.services.snapshots.v1.MountsResponse") |
|
279 |
- proto.RegisterType((*RemoveSnapshotRequest)(nil), "containerd.services.snapshots.v1.RemoveSnapshotRequest") |
|
280 |
- proto.RegisterType((*CommitSnapshotRequest)(nil), "containerd.services.snapshots.v1.CommitSnapshotRequest") |
|
281 |
- proto.RegisterType((*StatSnapshotRequest)(nil), "containerd.services.snapshots.v1.StatSnapshotRequest") |
|
282 |
- proto.RegisterType((*Info)(nil), "containerd.services.snapshots.v1.Info") |
|
283 |
- proto.RegisterType((*StatSnapshotResponse)(nil), "containerd.services.snapshots.v1.StatSnapshotResponse") |
|
284 |
- proto.RegisterType((*UpdateSnapshotRequest)(nil), "containerd.services.snapshots.v1.UpdateSnapshotRequest") |
|
285 |
- proto.RegisterType((*UpdateSnapshotResponse)(nil), "containerd.services.snapshots.v1.UpdateSnapshotResponse") |
|
286 |
- proto.RegisterType((*ListSnapshotsRequest)(nil), "containerd.services.snapshots.v1.ListSnapshotsRequest") |
|
287 |
- proto.RegisterType((*ListSnapshotsResponse)(nil), "containerd.services.snapshots.v1.ListSnapshotsResponse") |
|
288 |
- proto.RegisterType((*UsageRequest)(nil), "containerd.services.snapshots.v1.UsageRequest") |
|
289 |
- proto.RegisterType((*UsageResponse)(nil), "containerd.services.snapshots.v1.UsageResponse") |
|
290 |
- proto.RegisterEnum("containerd.services.snapshots.v1.Kind", Kind_name, Kind_value) |
|
291 |
-} |
|
292 |
- |
|
293 |
-// Reference imports to suppress errors if they are not otherwise used. |
|
294 |
-var _ context.Context |
|
295 |
-var _ grpc.ClientConn |
|
296 |
- |
|
297 |
-// This is a compile-time assertion to ensure that this generated file |
|
298 |
-// is compatible with the grpc package it is being compiled against. |
|
299 |
-const _ = grpc.SupportPackageIsVersion4 |
|
300 |
- |
|
301 |
-// Client API for Snapshots service |
|
302 |
- |
|
303 |
-type SnapshotsClient interface { |
|
304 |
- Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) |
|
305 |
- View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) |
|
306 |
- Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) |
|
307 |
- Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) |
|
308 |
- Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) |
|
309 |
- Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) |
|
310 |
- Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) |
|
311 |
- List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) |
|
312 |
- Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) |
|
313 |
-} |
|
314 |
- |
|
315 |
-type snapshotsClient struct { |
|
316 |
- cc *grpc.ClientConn |
|
317 |
-} |
|
318 |
- |
|
319 |
-func NewSnapshotsClient(cc *grpc.ClientConn) SnapshotsClient { |
|
320 |
- return &snapshotsClient{cc} |
|
321 |
-} |
|
322 |
- |
|
323 |
-func (c *snapshotsClient) Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) { |
|
324 |
- out := new(PrepareSnapshotResponse) |
|
325 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Prepare", in, out, c.cc, opts...) |
|
326 |
- if err != nil { |
|
327 |
- return nil, err |
|
328 |
- } |
|
329 |
- return out, nil |
|
330 |
-} |
|
331 |
- |
|
332 |
-func (c *snapshotsClient) View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) { |
|
333 |
- out := new(ViewSnapshotResponse) |
|
334 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/View", in, out, c.cc, opts...) |
|
335 |
- if err != nil { |
|
336 |
- return nil, err |
|
337 |
- } |
|
338 |
- return out, nil |
|
339 |
-} |
|
340 |
- |
|
341 |
-func (c *snapshotsClient) Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) { |
|
342 |
- out := new(MountsResponse) |
|
343 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Mounts", in, out, c.cc, opts...) |
|
344 |
- if err != nil { |
|
345 |
- return nil, err |
|
346 |
- } |
|
347 |
- return out, nil |
|
348 |
-} |
|
349 |
- |
|
350 |
-func (c *snapshotsClient) Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { |
|
351 |
- out := new(google_protobuf1.Empty) |
|
352 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Commit", in, out, c.cc, opts...) |
|
353 |
- if err != nil { |
|
354 |
- return nil, err |
|
355 |
- } |
|
356 |
- return out, nil |
|
357 |
-} |
|
358 |
- |
|
359 |
-func (c *snapshotsClient) Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { |
|
360 |
- out := new(google_protobuf1.Empty) |
|
361 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Remove", in, out, c.cc, opts...) |
|
362 |
- if err != nil { |
|
363 |
- return nil, err |
|
364 |
- } |
|
365 |
- return out, nil |
|
366 |
-} |
|
367 |
- |
|
368 |
-func (c *snapshotsClient) Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) { |
|
369 |
- out := new(StatSnapshotResponse) |
|
370 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Stat", in, out, c.cc, opts...) |
|
371 |
- if err != nil { |
|
372 |
- return nil, err |
|
373 |
- } |
|
374 |
- return out, nil |
|
375 |
-} |
|
376 |
- |
|
377 |
-func (c *snapshotsClient) Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) { |
|
378 |
- out := new(UpdateSnapshotResponse) |
|
379 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Update", in, out, c.cc, opts...) |
|
380 |
- if err != nil { |
|
381 |
- return nil, err |
|
382 |
- } |
|
383 |
- return out, nil |
|
384 |
-} |
|
385 |
- |
|
386 |
-func (c *snapshotsClient) List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) { |
|
387 |
- stream, err := grpc.NewClientStream(ctx, &_Snapshots_serviceDesc.Streams[0], c.cc, "/containerd.services.snapshots.v1.Snapshots/List", opts...) |
|
388 |
- if err != nil { |
|
389 |
- return nil, err |
|
390 |
- } |
|
391 |
- x := &snapshotsListClient{stream} |
|
392 |
- if err := x.ClientStream.SendMsg(in); err != nil { |
|
393 |
- return nil, err |
|
394 |
- } |
|
395 |
- if err := x.ClientStream.CloseSend(); err != nil { |
|
396 |
- return nil, err |
|
397 |
- } |
|
398 |
- return x, nil |
|
399 |
-} |
|
400 |
- |
|
401 |
-type Snapshots_ListClient interface { |
|
402 |
- Recv() (*ListSnapshotsResponse, error) |
|
403 |
- grpc.ClientStream |
|
404 |
-} |
|
405 |
- |
|
406 |
-type snapshotsListClient struct { |
|
407 |
- grpc.ClientStream |
|
408 |
-} |
|
409 |
- |
|
410 |
-func (x *snapshotsListClient) Recv() (*ListSnapshotsResponse, error) { |
|
411 |
- m := new(ListSnapshotsResponse) |
|
412 |
- if err := x.ClientStream.RecvMsg(m); err != nil { |
|
413 |
- return nil, err |
|
414 |
- } |
|
415 |
- return m, nil |
|
416 |
-} |
|
417 |
- |
|
418 |
-func (c *snapshotsClient) Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) { |
|
419 |
- out := new(UsageResponse) |
|
420 |
- err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Usage", in, out, c.cc, opts...) |
|
421 |
- if err != nil { |
|
422 |
- return nil, err |
|
423 |
- } |
|
424 |
- return out, nil |
|
425 |
-} |
|
426 |
- |
|
427 |
-// Server API for Snapshots service |
|
428 |
- |
|
429 |
-type SnapshotsServer interface { |
|
430 |
- Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) |
|
431 |
- View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error) |
|
432 |
- Mounts(context.Context, *MountsRequest) (*MountsResponse, error) |
|
433 |
- Commit(context.Context, *CommitSnapshotRequest) (*google_protobuf1.Empty, error) |
|
434 |
- Remove(context.Context, *RemoveSnapshotRequest) (*google_protobuf1.Empty, error) |
|
435 |
- Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error) |
|
436 |
- Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) |
|
437 |
- List(*ListSnapshotsRequest, Snapshots_ListServer) error |
|
438 |
- Usage(context.Context, *UsageRequest) (*UsageResponse, error) |
|
439 |
-} |
|
440 |
- |
|
441 |
-func RegisterSnapshotsServer(s *grpc.Server, srv SnapshotsServer) { |
|
442 |
- s.RegisterService(&_Snapshots_serviceDesc, srv) |
|
443 |
-} |
|
444 |
- |
|
445 |
-func _Snapshots_Prepare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
446 |
- in := new(PrepareSnapshotRequest) |
|
447 |
- if err := dec(in); err != nil { |
|
448 |
- return nil, err |
|
449 |
- } |
|
450 |
- if interceptor == nil { |
|
451 |
- return srv.(SnapshotsServer).Prepare(ctx, in) |
|
452 |
- } |
|
453 |
- info := &grpc.UnaryServerInfo{ |
|
454 |
- Server: srv, |
|
455 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Prepare", |
|
456 |
- } |
|
457 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
458 |
- return srv.(SnapshotsServer).Prepare(ctx, req.(*PrepareSnapshotRequest)) |
|
459 |
- } |
|
460 |
- return interceptor(ctx, in, info, handler) |
|
461 |
-} |
|
462 |
- |
|
463 |
-func _Snapshots_View_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
464 |
- in := new(ViewSnapshotRequest) |
|
465 |
- if err := dec(in); err != nil { |
|
466 |
- return nil, err |
|
467 |
- } |
|
468 |
- if interceptor == nil { |
|
469 |
- return srv.(SnapshotsServer).View(ctx, in) |
|
470 |
- } |
|
471 |
- info := &grpc.UnaryServerInfo{ |
|
472 |
- Server: srv, |
|
473 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/View", |
|
474 |
- } |
|
475 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
476 |
- return srv.(SnapshotsServer).View(ctx, req.(*ViewSnapshotRequest)) |
|
477 |
- } |
|
478 |
- return interceptor(ctx, in, info, handler) |
|
479 |
-} |
|
480 |
- |
|
481 |
-func _Snapshots_Mounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
482 |
- in := new(MountsRequest) |
|
483 |
- if err := dec(in); err != nil { |
|
484 |
- return nil, err |
|
485 |
- } |
|
486 |
- if interceptor == nil { |
|
487 |
- return srv.(SnapshotsServer).Mounts(ctx, in) |
|
488 |
- } |
|
489 |
- info := &grpc.UnaryServerInfo{ |
|
490 |
- Server: srv, |
|
491 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Mounts", |
|
492 |
- } |
|
493 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
494 |
- return srv.(SnapshotsServer).Mounts(ctx, req.(*MountsRequest)) |
|
495 |
- } |
|
496 |
- return interceptor(ctx, in, info, handler) |
|
497 |
-} |
|
498 |
- |
|
499 |
-func _Snapshots_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
500 |
- in := new(CommitSnapshotRequest) |
|
501 |
- if err := dec(in); err != nil { |
|
502 |
- return nil, err |
|
503 |
- } |
|
504 |
- if interceptor == nil { |
|
505 |
- return srv.(SnapshotsServer).Commit(ctx, in) |
|
506 |
- } |
|
507 |
- info := &grpc.UnaryServerInfo{ |
|
508 |
- Server: srv, |
|
509 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Commit", |
|
510 |
- } |
|
511 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
512 |
- return srv.(SnapshotsServer).Commit(ctx, req.(*CommitSnapshotRequest)) |
|
513 |
- } |
|
514 |
- return interceptor(ctx, in, info, handler) |
|
515 |
-} |
|
516 |
- |
|
517 |
-func _Snapshots_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
518 |
- in := new(RemoveSnapshotRequest) |
|
519 |
- if err := dec(in); err != nil { |
|
520 |
- return nil, err |
|
521 |
- } |
|
522 |
- if interceptor == nil { |
|
523 |
- return srv.(SnapshotsServer).Remove(ctx, in) |
|
524 |
- } |
|
525 |
- info := &grpc.UnaryServerInfo{ |
|
526 |
- Server: srv, |
|
527 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Remove", |
|
528 |
- } |
|
529 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
530 |
- return srv.(SnapshotsServer).Remove(ctx, req.(*RemoveSnapshotRequest)) |
|
531 |
- } |
|
532 |
- return interceptor(ctx, in, info, handler) |
|
533 |
-} |
|
534 |
- |
|
535 |
-func _Snapshots_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
536 |
- in := new(StatSnapshotRequest) |
|
537 |
- if err := dec(in); err != nil { |
|
538 |
- return nil, err |
|
539 |
- } |
|
540 |
- if interceptor == nil { |
|
541 |
- return srv.(SnapshotsServer).Stat(ctx, in) |
|
542 |
- } |
|
543 |
- info := &grpc.UnaryServerInfo{ |
|
544 |
- Server: srv, |
|
545 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Stat", |
|
546 |
- } |
|
547 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
548 |
- return srv.(SnapshotsServer).Stat(ctx, req.(*StatSnapshotRequest)) |
|
549 |
- } |
|
550 |
- return interceptor(ctx, in, info, handler) |
|
551 |
-} |
|
552 |
- |
|
553 |
-func _Snapshots_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
554 |
- in := new(UpdateSnapshotRequest) |
|
555 |
- if err := dec(in); err != nil { |
|
556 |
- return nil, err |
|
557 |
- } |
|
558 |
- if interceptor == nil { |
|
559 |
- return srv.(SnapshotsServer).Update(ctx, in) |
|
560 |
- } |
|
561 |
- info := &grpc.UnaryServerInfo{ |
|
562 |
- Server: srv, |
|
563 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Update", |
|
564 |
- } |
|
565 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
566 |
- return srv.(SnapshotsServer).Update(ctx, req.(*UpdateSnapshotRequest)) |
|
567 |
- } |
|
568 |
- return interceptor(ctx, in, info, handler) |
|
569 |
-} |
|
570 |
- |
|
571 |
-func _Snapshots_List_Handler(srv interface{}, stream grpc.ServerStream) error { |
|
572 |
- m := new(ListSnapshotsRequest) |
|
573 |
- if err := stream.RecvMsg(m); err != nil { |
|
574 |
- return err |
|
575 |
- } |
|
576 |
- return srv.(SnapshotsServer).List(m, &snapshotsListServer{stream}) |
|
577 |
-} |
|
578 |
- |
|
579 |
-type Snapshots_ListServer interface { |
|
580 |
- Send(*ListSnapshotsResponse) error |
|
581 |
- grpc.ServerStream |
|
582 |
-} |
|
583 |
- |
|
584 |
-type snapshotsListServer struct { |
|
585 |
- grpc.ServerStream |
|
586 |
-} |
|
587 |
- |
|
588 |
-func (x *snapshotsListServer) Send(m *ListSnapshotsResponse) error { |
|
589 |
- return x.ServerStream.SendMsg(m) |
|
590 |
-} |
|
591 |
- |
|
592 |
-func _Snapshots_Usage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
593 |
- in := new(UsageRequest) |
|
594 |
- if err := dec(in); err != nil { |
|
595 |
- return nil, err |
|
596 |
- } |
|
597 |
- if interceptor == nil { |
|
598 |
- return srv.(SnapshotsServer).Usage(ctx, in) |
|
599 |
- } |
|
600 |
- info := &grpc.UnaryServerInfo{ |
|
601 |
- Server: srv, |
|
602 |
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Usage", |
|
603 |
- } |
|
604 |
- handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
605 |
- return srv.(SnapshotsServer).Usage(ctx, req.(*UsageRequest)) |
|
606 |
- } |
|
607 |
- return interceptor(ctx, in, info, handler) |
|
608 |
-} |
|
609 |
- |
|
610 |
-var _Snapshots_serviceDesc = grpc.ServiceDesc{ |
|
611 |
- ServiceName: "containerd.services.snapshots.v1.Snapshots", |
|
612 |
- HandlerType: (*SnapshotsServer)(nil), |
|
613 |
- Methods: []grpc.MethodDesc{ |
|
614 |
- { |
|
615 |
- MethodName: "Prepare", |
|
616 |
- Handler: _Snapshots_Prepare_Handler, |
|
617 |
- }, |
|
618 |
- { |
|
619 |
- MethodName: "View", |
|
620 |
- Handler: _Snapshots_View_Handler, |
|
621 |
- }, |
|
622 |
- { |
|
623 |
- MethodName: "Mounts", |
|
624 |
- Handler: _Snapshots_Mounts_Handler, |
|
625 |
- }, |
|
626 |
- { |
|
627 |
- MethodName: "Commit", |
|
628 |
- Handler: _Snapshots_Commit_Handler, |
|
629 |
- }, |
|
630 |
- { |
|
631 |
- MethodName: "Remove", |
|
632 |
- Handler: _Snapshots_Remove_Handler, |
|
633 |
- }, |
|
634 |
- { |
|
635 |
- MethodName: "Stat", |
|
636 |
- Handler: _Snapshots_Stat_Handler, |
|
637 |
- }, |
|
638 |
- { |
|
639 |
- MethodName: "Update", |
|
640 |
- Handler: _Snapshots_Update_Handler, |
|
641 |
- }, |
|
642 |
- { |
|
643 |
- MethodName: "Usage", |
|
644 |
- Handler: _Snapshots_Usage_Handler, |
|
645 |
- }, |
|
646 |
- }, |
|
647 |
- Streams: []grpc.StreamDesc{ |
|
648 |
- { |
|
649 |
- StreamName: "List", |
|
650 |
- Handler: _Snapshots_List_Handler, |
|
651 |
- ServerStreams: true, |
|
652 |
- }, |
|
653 |
- }, |
|
654 |
- Metadata: "github.com/containerd/containerd/api/services/snapshot/v1/snapshots.proto", |
|
655 |
-} |
|
656 |
- |
|
657 |
-func (m *PrepareSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
658 |
- size := m.Size() |
|
659 |
- dAtA = make([]byte, size) |
|
660 |
- n, err := m.MarshalTo(dAtA) |
|
661 |
- if err != nil { |
|
662 |
- return nil, err |
|
663 |
- } |
|
664 |
- return dAtA[:n], nil |
|
665 |
-} |
|
666 |
- |
|
667 |
-func (m *PrepareSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
668 |
- var i int |
|
669 |
- _ = i |
|
670 |
- var l int |
|
671 |
- _ = l |
|
672 |
- if len(m.Snapshotter) > 0 { |
|
673 |
- dAtA[i] = 0xa |
|
674 |
- i++ |
|
675 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
676 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
677 |
- } |
|
678 |
- if len(m.Key) > 0 { |
|
679 |
- dAtA[i] = 0x12 |
|
680 |
- i++ |
|
681 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
682 |
- i += copy(dAtA[i:], m.Key) |
|
683 |
- } |
|
684 |
- if len(m.Parent) > 0 { |
|
685 |
- dAtA[i] = 0x1a |
|
686 |
- i++ |
|
687 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) |
|
688 |
- i += copy(dAtA[i:], m.Parent) |
|
689 |
- } |
|
690 |
- if len(m.Labels) > 0 { |
|
691 |
- for k, _ := range m.Labels { |
|
692 |
- dAtA[i] = 0x22 |
|
693 |
- i++ |
|
694 |
- v := m.Labels[k] |
|
695 |
- mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
696 |
- i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
697 |
- dAtA[i] = 0xa |
|
698 |
- i++ |
|
699 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
700 |
- i += copy(dAtA[i:], k) |
|
701 |
- dAtA[i] = 0x12 |
|
702 |
- i++ |
|
703 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
704 |
- i += copy(dAtA[i:], v) |
|
705 |
- } |
|
706 |
- } |
|
707 |
- return i, nil |
|
708 |
-} |
|
709 |
- |
|
710 |
-func (m *PrepareSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
711 |
- size := m.Size() |
|
712 |
- dAtA = make([]byte, size) |
|
713 |
- n, err := m.MarshalTo(dAtA) |
|
714 |
- if err != nil { |
|
715 |
- return nil, err |
|
716 |
- } |
|
717 |
- return dAtA[:n], nil |
|
718 |
-} |
|
719 |
- |
|
720 |
-func (m *PrepareSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
721 |
- var i int |
|
722 |
- _ = i |
|
723 |
- var l int |
|
724 |
- _ = l |
|
725 |
- if len(m.Mounts) > 0 { |
|
726 |
- for _, msg := range m.Mounts { |
|
727 |
- dAtA[i] = 0xa |
|
728 |
- i++ |
|
729 |
- i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
730 |
- n, err := msg.MarshalTo(dAtA[i:]) |
|
731 |
- if err != nil { |
|
732 |
- return 0, err |
|
733 |
- } |
|
734 |
- i += n |
|
735 |
- } |
|
736 |
- } |
|
737 |
- return i, nil |
|
738 |
-} |
|
739 |
- |
|
740 |
-func (m *ViewSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
741 |
- size := m.Size() |
|
742 |
- dAtA = make([]byte, size) |
|
743 |
- n, err := m.MarshalTo(dAtA) |
|
744 |
- if err != nil { |
|
745 |
- return nil, err |
|
746 |
- } |
|
747 |
- return dAtA[:n], nil |
|
748 |
-} |
|
749 |
- |
|
750 |
-func (m *ViewSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
751 |
- var i int |
|
752 |
- _ = i |
|
753 |
- var l int |
|
754 |
- _ = l |
|
755 |
- if len(m.Snapshotter) > 0 { |
|
756 |
- dAtA[i] = 0xa |
|
757 |
- i++ |
|
758 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
759 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
760 |
- } |
|
761 |
- if len(m.Key) > 0 { |
|
762 |
- dAtA[i] = 0x12 |
|
763 |
- i++ |
|
764 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
765 |
- i += copy(dAtA[i:], m.Key) |
|
766 |
- } |
|
767 |
- if len(m.Parent) > 0 { |
|
768 |
- dAtA[i] = 0x1a |
|
769 |
- i++ |
|
770 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) |
|
771 |
- i += copy(dAtA[i:], m.Parent) |
|
772 |
- } |
|
773 |
- if len(m.Labels) > 0 { |
|
774 |
- for k, _ := range m.Labels { |
|
775 |
- dAtA[i] = 0x22 |
|
776 |
- i++ |
|
777 |
- v := m.Labels[k] |
|
778 |
- mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
779 |
- i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
780 |
- dAtA[i] = 0xa |
|
781 |
- i++ |
|
782 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
783 |
- i += copy(dAtA[i:], k) |
|
784 |
- dAtA[i] = 0x12 |
|
785 |
- i++ |
|
786 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
787 |
- i += copy(dAtA[i:], v) |
|
788 |
- } |
|
789 |
- } |
|
790 |
- return i, nil |
|
791 |
-} |
|
792 |
- |
|
793 |
-func (m *ViewSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
794 |
- size := m.Size() |
|
795 |
- dAtA = make([]byte, size) |
|
796 |
- n, err := m.MarshalTo(dAtA) |
|
797 |
- if err != nil { |
|
798 |
- return nil, err |
|
799 |
- } |
|
800 |
- return dAtA[:n], nil |
|
801 |
-} |
|
802 |
- |
|
803 |
-func (m *ViewSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
804 |
- var i int |
|
805 |
- _ = i |
|
806 |
- var l int |
|
807 |
- _ = l |
|
808 |
- if len(m.Mounts) > 0 { |
|
809 |
- for _, msg := range m.Mounts { |
|
810 |
- dAtA[i] = 0xa |
|
811 |
- i++ |
|
812 |
- i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
813 |
- n, err := msg.MarshalTo(dAtA[i:]) |
|
814 |
- if err != nil { |
|
815 |
- return 0, err |
|
816 |
- } |
|
817 |
- i += n |
|
818 |
- } |
|
819 |
- } |
|
820 |
- return i, nil |
|
821 |
-} |
|
822 |
- |
|
823 |
-func (m *MountsRequest) Marshal() (dAtA []byte, err error) { |
|
824 |
- size := m.Size() |
|
825 |
- dAtA = make([]byte, size) |
|
826 |
- n, err := m.MarshalTo(dAtA) |
|
827 |
- if err != nil { |
|
828 |
- return nil, err |
|
829 |
- } |
|
830 |
- return dAtA[:n], nil |
|
831 |
-} |
|
832 |
- |
|
833 |
-func (m *MountsRequest) MarshalTo(dAtA []byte) (int, error) { |
|
834 |
- var i int |
|
835 |
- _ = i |
|
836 |
- var l int |
|
837 |
- _ = l |
|
838 |
- if len(m.Snapshotter) > 0 { |
|
839 |
- dAtA[i] = 0xa |
|
840 |
- i++ |
|
841 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
842 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
843 |
- } |
|
844 |
- if len(m.Key) > 0 { |
|
845 |
- dAtA[i] = 0x12 |
|
846 |
- i++ |
|
847 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
848 |
- i += copy(dAtA[i:], m.Key) |
|
849 |
- } |
|
850 |
- return i, nil |
|
851 |
-} |
|
852 |
- |
|
853 |
-func (m *MountsResponse) Marshal() (dAtA []byte, err error) { |
|
854 |
- size := m.Size() |
|
855 |
- dAtA = make([]byte, size) |
|
856 |
- n, err := m.MarshalTo(dAtA) |
|
857 |
- if err != nil { |
|
858 |
- return nil, err |
|
859 |
- } |
|
860 |
- return dAtA[:n], nil |
|
861 |
-} |
|
862 |
- |
|
863 |
-func (m *MountsResponse) MarshalTo(dAtA []byte) (int, error) { |
|
864 |
- var i int |
|
865 |
- _ = i |
|
866 |
- var l int |
|
867 |
- _ = l |
|
868 |
- if len(m.Mounts) > 0 { |
|
869 |
- for _, msg := range m.Mounts { |
|
870 |
- dAtA[i] = 0xa |
|
871 |
- i++ |
|
872 |
- i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
873 |
- n, err := msg.MarshalTo(dAtA[i:]) |
|
874 |
- if err != nil { |
|
875 |
- return 0, err |
|
876 |
- } |
|
877 |
- i += n |
|
878 |
- } |
|
879 |
- } |
|
880 |
- return i, nil |
|
881 |
-} |
|
882 |
- |
|
883 |
-func (m *RemoveSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
884 |
- size := m.Size() |
|
885 |
- dAtA = make([]byte, size) |
|
886 |
- n, err := m.MarshalTo(dAtA) |
|
887 |
- if err != nil { |
|
888 |
- return nil, err |
|
889 |
- } |
|
890 |
- return dAtA[:n], nil |
|
891 |
-} |
|
892 |
- |
|
893 |
-func (m *RemoveSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
894 |
- var i int |
|
895 |
- _ = i |
|
896 |
- var l int |
|
897 |
- _ = l |
|
898 |
- if len(m.Snapshotter) > 0 { |
|
899 |
- dAtA[i] = 0xa |
|
900 |
- i++ |
|
901 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
902 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
903 |
- } |
|
904 |
- if len(m.Key) > 0 { |
|
905 |
- dAtA[i] = 0x12 |
|
906 |
- i++ |
|
907 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
908 |
- i += copy(dAtA[i:], m.Key) |
|
909 |
- } |
|
910 |
- return i, nil |
|
911 |
-} |
|
912 |
- |
|
913 |
-func (m *CommitSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
914 |
- size := m.Size() |
|
915 |
- dAtA = make([]byte, size) |
|
916 |
- n, err := m.MarshalTo(dAtA) |
|
917 |
- if err != nil { |
|
918 |
- return nil, err |
|
919 |
- } |
|
920 |
- return dAtA[:n], nil |
|
921 |
-} |
|
922 |
- |
|
923 |
-func (m *CommitSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
924 |
- var i int |
|
925 |
- _ = i |
|
926 |
- var l int |
|
927 |
- _ = l |
|
928 |
- if len(m.Snapshotter) > 0 { |
|
929 |
- dAtA[i] = 0xa |
|
930 |
- i++ |
|
931 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
932 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
933 |
- } |
|
934 |
- if len(m.Name) > 0 { |
|
935 |
- dAtA[i] = 0x12 |
|
936 |
- i++ |
|
937 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name))) |
|
938 |
- i += copy(dAtA[i:], m.Name) |
|
939 |
- } |
|
940 |
- if len(m.Key) > 0 { |
|
941 |
- dAtA[i] = 0x1a |
|
942 |
- i++ |
|
943 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
944 |
- i += copy(dAtA[i:], m.Key) |
|
945 |
- } |
|
946 |
- if len(m.Labels) > 0 { |
|
947 |
- for k, _ := range m.Labels { |
|
948 |
- dAtA[i] = 0x22 |
|
949 |
- i++ |
|
950 |
- v := m.Labels[k] |
|
951 |
- mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
952 |
- i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
953 |
- dAtA[i] = 0xa |
|
954 |
- i++ |
|
955 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
956 |
- i += copy(dAtA[i:], k) |
|
957 |
- dAtA[i] = 0x12 |
|
958 |
- i++ |
|
959 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
960 |
- i += copy(dAtA[i:], v) |
|
961 |
- } |
|
962 |
- } |
|
963 |
- return i, nil |
|
964 |
-} |
|
965 |
- |
|
966 |
-func (m *StatSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
967 |
- size := m.Size() |
|
968 |
- dAtA = make([]byte, size) |
|
969 |
- n, err := m.MarshalTo(dAtA) |
|
970 |
- if err != nil { |
|
971 |
- return nil, err |
|
972 |
- } |
|
973 |
- return dAtA[:n], nil |
|
974 |
-} |
|
975 |
- |
|
976 |
-func (m *StatSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
977 |
- var i int |
|
978 |
- _ = i |
|
979 |
- var l int |
|
980 |
- _ = l |
|
981 |
- if len(m.Snapshotter) > 0 { |
|
982 |
- dAtA[i] = 0xa |
|
983 |
- i++ |
|
984 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
985 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
986 |
- } |
|
987 |
- if len(m.Key) > 0 { |
|
988 |
- dAtA[i] = 0x12 |
|
989 |
- i++ |
|
990 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
991 |
- i += copy(dAtA[i:], m.Key) |
|
992 |
- } |
|
993 |
- return i, nil |
|
994 |
-} |
|
995 |
- |
|
996 |
-func (m *Info) Marshal() (dAtA []byte, err error) { |
|
997 |
- size := m.Size() |
|
998 |
- dAtA = make([]byte, size) |
|
999 |
- n, err := m.MarshalTo(dAtA) |
|
1000 |
- if err != nil { |
|
1001 |
- return nil, err |
|
1002 |
- } |
|
1003 |
- return dAtA[:n], nil |
|
1004 |
-} |
|
1005 |
- |
|
1006 |
-func (m *Info) MarshalTo(dAtA []byte) (int, error) { |
|
1007 |
- var i int |
|
1008 |
- _ = i |
|
1009 |
- var l int |
|
1010 |
- _ = l |
|
1011 |
- if len(m.Name) > 0 { |
|
1012 |
- dAtA[i] = 0xa |
|
1013 |
- i++ |
|
1014 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name))) |
|
1015 |
- i += copy(dAtA[i:], m.Name) |
|
1016 |
- } |
|
1017 |
- if len(m.Parent) > 0 { |
|
1018 |
- dAtA[i] = 0x12 |
|
1019 |
- i++ |
|
1020 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) |
|
1021 |
- i += copy(dAtA[i:], m.Parent) |
|
1022 |
- } |
|
1023 |
- if m.Kind != 0 { |
|
1024 |
- dAtA[i] = 0x18 |
|
1025 |
- i++ |
|
1026 |
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Kind)) |
|
1027 |
- } |
|
1028 |
- dAtA[i] = 0x22 |
|
1029 |
- i++ |
|
1030 |
- i = encodeVarintSnapshots(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) |
|
1031 |
- n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) |
|
1032 |
- if err != nil { |
|
1033 |
- return 0, err |
|
1034 |
- } |
|
1035 |
- i += n1 |
|
1036 |
- dAtA[i] = 0x2a |
|
1037 |
- i++ |
|
1038 |
- i = encodeVarintSnapshots(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt))) |
|
1039 |
- n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i:]) |
|
1040 |
- if err != nil { |
|
1041 |
- return 0, err |
|
1042 |
- } |
|
1043 |
- i += n2 |
|
1044 |
- if len(m.Labels) > 0 { |
|
1045 |
- for k, _ := range m.Labels { |
|
1046 |
- dAtA[i] = 0x32 |
|
1047 |
- i++ |
|
1048 |
- v := m.Labels[k] |
|
1049 |
- mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1050 |
- i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
1051 |
- dAtA[i] = 0xa |
|
1052 |
- i++ |
|
1053 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
1054 |
- i += copy(dAtA[i:], k) |
|
1055 |
- dAtA[i] = 0x12 |
|
1056 |
- i++ |
|
1057 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
1058 |
- i += copy(dAtA[i:], v) |
|
1059 |
- } |
|
1060 |
- } |
|
1061 |
- return i, nil |
|
1062 |
-} |
|
1063 |
- |
|
1064 |
-func (m *StatSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
1065 |
- size := m.Size() |
|
1066 |
- dAtA = make([]byte, size) |
|
1067 |
- n, err := m.MarshalTo(dAtA) |
|
1068 |
- if err != nil { |
|
1069 |
- return nil, err |
|
1070 |
- } |
|
1071 |
- return dAtA[:n], nil |
|
1072 |
-} |
|
1073 |
- |
|
1074 |
-func (m *StatSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1075 |
- var i int |
|
1076 |
- _ = i |
|
1077 |
- var l int |
|
1078 |
- _ = l |
|
1079 |
- dAtA[i] = 0xa |
|
1080 |
- i++ |
|
1081 |
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Info.Size())) |
|
1082 |
- n3, err := m.Info.MarshalTo(dAtA[i:]) |
|
1083 |
- if err != nil { |
|
1084 |
- return 0, err |
|
1085 |
- } |
|
1086 |
- i += n3 |
|
1087 |
- return i, nil |
|
1088 |
-} |
|
1089 |
- |
|
1090 |
-func (m *UpdateSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
1091 |
- size := m.Size() |
|
1092 |
- dAtA = make([]byte, size) |
|
1093 |
- n, err := m.MarshalTo(dAtA) |
|
1094 |
- if err != nil { |
|
1095 |
- return nil, err |
|
1096 |
- } |
|
1097 |
- return dAtA[:n], nil |
|
1098 |
-} |
|
1099 |
- |
|
1100 |
-func (m *UpdateSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
1101 |
- var i int |
|
1102 |
- _ = i |
|
1103 |
- var l int |
|
1104 |
- _ = l |
|
1105 |
- if len(m.Snapshotter) > 0 { |
|
1106 |
- dAtA[i] = 0xa |
|
1107 |
- i++ |
|
1108 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
1109 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
1110 |
- } |
|
1111 |
- dAtA[i] = 0x12 |
|
1112 |
- i++ |
|
1113 |
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Info.Size())) |
|
1114 |
- n4, err := m.Info.MarshalTo(dAtA[i:]) |
|
1115 |
- if err != nil { |
|
1116 |
- return 0, err |
|
1117 |
- } |
|
1118 |
- i += n4 |
|
1119 |
- if m.UpdateMask != nil { |
|
1120 |
- dAtA[i] = 0x1a |
|
1121 |
- i++ |
|
1122 |
- i = encodeVarintSnapshots(dAtA, i, uint64(m.UpdateMask.Size())) |
|
1123 |
- n5, err := m.UpdateMask.MarshalTo(dAtA[i:]) |
|
1124 |
- if err != nil { |
|
1125 |
- return 0, err |
|
1126 |
- } |
|
1127 |
- i += n5 |
|
1128 |
- } |
|
1129 |
- return i, nil |
|
1130 |
-} |
|
1131 |
- |
|
1132 |
-func (m *UpdateSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
1133 |
- size := m.Size() |
|
1134 |
- dAtA = make([]byte, size) |
|
1135 |
- n, err := m.MarshalTo(dAtA) |
|
1136 |
- if err != nil { |
|
1137 |
- return nil, err |
|
1138 |
- } |
|
1139 |
- return dAtA[:n], nil |
|
1140 |
-} |
|
1141 |
- |
|
1142 |
-func (m *UpdateSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1143 |
- var i int |
|
1144 |
- _ = i |
|
1145 |
- var l int |
|
1146 |
- _ = l |
|
1147 |
- dAtA[i] = 0xa |
|
1148 |
- i++ |
|
1149 |
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Info.Size())) |
|
1150 |
- n6, err := m.Info.MarshalTo(dAtA[i:]) |
|
1151 |
- if err != nil { |
|
1152 |
- return 0, err |
|
1153 |
- } |
|
1154 |
- i += n6 |
|
1155 |
- return i, nil |
|
1156 |
-} |
|
1157 |
- |
|
1158 |
-func (m *ListSnapshotsRequest) Marshal() (dAtA []byte, err error) { |
|
1159 |
- size := m.Size() |
|
1160 |
- dAtA = make([]byte, size) |
|
1161 |
- n, err := m.MarshalTo(dAtA) |
|
1162 |
- if err != nil { |
|
1163 |
- return nil, err |
|
1164 |
- } |
|
1165 |
- return dAtA[:n], nil |
|
1166 |
-} |
|
1167 |
- |
|
1168 |
-func (m *ListSnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { |
|
1169 |
- var i int |
|
1170 |
- _ = i |
|
1171 |
- var l int |
|
1172 |
- _ = l |
|
1173 |
- if len(m.Snapshotter) > 0 { |
|
1174 |
- dAtA[i] = 0xa |
|
1175 |
- i++ |
|
1176 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
1177 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
1178 |
- } |
|
1179 |
- return i, nil |
|
1180 |
-} |
|
1181 |
- |
|
1182 |
-func (m *ListSnapshotsResponse) Marshal() (dAtA []byte, err error) { |
|
1183 |
- size := m.Size() |
|
1184 |
- dAtA = make([]byte, size) |
|
1185 |
- n, err := m.MarshalTo(dAtA) |
|
1186 |
- if err != nil { |
|
1187 |
- return nil, err |
|
1188 |
- } |
|
1189 |
- return dAtA[:n], nil |
|
1190 |
-} |
|
1191 |
- |
|
1192 |
-func (m *ListSnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1193 |
- var i int |
|
1194 |
- _ = i |
|
1195 |
- var l int |
|
1196 |
- _ = l |
|
1197 |
- if len(m.Info) > 0 { |
|
1198 |
- for _, msg := range m.Info { |
|
1199 |
- dAtA[i] = 0xa |
|
1200 |
- i++ |
|
1201 |
- i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
1202 |
- n, err := msg.MarshalTo(dAtA[i:]) |
|
1203 |
- if err != nil { |
|
1204 |
- return 0, err |
|
1205 |
- } |
|
1206 |
- i += n |
|
1207 |
- } |
|
1208 |
- } |
|
1209 |
- return i, nil |
|
1210 |
-} |
|
1211 |
- |
|
1212 |
-func (m *UsageRequest) Marshal() (dAtA []byte, err error) { |
|
1213 |
- size := m.Size() |
|
1214 |
- dAtA = make([]byte, size) |
|
1215 |
- n, err := m.MarshalTo(dAtA) |
|
1216 |
- if err != nil { |
|
1217 |
- return nil, err |
|
1218 |
- } |
|
1219 |
- return dAtA[:n], nil |
|
1220 |
-} |
|
1221 |
- |
|
1222 |
-func (m *UsageRequest) MarshalTo(dAtA []byte) (int, error) { |
|
1223 |
- var i int |
|
1224 |
- _ = i |
|
1225 |
- var l int |
|
1226 |
- _ = l |
|
1227 |
- if len(m.Snapshotter) > 0 { |
|
1228 |
- dAtA[i] = 0xa |
|
1229 |
- i++ |
|
1230 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
1231 |
- i += copy(dAtA[i:], m.Snapshotter) |
|
1232 |
- } |
|
1233 |
- if len(m.Key) > 0 { |
|
1234 |
- dAtA[i] = 0x12 |
|
1235 |
- i++ |
|
1236 |
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
1237 |
- i += copy(dAtA[i:], m.Key) |
|
1238 |
- } |
|
1239 |
- return i, nil |
|
1240 |
-} |
|
1241 |
- |
|
1242 |
-func (m *UsageResponse) Marshal() (dAtA []byte, err error) { |
|
1243 |
- size := m.Size() |
|
1244 |
- dAtA = make([]byte, size) |
|
1245 |
- n, err := m.MarshalTo(dAtA) |
|
1246 |
- if err != nil { |
|
1247 |
- return nil, err |
|
1248 |
- } |
|
1249 |
- return dAtA[:n], nil |
|
1250 |
-} |
|
1251 |
- |
|
1252 |
-func (m *UsageResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1253 |
- var i int |
|
1254 |
- _ = i |
|
1255 |
- var l int |
|
1256 |
- _ = l |
|
1257 |
- if m.Size_ != 0 { |
|
1258 |
- dAtA[i] = 0x8 |
|
1259 |
- i++ |
|
1260 |
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Size_)) |
|
1261 |
- } |
|
1262 |
- if m.Inodes != 0 { |
|
1263 |
- dAtA[i] = 0x10 |
|
1264 |
- i++ |
|
1265 |
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Inodes)) |
|
1266 |
- } |
|
1267 |
- return i, nil |
|
1268 |
-} |
|
1269 |
- |
|
1270 |
-func encodeVarintSnapshots(dAtA []byte, offset int, v uint64) int { |
|
1271 |
- for v >= 1<<7 { |
|
1272 |
- dAtA[offset] = uint8(v&0x7f | 0x80) |
|
1273 |
- v >>= 7 |
|
1274 |
- offset++ |
|
1275 |
- } |
|
1276 |
- dAtA[offset] = uint8(v) |
|
1277 |
- return offset + 1 |
|
1278 |
-} |
|
1279 |
-func (m *PrepareSnapshotRequest) Size() (n int) { |
|
1280 |
- var l int |
|
1281 |
- _ = l |
|
1282 |
- l = len(m.Snapshotter) |
|
1283 |
- if l > 0 { |
|
1284 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1285 |
- } |
|
1286 |
- l = len(m.Key) |
|
1287 |
- if l > 0 { |
|
1288 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1289 |
- } |
|
1290 |
- l = len(m.Parent) |
|
1291 |
- if l > 0 { |
|
1292 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1293 |
- } |
|
1294 |
- if len(m.Labels) > 0 { |
|
1295 |
- for k, v := range m.Labels { |
|
1296 |
- _ = k |
|
1297 |
- _ = v |
|
1298 |
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1299 |
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1300 |
- } |
|
1301 |
- } |
|
1302 |
- return n |
|
1303 |
-} |
|
1304 |
- |
|
1305 |
-func (m *PrepareSnapshotResponse) Size() (n int) { |
|
1306 |
- var l int |
|
1307 |
- _ = l |
|
1308 |
- if len(m.Mounts) > 0 { |
|
1309 |
- for _, e := range m.Mounts { |
|
1310 |
- l = e.Size() |
|
1311 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1312 |
- } |
|
1313 |
- } |
|
1314 |
- return n |
|
1315 |
-} |
|
1316 |
- |
|
1317 |
-func (m *ViewSnapshotRequest) Size() (n int) { |
|
1318 |
- var l int |
|
1319 |
- _ = l |
|
1320 |
- l = len(m.Snapshotter) |
|
1321 |
- if l > 0 { |
|
1322 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1323 |
- } |
|
1324 |
- l = len(m.Key) |
|
1325 |
- if l > 0 { |
|
1326 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1327 |
- } |
|
1328 |
- l = len(m.Parent) |
|
1329 |
- if l > 0 { |
|
1330 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1331 |
- } |
|
1332 |
- if len(m.Labels) > 0 { |
|
1333 |
- for k, v := range m.Labels { |
|
1334 |
- _ = k |
|
1335 |
- _ = v |
|
1336 |
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1337 |
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1338 |
- } |
|
1339 |
- } |
|
1340 |
- return n |
|
1341 |
-} |
|
1342 |
- |
|
1343 |
-func (m *ViewSnapshotResponse) Size() (n int) { |
|
1344 |
- var l int |
|
1345 |
- _ = l |
|
1346 |
- if len(m.Mounts) > 0 { |
|
1347 |
- for _, e := range m.Mounts { |
|
1348 |
- l = e.Size() |
|
1349 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1350 |
- } |
|
1351 |
- } |
|
1352 |
- return n |
|
1353 |
-} |
|
1354 |
- |
|
1355 |
-func (m *MountsRequest) Size() (n int) { |
|
1356 |
- var l int |
|
1357 |
- _ = l |
|
1358 |
- l = len(m.Snapshotter) |
|
1359 |
- if l > 0 { |
|
1360 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1361 |
- } |
|
1362 |
- l = len(m.Key) |
|
1363 |
- if l > 0 { |
|
1364 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1365 |
- } |
|
1366 |
- return n |
|
1367 |
-} |
|
1368 |
- |
|
1369 |
-func (m *MountsResponse) Size() (n int) { |
|
1370 |
- var l int |
|
1371 |
- _ = l |
|
1372 |
- if len(m.Mounts) > 0 { |
|
1373 |
- for _, e := range m.Mounts { |
|
1374 |
- l = e.Size() |
|
1375 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1376 |
- } |
|
1377 |
- } |
|
1378 |
- return n |
|
1379 |
-} |
|
1380 |
- |
|
1381 |
-func (m *RemoveSnapshotRequest) Size() (n int) { |
|
1382 |
- var l int |
|
1383 |
- _ = l |
|
1384 |
- l = len(m.Snapshotter) |
|
1385 |
- if l > 0 { |
|
1386 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1387 |
- } |
|
1388 |
- l = len(m.Key) |
|
1389 |
- if l > 0 { |
|
1390 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1391 |
- } |
|
1392 |
- return n |
|
1393 |
-} |
|
1394 |
- |
|
1395 |
-func (m *CommitSnapshotRequest) Size() (n int) { |
|
1396 |
- var l int |
|
1397 |
- _ = l |
|
1398 |
- l = len(m.Snapshotter) |
|
1399 |
- if l > 0 { |
|
1400 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1401 |
- } |
|
1402 |
- l = len(m.Name) |
|
1403 |
- if l > 0 { |
|
1404 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1405 |
- } |
|
1406 |
- l = len(m.Key) |
|
1407 |
- if l > 0 { |
|
1408 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1409 |
- } |
|
1410 |
- if len(m.Labels) > 0 { |
|
1411 |
- for k, v := range m.Labels { |
|
1412 |
- _ = k |
|
1413 |
- _ = v |
|
1414 |
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1415 |
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1416 |
- } |
|
1417 |
- } |
|
1418 |
- return n |
|
1419 |
-} |
|
1420 |
- |
|
1421 |
-func (m *StatSnapshotRequest) Size() (n int) { |
|
1422 |
- var l int |
|
1423 |
- _ = l |
|
1424 |
- l = len(m.Snapshotter) |
|
1425 |
- if l > 0 { |
|
1426 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1427 |
- } |
|
1428 |
- l = len(m.Key) |
|
1429 |
- if l > 0 { |
|
1430 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1431 |
- } |
|
1432 |
- return n |
|
1433 |
-} |
|
1434 |
- |
|
1435 |
-func (m *Info) Size() (n int) { |
|
1436 |
- var l int |
|
1437 |
- _ = l |
|
1438 |
- l = len(m.Name) |
|
1439 |
- if l > 0 { |
|
1440 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1441 |
- } |
|
1442 |
- l = len(m.Parent) |
|
1443 |
- if l > 0 { |
|
1444 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1445 |
- } |
|
1446 |
- if m.Kind != 0 { |
|
1447 |
- n += 1 + sovSnapshots(uint64(m.Kind)) |
|
1448 |
- } |
|
1449 |
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) |
|
1450 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1451 |
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt) |
|
1452 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1453 |
- if len(m.Labels) > 0 { |
|
1454 |
- for k, v := range m.Labels { |
|
1455 |
- _ = k |
|
1456 |
- _ = v |
|
1457 |
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1458 |
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1459 |
- } |
|
1460 |
- } |
|
1461 |
- return n |
|
1462 |
-} |
|
1463 |
- |
|
1464 |
-func (m *StatSnapshotResponse) Size() (n int) { |
|
1465 |
- var l int |
|
1466 |
- _ = l |
|
1467 |
- l = m.Info.Size() |
|
1468 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1469 |
- return n |
|
1470 |
-} |
|
1471 |
- |
|
1472 |
-func (m *UpdateSnapshotRequest) Size() (n int) { |
|
1473 |
- var l int |
|
1474 |
- _ = l |
|
1475 |
- l = len(m.Snapshotter) |
|
1476 |
- if l > 0 { |
|
1477 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1478 |
- } |
|
1479 |
- l = m.Info.Size() |
|
1480 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1481 |
- if m.UpdateMask != nil { |
|
1482 |
- l = m.UpdateMask.Size() |
|
1483 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1484 |
- } |
|
1485 |
- return n |
|
1486 |
-} |
|
1487 |
- |
|
1488 |
-func (m *UpdateSnapshotResponse) Size() (n int) { |
|
1489 |
- var l int |
|
1490 |
- _ = l |
|
1491 |
- l = m.Info.Size() |
|
1492 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1493 |
- return n |
|
1494 |
-} |
|
1495 |
- |
|
1496 |
-func (m *ListSnapshotsRequest) Size() (n int) { |
|
1497 |
- var l int |
|
1498 |
- _ = l |
|
1499 |
- l = len(m.Snapshotter) |
|
1500 |
- if l > 0 { |
|
1501 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1502 |
- } |
|
1503 |
- return n |
|
1504 |
-} |
|
1505 |
- |
|
1506 |
-func (m *ListSnapshotsResponse) Size() (n int) { |
|
1507 |
- var l int |
|
1508 |
- _ = l |
|
1509 |
- if len(m.Info) > 0 { |
|
1510 |
- for _, e := range m.Info { |
|
1511 |
- l = e.Size() |
|
1512 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1513 |
- } |
|
1514 |
- } |
|
1515 |
- return n |
|
1516 |
-} |
|
1517 |
- |
|
1518 |
-func (m *UsageRequest) Size() (n int) { |
|
1519 |
- var l int |
|
1520 |
- _ = l |
|
1521 |
- l = len(m.Snapshotter) |
|
1522 |
- if l > 0 { |
|
1523 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1524 |
- } |
|
1525 |
- l = len(m.Key) |
|
1526 |
- if l > 0 { |
|
1527 |
- n += 1 + l + sovSnapshots(uint64(l)) |
|
1528 |
- } |
|
1529 |
- return n |
|
1530 |
-} |
|
1531 |
- |
|
1532 |
-func (m *UsageResponse) Size() (n int) { |
|
1533 |
- var l int |
|
1534 |
- _ = l |
|
1535 |
- if m.Size_ != 0 { |
|
1536 |
- n += 1 + sovSnapshots(uint64(m.Size_)) |
|
1537 |
- } |
|
1538 |
- if m.Inodes != 0 { |
|
1539 |
- n += 1 + sovSnapshots(uint64(m.Inodes)) |
|
1540 |
- } |
|
1541 |
- return n |
|
1542 |
-} |
|
1543 |
- |
|
1544 |
-func sovSnapshots(x uint64) (n int) { |
|
1545 |
- for { |
|
1546 |
- n++ |
|
1547 |
- x >>= 7 |
|
1548 |
- if x == 0 { |
|
1549 |
- break |
|
1550 |
- } |
|
1551 |
- } |
|
1552 |
- return n |
|
1553 |
-} |
|
1554 |
-func sozSnapshots(x uint64) (n int) { |
|
1555 |
- return sovSnapshots(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
|
1556 |
-} |
|
1557 |
-func (this *PrepareSnapshotRequest) String() string { |
|
1558 |
- if this == nil { |
|
1559 |
- return "nil" |
|
1560 |
- } |
|
1561 |
- keysForLabels := make([]string, 0, len(this.Labels)) |
|
1562 |
- for k, _ := range this.Labels { |
|
1563 |
- keysForLabels = append(keysForLabels, k) |
|
1564 |
- } |
|
1565 |
- github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1566 |
- mapStringForLabels := "map[string]string{" |
|
1567 |
- for _, k := range keysForLabels { |
|
1568 |
- mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1569 |
- } |
|
1570 |
- mapStringForLabels += "}" |
|
1571 |
- s := strings.Join([]string{`&PrepareSnapshotRequest{`, |
|
1572 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1573 |
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1574 |
- `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, |
|
1575 |
- `Labels:` + mapStringForLabels + `,`, |
|
1576 |
- `}`, |
|
1577 |
- }, "") |
|
1578 |
- return s |
|
1579 |
-} |
|
1580 |
-func (this *PrepareSnapshotResponse) String() string { |
|
1581 |
- if this == nil { |
|
1582 |
- return "nil" |
|
1583 |
- } |
|
1584 |
- s := strings.Join([]string{`&PrepareSnapshotResponse{`, |
|
1585 |
- `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`, |
|
1586 |
- `}`, |
|
1587 |
- }, "") |
|
1588 |
- return s |
|
1589 |
-} |
|
1590 |
-func (this *ViewSnapshotRequest) String() string { |
|
1591 |
- if this == nil { |
|
1592 |
- return "nil" |
|
1593 |
- } |
|
1594 |
- keysForLabels := make([]string, 0, len(this.Labels)) |
|
1595 |
- for k, _ := range this.Labels { |
|
1596 |
- keysForLabels = append(keysForLabels, k) |
|
1597 |
- } |
|
1598 |
- github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1599 |
- mapStringForLabels := "map[string]string{" |
|
1600 |
- for _, k := range keysForLabels { |
|
1601 |
- mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1602 |
- } |
|
1603 |
- mapStringForLabels += "}" |
|
1604 |
- s := strings.Join([]string{`&ViewSnapshotRequest{`, |
|
1605 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1606 |
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1607 |
- `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, |
|
1608 |
- `Labels:` + mapStringForLabels + `,`, |
|
1609 |
- `}`, |
|
1610 |
- }, "") |
|
1611 |
- return s |
|
1612 |
-} |
|
1613 |
-func (this *ViewSnapshotResponse) String() string { |
|
1614 |
- if this == nil { |
|
1615 |
- return "nil" |
|
1616 |
- } |
|
1617 |
- s := strings.Join([]string{`&ViewSnapshotResponse{`, |
|
1618 |
- `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`, |
|
1619 |
- `}`, |
|
1620 |
- }, "") |
|
1621 |
- return s |
|
1622 |
-} |
|
1623 |
-func (this *MountsRequest) String() string { |
|
1624 |
- if this == nil { |
|
1625 |
- return "nil" |
|
1626 |
- } |
|
1627 |
- s := strings.Join([]string{`&MountsRequest{`, |
|
1628 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1629 |
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1630 |
- `}`, |
|
1631 |
- }, "") |
|
1632 |
- return s |
|
1633 |
-} |
|
1634 |
-func (this *MountsResponse) String() string { |
|
1635 |
- if this == nil { |
|
1636 |
- return "nil" |
|
1637 |
- } |
|
1638 |
- s := strings.Join([]string{`&MountsResponse{`, |
|
1639 |
- `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`, |
|
1640 |
- `}`, |
|
1641 |
- }, "") |
|
1642 |
- return s |
|
1643 |
-} |
|
1644 |
-func (this *RemoveSnapshotRequest) String() string { |
|
1645 |
- if this == nil { |
|
1646 |
- return "nil" |
|
1647 |
- } |
|
1648 |
- s := strings.Join([]string{`&RemoveSnapshotRequest{`, |
|
1649 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1650 |
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1651 |
- `}`, |
|
1652 |
- }, "") |
|
1653 |
- return s |
|
1654 |
-} |
|
1655 |
-func (this *CommitSnapshotRequest) String() string { |
|
1656 |
- if this == nil { |
|
1657 |
- return "nil" |
|
1658 |
- } |
|
1659 |
- keysForLabels := make([]string, 0, len(this.Labels)) |
|
1660 |
- for k, _ := range this.Labels { |
|
1661 |
- keysForLabels = append(keysForLabels, k) |
|
1662 |
- } |
|
1663 |
- github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1664 |
- mapStringForLabels := "map[string]string{" |
|
1665 |
- for _, k := range keysForLabels { |
|
1666 |
- mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1667 |
- } |
|
1668 |
- mapStringForLabels += "}" |
|
1669 |
- s := strings.Join([]string{`&CommitSnapshotRequest{`, |
|
1670 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1671 |
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`, |
|
1672 |
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1673 |
- `Labels:` + mapStringForLabels + `,`, |
|
1674 |
- `}`, |
|
1675 |
- }, "") |
|
1676 |
- return s |
|
1677 |
-} |
|
1678 |
-func (this *StatSnapshotRequest) String() string { |
|
1679 |
- if this == nil { |
|
1680 |
- return "nil" |
|
1681 |
- } |
|
1682 |
- s := strings.Join([]string{`&StatSnapshotRequest{`, |
|
1683 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1684 |
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1685 |
- `}`, |
|
1686 |
- }, "") |
|
1687 |
- return s |
|
1688 |
-} |
|
1689 |
-func (this *Info) String() string { |
|
1690 |
- if this == nil { |
|
1691 |
- return "nil" |
|
1692 |
- } |
|
1693 |
- keysForLabels := make([]string, 0, len(this.Labels)) |
|
1694 |
- for k, _ := range this.Labels { |
|
1695 |
- keysForLabels = append(keysForLabels, k) |
|
1696 |
- } |
|
1697 |
- github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1698 |
- mapStringForLabels := "map[string]string{" |
|
1699 |
- for _, k := range keysForLabels { |
|
1700 |
- mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1701 |
- } |
|
1702 |
- mapStringForLabels += "}" |
|
1703 |
- s := strings.Join([]string{`&Info{`, |
|
1704 |
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`, |
|
1705 |
- `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, |
|
1706 |
- `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, |
|
1707 |
- `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, |
|
1708 |
- `UpdatedAt:` + strings.Replace(strings.Replace(this.UpdatedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, |
|
1709 |
- `Labels:` + mapStringForLabels + `,`, |
|
1710 |
- `}`, |
|
1711 |
- }, "") |
|
1712 |
- return s |
|
1713 |
-} |
|
1714 |
-func (this *StatSnapshotResponse) String() string { |
|
1715 |
- if this == nil { |
|
1716 |
- return "nil" |
|
1717 |
- } |
|
1718 |
- s := strings.Join([]string{`&StatSnapshotResponse{`, |
|
1719 |
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1720 |
- `}`, |
|
1721 |
- }, "") |
|
1722 |
- return s |
|
1723 |
-} |
|
1724 |
-func (this *UpdateSnapshotRequest) String() string { |
|
1725 |
- if this == nil { |
|
1726 |
- return "nil" |
|
1727 |
- } |
|
1728 |
- s := strings.Join([]string{`&UpdateSnapshotRequest{`, |
|
1729 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1730 |
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1731 |
- `UpdateMask:` + strings.Replace(fmt.Sprintf("%v", this.UpdateMask), "FieldMask", "google_protobuf2.FieldMask", 1) + `,`, |
|
1732 |
- `}`, |
|
1733 |
- }, "") |
|
1734 |
- return s |
|
1735 |
-} |
|
1736 |
-func (this *UpdateSnapshotResponse) String() string { |
|
1737 |
- if this == nil { |
|
1738 |
- return "nil" |
|
1739 |
- } |
|
1740 |
- s := strings.Join([]string{`&UpdateSnapshotResponse{`, |
|
1741 |
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1742 |
- `}`, |
|
1743 |
- }, "") |
|
1744 |
- return s |
|
1745 |
-} |
|
1746 |
-func (this *ListSnapshotsRequest) String() string { |
|
1747 |
- if this == nil { |
|
1748 |
- return "nil" |
|
1749 |
- } |
|
1750 |
- s := strings.Join([]string{`&ListSnapshotsRequest{`, |
|
1751 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1752 |
- `}`, |
|
1753 |
- }, "") |
|
1754 |
- return s |
|
1755 |
-} |
|
1756 |
-func (this *ListSnapshotsResponse) String() string { |
|
1757 |
- if this == nil { |
|
1758 |
- return "nil" |
|
1759 |
- } |
|
1760 |
- s := strings.Join([]string{`&ListSnapshotsResponse{`, |
|
1761 |
- `Info:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Info), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1762 |
- `}`, |
|
1763 |
- }, "") |
|
1764 |
- return s |
|
1765 |
-} |
|
1766 |
-func (this *UsageRequest) String() string { |
|
1767 |
- if this == nil { |
|
1768 |
- return "nil" |
|
1769 |
- } |
|
1770 |
- s := strings.Join([]string{`&UsageRequest{`, |
|
1771 |
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1772 |
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1773 |
- `}`, |
|
1774 |
- }, "") |
|
1775 |
- return s |
|
1776 |
-} |
|
1777 |
-func (this *UsageResponse) String() string { |
|
1778 |
- if this == nil { |
|
1779 |
- return "nil" |
|
1780 |
- } |
|
1781 |
- s := strings.Join([]string{`&UsageResponse{`, |
|
1782 |
- `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, |
|
1783 |
- `Inodes:` + fmt.Sprintf("%v", this.Inodes) + `,`, |
|
1784 |
- `}`, |
|
1785 |
- }, "") |
|
1786 |
- return s |
|
1787 |
-} |
|
1788 |
-func valueToStringSnapshots(v interface{}) string { |
|
1789 |
- rv := reflect.ValueOf(v) |
|
1790 |
- if rv.IsNil() { |
|
1791 |
- return "nil" |
|
1792 |
- } |
|
1793 |
- pv := reflect.Indirect(rv).Interface() |
|
1794 |
- return fmt.Sprintf("*%v", pv) |
|
1795 |
-} |
|
1796 |
-func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
1797 |
- l := len(dAtA) |
|
1798 |
- iNdEx := 0 |
|
1799 |
- for iNdEx < l { |
|
1800 |
- preIndex := iNdEx |
|
1801 |
- var wire uint64 |
|
1802 |
- for shift := uint(0); ; shift += 7 { |
|
1803 |
- if shift >= 64 { |
|
1804 |
- return ErrIntOverflowSnapshots |
|
1805 |
- } |
|
1806 |
- if iNdEx >= l { |
|
1807 |
- return io.ErrUnexpectedEOF |
|
1808 |
- } |
|
1809 |
- b := dAtA[iNdEx] |
|
1810 |
- iNdEx++ |
|
1811 |
- wire |= (uint64(b) & 0x7F) << shift |
|
1812 |
- if b < 0x80 { |
|
1813 |
- break |
|
1814 |
- } |
|
1815 |
- } |
|
1816 |
- fieldNum := int32(wire >> 3) |
|
1817 |
- wireType := int(wire & 0x7) |
|
1818 |
- if wireType == 4 { |
|
1819 |
- return fmt.Errorf("proto: PrepareSnapshotRequest: wiretype end group for non-group") |
|
1820 |
- } |
|
1821 |
- if fieldNum <= 0 { |
|
1822 |
- return fmt.Errorf("proto: PrepareSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
1823 |
- } |
|
1824 |
- switch fieldNum { |
|
1825 |
- case 1: |
|
1826 |
- if wireType != 2 { |
|
1827 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
1828 |
- } |
|
1829 |
- var stringLen uint64 |
|
1830 |
- for shift := uint(0); ; shift += 7 { |
|
1831 |
- if shift >= 64 { |
|
1832 |
- return ErrIntOverflowSnapshots |
|
1833 |
- } |
|
1834 |
- if iNdEx >= l { |
|
1835 |
- return io.ErrUnexpectedEOF |
|
1836 |
- } |
|
1837 |
- b := dAtA[iNdEx] |
|
1838 |
- iNdEx++ |
|
1839 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
1840 |
- if b < 0x80 { |
|
1841 |
- break |
|
1842 |
- } |
|
1843 |
- } |
|
1844 |
- intStringLen := int(stringLen) |
|
1845 |
- if intStringLen < 0 { |
|
1846 |
- return ErrInvalidLengthSnapshots |
|
1847 |
- } |
|
1848 |
- postIndex := iNdEx + intStringLen |
|
1849 |
- if postIndex > l { |
|
1850 |
- return io.ErrUnexpectedEOF |
|
1851 |
- } |
|
1852 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
1853 |
- iNdEx = postIndex |
|
1854 |
- case 2: |
|
1855 |
- if wireType != 2 { |
|
1856 |
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
1857 |
- } |
|
1858 |
- var stringLen uint64 |
|
1859 |
- for shift := uint(0); ; shift += 7 { |
|
1860 |
- if shift >= 64 { |
|
1861 |
- return ErrIntOverflowSnapshots |
|
1862 |
- } |
|
1863 |
- if iNdEx >= l { |
|
1864 |
- return io.ErrUnexpectedEOF |
|
1865 |
- } |
|
1866 |
- b := dAtA[iNdEx] |
|
1867 |
- iNdEx++ |
|
1868 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
1869 |
- if b < 0x80 { |
|
1870 |
- break |
|
1871 |
- } |
|
1872 |
- } |
|
1873 |
- intStringLen := int(stringLen) |
|
1874 |
- if intStringLen < 0 { |
|
1875 |
- return ErrInvalidLengthSnapshots |
|
1876 |
- } |
|
1877 |
- postIndex := iNdEx + intStringLen |
|
1878 |
- if postIndex > l { |
|
1879 |
- return io.ErrUnexpectedEOF |
|
1880 |
- } |
|
1881 |
- m.Key = string(dAtA[iNdEx:postIndex]) |
|
1882 |
- iNdEx = postIndex |
|
1883 |
- case 3: |
|
1884 |
- if wireType != 2 { |
|
1885 |
- return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) |
|
1886 |
- } |
|
1887 |
- var stringLen uint64 |
|
1888 |
- for shift := uint(0); ; shift += 7 { |
|
1889 |
- if shift >= 64 { |
|
1890 |
- return ErrIntOverflowSnapshots |
|
1891 |
- } |
|
1892 |
- if iNdEx >= l { |
|
1893 |
- return io.ErrUnexpectedEOF |
|
1894 |
- } |
|
1895 |
- b := dAtA[iNdEx] |
|
1896 |
- iNdEx++ |
|
1897 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
1898 |
- if b < 0x80 { |
|
1899 |
- break |
|
1900 |
- } |
|
1901 |
- } |
|
1902 |
- intStringLen := int(stringLen) |
|
1903 |
- if intStringLen < 0 { |
|
1904 |
- return ErrInvalidLengthSnapshots |
|
1905 |
- } |
|
1906 |
- postIndex := iNdEx + intStringLen |
|
1907 |
- if postIndex > l { |
|
1908 |
- return io.ErrUnexpectedEOF |
|
1909 |
- } |
|
1910 |
- m.Parent = string(dAtA[iNdEx:postIndex]) |
|
1911 |
- iNdEx = postIndex |
|
1912 |
- case 4: |
|
1913 |
- if wireType != 2 { |
|
1914 |
- return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
1915 |
- } |
|
1916 |
- var msglen int |
|
1917 |
- for shift := uint(0); ; shift += 7 { |
|
1918 |
- if shift >= 64 { |
|
1919 |
- return ErrIntOverflowSnapshots |
|
1920 |
- } |
|
1921 |
- if iNdEx >= l { |
|
1922 |
- return io.ErrUnexpectedEOF |
|
1923 |
- } |
|
1924 |
- b := dAtA[iNdEx] |
|
1925 |
- iNdEx++ |
|
1926 |
- msglen |= (int(b) & 0x7F) << shift |
|
1927 |
- if b < 0x80 { |
|
1928 |
- break |
|
1929 |
- } |
|
1930 |
- } |
|
1931 |
- if msglen < 0 { |
|
1932 |
- return ErrInvalidLengthSnapshots |
|
1933 |
- } |
|
1934 |
- postIndex := iNdEx + msglen |
|
1935 |
- if postIndex > l { |
|
1936 |
- return io.ErrUnexpectedEOF |
|
1937 |
- } |
|
1938 |
- if m.Labels == nil { |
|
1939 |
- m.Labels = make(map[string]string) |
|
1940 |
- } |
|
1941 |
- var mapkey string |
|
1942 |
- var mapvalue string |
|
1943 |
- for iNdEx < postIndex { |
|
1944 |
- entryPreIndex := iNdEx |
|
1945 |
- var wire uint64 |
|
1946 |
- for shift := uint(0); ; shift += 7 { |
|
1947 |
- if shift >= 64 { |
|
1948 |
- return ErrIntOverflowSnapshots |
|
1949 |
- } |
|
1950 |
- if iNdEx >= l { |
|
1951 |
- return io.ErrUnexpectedEOF |
|
1952 |
- } |
|
1953 |
- b := dAtA[iNdEx] |
|
1954 |
- iNdEx++ |
|
1955 |
- wire |= (uint64(b) & 0x7F) << shift |
|
1956 |
- if b < 0x80 { |
|
1957 |
- break |
|
1958 |
- } |
|
1959 |
- } |
|
1960 |
- fieldNum := int32(wire >> 3) |
|
1961 |
- if fieldNum == 1 { |
|
1962 |
- var stringLenmapkey uint64 |
|
1963 |
- for shift := uint(0); ; shift += 7 { |
|
1964 |
- if shift >= 64 { |
|
1965 |
- return ErrIntOverflowSnapshots |
|
1966 |
- } |
|
1967 |
- if iNdEx >= l { |
|
1968 |
- return io.ErrUnexpectedEOF |
|
1969 |
- } |
|
1970 |
- b := dAtA[iNdEx] |
|
1971 |
- iNdEx++ |
|
1972 |
- stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
1973 |
- if b < 0x80 { |
|
1974 |
- break |
|
1975 |
- } |
|
1976 |
- } |
|
1977 |
- intStringLenmapkey := int(stringLenmapkey) |
|
1978 |
- if intStringLenmapkey < 0 { |
|
1979 |
- return ErrInvalidLengthSnapshots |
|
1980 |
- } |
|
1981 |
- postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
1982 |
- if postStringIndexmapkey > l { |
|
1983 |
- return io.ErrUnexpectedEOF |
|
1984 |
- } |
|
1985 |
- mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
1986 |
- iNdEx = postStringIndexmapkey |
|
1987 |
- } else if fieldNum == 2 { |
|
1988 |
- var stringLenmapvalue uint64 |
|
1989 |
- for shift := uint(0); ; shift += 7 { |
|
1990 |
- if shift >= 64 { |
|
1991 |
- return ErrIntOverflowSnapshots |
|
1992 |
- } |
|
1993 |
- if iNdEx >= l { |
|
1994 |
- return io.ErrUnexpectedEOF |
|
1995 |
- } |
|
1996 |
- b := dAtA[iNdEx] |
|
1997 |
- iNdEx++ |
|
1998 |
- stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
1999 |
- if b < 0x80 { |
|
2000 |
- break |
|
2001 |
- } |
|
2002 |
- } |
|
2003 |
- intStringLenmapvalue := int(stringLenmapvalue) |
|
2004 |
- if intStringLenmapvalue < 0 { |
|
2005 |
- return ErrInvalidLengthSnapshots |
|
2006 |
- } |
|
2007 |
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
2008 |
- if postStringIndexmapvalue > l { |
|
2009 |
- return io.ErrUnexpectedEOF |
|
2010 |
- } |
|
2011 |
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
2012 |
- iNdEx = postStringIndexmapvalue |
|
2013 |
- } else { |
|
2014 |
- iNdEx = entryPreIndex |
|
2015 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2016 |
- if err != nil { |
|
2017 |
- return err |
|
2018 |
- } |
|
2019 |
- if skippy < 0 { |
|
2020 |
- return ErrInvalidLengthSnapshots |
|
2021 |
- } |
|
2022 |
- if (iNdEx + skippy) > postIndex { |
|
2023 |
- return io.ErrUnexpectedEOF |
|
2024 |
- } |
|
2025 |
- iNdEx += skippy |
|
2026 |
- } |
|
2027 |
- } |
|
2028 |
- m.Labels[mapkey] = mapvalue |
|
2029 |
- iNdEx = postIndex |
|
2030 |
- default: |
|
2031 |
- iNdEx = preIndex |
|
2032 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2033 |
- if err != nil { |
|
2034 |
- return err |
|
2035 |
- } |
|
2036 |
- if skippy < 0 { |
|
2037 |
- return ErrInvalidLengthSnapshots |
|
2038 |
- } |
|
2039 |
- if (iNdEx + skippy) > l { |
|
2040 |
- return io.ErrUnexpectedEOF |
|
2041 |
- } |
|
2042 |
- iNdEx += skippy |
|
2043 |
- } |
|
2044 |
- } |
|
2045 |
- |
|
2046 |
- if iNdEx > l { |
|
2047 |
- return io.ErrUnexpectedEOF |
|
2048 |
- } |
|
2049 |
- return nil |
|
2050 |
-} |
|
2051 |
-func (m *PrepareSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
2052 |
- l := len(dAtA) |
|
2053 |
- iNdEx := 0 |
|
2054 |
- for iNdEx < l { |
|
2055 |
- preIndex := iNdEx |
|
2056 |
- var wire uint64 |
|
2057 |
- for shift := uint(0); ; shift += 7 { |
|
2058 |
- if shift >= 64 { |
|
2059 |
- return ErrIntOverflowSnapshots |
|
2060 |
- } |
|
2061 |
- if iNdEx >= l { |
|
2062 |
- return io.ErrUnexpectedEOF |
|
2063 |
- } |
|
2064 |
- b := dAtA[iNdEx] |
|
2065 |
- iNdEx++ |
|
2066 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2067 |
- if b < 0x80 { |
|
2068 |
- break |
|
2069 |
- } |
|
2070 |
- } |
|
2071 |
- fieldNum := int32(wire >> 3) |
|
2072 |
- wireType := int(wire & 0x7) |
|
2073 |
- if wireType == 4 { |
|
2074 |
- return fmt.Errorf("proto: PrepareSnapshotResponse: wiretype end group for non-group") |
|
2075 |
- } |
|
2076 |
- if fieldNum <= 0 { |
|
2077 |
- return fmt.Errorf("proto: PrepareSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2078 |
- } |
|
2079 |
- switch fieldNum { |
|
2080 |
- case 1: |
|
2081 |
- if wireType != 2 { |
|
2082 |
- return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) |
|
2083 |
- } |
|
2084 |
- var msglen int |
|
2085 |
- for shift := uint(0); ; shift += 7 { |
|
2086 |
- if shift >= 64 { |
|
2087 |
- return ErrIntOverflowSnapshots |
|
2088 |
- } |
|
2089 |
- if iNdEx >= l { |
|
2090 |
- return io.ErrUnexpectedEOF |
|
2091 |
- } |
|
2092 |
- b := dAtA[iNdEx] |
|
2093 |
- iNdEx++ |
|
2094 |
- msglen |= (int(b) & 0x7F) << shift |
|
2095 |
- if b < 0x80 { |
|
2096 |
- break |
|
2097 |
- } |
|
2098 |
- } |
|
2099 |
- if msglen < 0 { |
|
2100 |
- return ErrInvalidLengthSnapshots |
|
2101 |
- } |
|
2102 |
- postIndex := iNdEx + msglen |
|
2103 |
- if postIndex > l { |
|
2104 |
- return io.ErrUnexpectedEOF |
|
2105 |
- } |
|
2106 |
- m.Mounts = append(m.Mounts, &containerd_types.Mount{}) |
|
2107 |
- if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
2108 |
- return err |
|
2109 |
- } |
|
2110 |
- iNdEx = postIndex |
|
2111 |
- default: |
|
2112 |
- iNdEx = preIndex |
|
2113 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2114 |
- if err != nil { |
|
2115 |
- return err |
|
2116 |
- } |
|
2117 |
- if skippy < 0 { |
|
2118 |
- return ErrInvalidLengthSnapshots |
|
2119 |
- } |
|
2120 |
- if (iNdEx + skippy) > l { |
|
2121 |
- return io.ErrUnexpectedEOF |
|
2122 |
- } |
|
2123 |
- iNdEx += skippy |
|
2124 |
- } |
|
2125 |
- } |
|
2126 |
- |
|
2127 |
- if iNdEx > l { |
|
2128 |
- return io.ErrUnexpectedEOF |
|
2129 |
- } |
|
2130 |
- return nil |
|
2131 |
-} |
|
2132 |
-func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
2133 |
- l := len(dAtA) |
|
2134 |
- iNdEx := 0 |
|
2135 |
- for iNdEx < l { |
|
2136 |
- preIndex := iNdEx |
|
2137 |
- var wire uint64 |
|
2138 |
- for shift := uint(0); ; shift += 7 { |
|
2139 |
- if shift >= 64 { |
|
2140 |
- return ErrIntOverflowSnapshots |
|
2141 |
- } |
|
2142 |
- if iNdEx >= l { |
|
2143 |
- return io.ErrUnexpectedEOF |
|
2144 |
- } |
|
2145 |
- b := dAtA[iNdEx] |
|
2146 |
- iNdEx++ |
|
2147 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2148 |
- if b < 0x80 { |
|
2149 |
- break |
|
2150 |
- } |
|
2151 |
- } |
|
2152 |
- fieldNum := int32(wire >> 3) |
|
2153 |
- wireType := int(wire & 0x7) |
|
2154 |
- if wireType == 4 { |
|
2155 |
- return fmt.Errorf("proto: ViewSnapshotRequest: wiretype end group for non-group") |
|
2156 |
- } |
|
2157 |
- if fieldNum <= 0 { |
|
2158 |
- return fmt.Errorf("proto: ViewSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2159 |
- } |
|
2160 |
- switch fieldNum { |
|
2161 |
- case 1: |
|
2162 |
- if wireType != 2 { |
|
2163 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2164 |
- } |
|
2165 |
- var stringLen uint64 |
|
2166 |
- for shift := uint(0); ; shift += 7 { |
|
2167 |
- if shift >= 64 { |
|
2168 |
- return ErrIntOverflowSnapshots |
|
2169 |
- } |
|
2170 |
- if iNdEx >= l { |
|
2171 |
- return io.ErrUnexpectedEOF |
|
2172 |
- } |
|
2173 |
- b := dAtA[iNdEx] |
|
2174 |
- iNdEx++ |
|
2175 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2176 |
- if b < 0x80 { |
|
2177 |
- break |
|
2178 |
- } |
|
2179 |
- } |
|
2180 |
- intStringLen := int(stringLen) |
|
2181 |
- if intStringLen < 0 { |
|
2182 |
- return ErrInvalidLengthSnapshots |
|
2183 |
- } |
|
2184 |
- postIndex := iNdEx + intStringLen |
|
2185 |
- if postIndex > l { |
|
2186 |
- return io.ErrUnexpectedEOF |
|
2187 |
- } |
|
2188 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2189 |
- iNdEx = postIndex |
|
2190 |
- case 2: |
|
2191 |
- if wireType != 2 { |
|
2192 |
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2193 |
- } |
|
2194 |
- var stringLen uint64 |
|
2195 |
- for shift := uint(0); ; shift += 7 { |
|
2196 |
- if shift >= 64 { |
|
2197 |
- return ErrIntOverflowSnapshots |
|
2198 |
- } |
|
2199 |
- if iNdEx >= l { |
|
2200 |
- return io.ErrUnexpectedEOF |
|
2201 |
- } |
|
2202 |
- b := dAtA[iNdEx] |
|
2203 |
- iNdEx++ |
|
2204 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2205 |
- if b < 0x80 { |
|
2206 |
- break |
|
2207 |
- } |
|
2208 |
- } |
|
2209 |
- intStringLen := int(stringLen) |
|
2210 |
- if intStringLen < 0 { |
|
2211 |
- return ErrInvalidLengthSnapshots |
|
2212 |
- } |
|
2213 |
- postIndex := iNdEx + intStringLen |
|
2214 |
- if postIndex > l { |
|
2215 |
- return io.ErrUnexpectedEOF |
|
2216 |
- } |
|
2217 |
- m.Key = string(dAtA[iNdEx:postIndex]) |
|
2218 |
- iNdEx = postIndex |
|
2219 |
- case 3: |
|
2220 |
- if wireType != 2 { |
|
2221 |
- return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) |
|
2222 |
- } |
|
2223 |
- var stringLen uint64 |
|
2224 |
- for shift := uint(0); ; shift += 7 { |
|
2225 |
- if shift >= 64 { |
|
2226 |
- return ErrIntOverflowSnapshots |
|
2227 |
- } |
|
2228 |
- if iNdEx >= l { |
|
2229 |
- return io.ErrUnexpectedEOF |
|
2230 |
- } |
|
2231 |
- b := dAtA[iNdEx] |
|
2232 |
- iNdEx++ |
|
2233 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2234 |
- if b < 0x80 { |
|
2235 |
- break |
|
2236 |
- } |
|
2237 |
- } |
|
2238 |
- intStringLen := int(stringLen) |
|
2239 |
- if intStringLen < 0 { |
|
2240 |
- return ErrInvalidLengthSnapshots |
|
2241 |
- } |
|
2242 |
- postIndex := iNdEx + intStringLen |
|
2243 |
- if postIndex > l { |
|
2244 |
- return io.ErrUnexpectedEOF |
|
2245 |
- } |
|
2246 |
- m.Parent = string(dAtA[iNdEx:postIndex]) |
|
2247 |
- iNdEx = postIndex |
|
2248 |
- case 4: |
|
2249 |
- if wireType != 2 { |
|
2250 |
- return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
2251 |
- } |
|
2252 |
- var msglen int |
|
2253 |
- for shift := uint(0); ; shift += 7 { |
|
2254 |
- if shift >= 64 { |
|
2255 |
- return ErrIntOverflowSnapshots |
|
2256 |
- } |
|
2257 |
- if iNdEx >= l { |
|
2258 |
- return io.ErrUnexpectedEOF |
|
2259 |
- } |
|
2260 |
- b := dAtA[iNdEx] |
|
2261 |
- iNdEx++ |
|
2262 |
- msglen |= (int(b) & 0x7F) << shift |
|
2263 |
- if b < 0x80 { |
|
2264 |
- break |
|
2265 |
- } |
|
2266 |
- } |
|
2267 |
- if msglen < 0 { |
|
2268 |
- return ErrInvalidLengthSnapshots |
|
2269 |
- } |
|
2270 |
- postIndex := iNdEx + msglen |
|
2271 |
- if postIndex > l { |
|
2272 |
- return io.ErrUnexpectedEOF |
|
2273 |
- } |
|
2274 |
- if m.Labels == nil { |
|
2275 |
- m.Labels = make(map[string]string) |
|
2276 |
- } |
|
2277 |
- var mapkey string |
|
2278 |
- var mapvalue string |
|
2279 |
- for iNdEx < postIndex { |
|
2280 |
- entryPreIndex := iNdEx |
|
2281 |
- var wire uint64 |
|
2282 |
- for shift := uint(0); ; shift += 7 { |
|
2283 |
- if shift >= 64 { |
|
2284 |
- return ErrIntOverflowSnapshots |
|
2285 |
- } |
|
2286 |
- if iNdEx >= l { |
|
2287 |
- return io.ErrUnexpectedEOF |
|
2288 |
- } |
|
2289 |
- b := dAtA[iNdEx] |
|
2290 |
- iNdEx++ |
|
2291 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2292 |
- if b < 0x80 { |
|
2293 |
- break |
|
2294 |
- } |
|
2295 |
- } |
|
2296 |
- fieldNum := int32(wire >> 3) |
|
2297 |
- if fieldNum == 1 { |
|
2298 |
- var stringLenmapkey uint64 |
|
2299 |
- for shift := uint(0); ; shift += 7 { |
|
2300 |
- if shift >= 64 { |
|
2301 |
- return ErrIntOverflowSnapshots |
|
2302 |
- } |
|
2303 |
- if iNdEx >= l { |
|
2304 |
- return io.ErrUnexpectedEOF |
|
2305 |
- } |
|
2306 |
- b := dAtA[iNdEx] |
|
2307 |
- iNdEx++ |
|
2308 |
- stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
2309 |
- if b < 0x80 { |
|
2310 |
- break |
|
2311 |
- } |
|
2312 |
- } |
|
2313 |
- intStringLenmapkey := int(stringLenmapkey) |
|
2314 |
- if intStringLenmapkey < 0 { |
|
2315 |
- return ErrInvalidLengthSnapshots |
|
2316 |
- } |
|
2317 |
- postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
2318 |
- if postStringIndexmapkey > l { |
|
2319 |
- return io.ErrUnexpectedEOF |
|
2320 |
- } |
|
2321 |
- mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
2322 |
- iNdEx = postStringIndexmapkey |
|
2323 |
- } else if fieldNum == 2 { |
|
2324 |
- var stringLenmapvalue uint64 |
|
2325 |
- for shift := uint(0); ; shift += 7 { |
|
2326 |
- if shift >= 64 { |
|
2327 |
- return ErrIntOverflowSnapshots |
|
2328 |
- } |
|
2329 |
- if iNdEx >= l { |
|
2330 |
- return io.ErrUnexpectedEOF |
|
2331 |
- } |
|
2332 |
- b := dAtA[iNdEx] |
|
2333 |
- iNdEx++ |
|
2334 |
- stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
2335 |
- if b < 0x80 { |
|
2336 |
- break |
|
2337 |
- } |
|
2338 |
- } |
|
2339 |
- intStringLenmapvalue := int(stringLenmapvalue) |
|
2340 |
- if intStringLenmapvalue < 0 { |
|
2341 |
- return ErrInvalidLengthSnapshots |
|
2342 |
- } |
|
2343 |
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
2344 |
- if postStringIndexmapvalue > l { |
|
2345 |
- return io.ErrUnexpectedEOF |
|
2346 |
- } |
|
2347 |
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
2348 |
- iNdEx = postStringIndexmapvalue |
|
2349 |
- } else { |
|
2350 |
- iNdEx = entryPreIndex |
|
2351 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2352 |
- if err != nil { |
|
2353 |
- return err |
|
2354 |
- } |
|
2355 |
- if skippy < 0 { |
|
2356 |
- return ErrInvalidLengthSnapshots |
|
2357 |
- } |
|
2358 |
- if (iNdEx + skippy) > postIndex { |
|
2359 |
- return io.ErrUnexpectedEOF |
|
2360 |
- } |
|
2361 |
- iNdEx += skippy |
|
2362 |
- } |
|
2363 |
- } |
|
2364 |
- m.Labels[mapkey] = mapvalue |
|
2365 |
- iNdEx = postIndex |
|
2366 |
- default: |
|
2367 |
- iNdEx = preIndex |
|
2368 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2369 |
- if err != nil { |
|
2370 |
- return err |
|
2371 |
- } |
|
2372 |
- if skippy < 0 { |
|
2373 |
- return ErrInvalidLengthSnapshots |
|
2374 |
- } |
|
2375 |
- if (iNdEx + skippy) > l { |
|
2376 |
- return io.ErrUnexpectedEOF |
|
2377 |
- } |
|
2378 |
- iNdEx += skippy |
|
2379 |
- } |
|
2380 |
- } |
|
2381 |
- |
|
2382 |
- if iNdEx > l { |
|
2383 |
- return io.ErrUnexpectedEOF |
|
2384 |
- } |
|
2385 |
- return nil |
|
2386 |
-} |
|
2387 |
-func (m *ViewSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
2388 |
- l := len(dAtA) |
|
2389 |
- iNdEx := 0 |
|
2390 |
- for iNdEx < l { |
|
2391 |
- preIndex := iNdEx |
|
2392 |
- var wire uint64 |
|
2393 |
- for shift := uint(0); ; shift += 7 { |
|
2394 |
- if shift >= 64 { |
|
2395 |
- return ErrIntOverflowSnapshots |
|
2396 |
- } |
|
2397 |
- if iNdEx >= l { |
|
2398 |
- return io.ErrUnexpectedEOF |
|
2399 |
- } |
|
2400 |
- b := dAtA[iNdEx] |
|
2401 |
- iNdEx++ |
|
2402 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2403 |
- if b < 0x80 { |
|
2404 |
- break |
|
2405 |
- } |
|
2406 |
- } |
|
2407 |
- fieldNum := int32(wire >> 3) |
|
2408 |
- wireType := int(wire & 0x7) |
|
2409 |
- if wireType == 4 { |
|
2410 |
- return fmt.Errorf("proto: ViewSnapshotResponse: wiretype end group for non-group") |
|
2411 |
- } |
|
2412 |
- if fieldNum <= 0 { |
|
2413 |
- return fmt.Errorf("proto: ViewSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2414 |
- } |
|
2415 |
- switch fieldNum { |
|
2416 |
- case 1: |
|
2417 |
- if wireType != 2 { |
|
2418 |
- return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) |
|
2419 |
- } |
|
2420 |
- var msglen int |
|
2421 |
- for shift := uint(0); ; shift += 7 { |
|
2422 |
- if shift >= 64 { |
|
2423 |
- return ErrIntOverflowSnapshots |
|
2424 |
- } |
|
2425 |
- if iNdEx >= l { |
|
2426 |
- return io.ErrUnexpectedEOF |
|
2427 |
- } |
|
2428 |
- b := dAtA[iNdEx] |
|
2429 |
- iNdEx++ |
|
2430 |
- msglen |= (int(b) & 0x7F) << shift |
|
2431 |
- if b < 0x80 { |
|
2432 |
- break |
|
2433 |
- } |
|
2434 |
- } |
|
2435 |
- if msglen < 0 { |
|
2436 |
- return ErrInvalidLengthSnapshots |
|
2437 |
- } |
|
2438 |
- postIndex := iNdEx + msglen |
|
2439 |
- if postIndex > l { |
|
2440 |
- return io.ErrUnexpectedEOF |
|
2441 |
- } |
|
2442 |
- m.Mounts = append(m.Mounts, &containerd_types.Mount{}) |
|
2443 |
- if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
2444 |
- return err |
|
2445 |
- } |
|
2446 |
- iNdEx = postIndex |
|
2447 |
- default: |
|
2448 |
- iNdEx = preIndex |
|
2449 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2450 |
- if err != nil { |
|
2451 |
- return err |
|
2452 |
- } |
|
2453 |
- if skippy < 0 { |
|
2454 |
- return ErrInvalidLengthSnapshots |
|
2455 |
- } |
|
2456 |
- if (iNdEx + skippy) > l { |
|
2457 |
- return io.ErrUnexpectedEOF |
|
2458 |
- } |
|
2459 |
- iNdEx += skippy |
|
2460 |
- } |
|
2461 |
- } |
|
2462 |
- |
|
2463 |
- if iNdEx > l { |
|
2464 |
- return io.ErrUnexpectedEOF |
|
2465 |
- } |
|
2466 |
- return nil |
|
2467 |
-} |
|
2468 |
-func (m *MountsRequest) Unmarshal(dAtA []byte) error { |
|
2469 |
- l := len(dAtA) |
|
2470 |
- iNdEx := 0 |
|
2471 |
- for iNdEx < l { |
|
2472 |
- preIndex := iNdEx |
|
2473 |
- var wire uint64 |
|
2474 |
- for shift := uint(0); ; shift += 7 { |
|
2475 |
- if shift >= 64 { |
|
2476 |
- return ErrIntOverflowSnapshots |
|
2477 |
- } |
|
2478 |
- if iNdEx >= l { |
|
2479 |
- return io.ErrUnexpectedEOF |
|
2480 |
- } |
|
2481 |
- b := dAtA[iNdEx] |
|
2482 |
- iNdEx++ |
|
2483 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2484 |
- if b < 0x80 { |
|
2485 |
- break |
|
2486 |
- } |
|
2487 |
- } |
|
2488 |
- fieldNum := int32(wire >> 3) |
|
2489 |
- wireType := int(wire & 0x7) |
|
2490 |
- if wireType == 4 { |
|
2491 |
- return fmt.Errorf("proto: MountsRequest: wiretype end group for non-group") |
|
2492 |
- } |
|
2493 |
- if fieldNum <= 0 { |
|
2494 |
- return fmt.Errorf("proto: MountsRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2495 |
- } |
|
2496 |
- switch fieldNum { |
|
2497 |
- case 1: |
|
2498 |
- if wireType != 2 { |
|
2499 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2500 |
- } |
|
2501 |
- var stringLen uint64 |
|
2502 |
- for shift := uint(0); ; shift += 7 { |
|
2503 |
- if shift >= 64 { |
|
2504 |
- return ErrIntOverflowSnapshots |
|
2505 |
- } |
|
2506 |
- if iNdEx >= l { |
|
2507 |
- return io.ErrUnexpectedEOF |
|
2508 |
- } |
|
2509 |
- b := dAtA[iNdEx] |
|
2510 |
- iNdEx++ |
|
2511 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2512 |
- if b < 0x80 { |
|
2513 |
- break |
|
2514 |
- } |
|
2515 |
- } |
|
2516 |
- intStringLen := int(stringLen) |
|
2517 |
- if intStringLen < 0 { |
|
2518 |
- return ErrInvalidLengthSnapshots |
|
2519 |
- } |
|
2520 |
- postIndex := iNdEx + intStringLen |
|
2521 |
- if postIndex > l { |
|
2522 |
- return io.ErrUnexpectedEOF |
|
2523 |
- } |
|
2524 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2525 |
- iNdEx = postIndex |
|
2526 |
- case 2: |
|
2527 |
- if wireType != 2 { |
|
2528 |
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2529 |
- } |
|
2530 |
- var stringLen uint64 |
|
2531 |
- for shift := uint(0); ; shift += 7 { |
|
2532 |
- if shift >= 64 { |
|
2533 |
- return ErrIntOverflowSnapshots |
|
2534 |
- } |
|
2535 |
- if iNdEx >= l { |
|
2536 |
- return io.ErrUnexpectedEOF |
|
2537 |
- } |
|
2538 |
- b := dAtA[iNdEx] |
|
2539 |
- iNdEx++ |
|
2540 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2541 |
- if b < 0x80 { |
|
2542 |
- break |
|
2543 |
- } |
|
2544 |
- } |
|
2545 |
- intStringLen := int(stringLen) |
|
2546 |
- if intStringLen < 0 { |
|
2547 |
- return ErrInvalidLengthSnapshots |
|
2548 |
- } |
|
2549 |
- postIndex := iNdEx + intStringLen |
|
2550 |
- if postIndex > l { |
|
2551 |
- return io.ErrUnexpectedEOF |
|
2552 |
- } |
|
2553 |
- m.Key = string(dAtA[iNdEx:postIndex]) |
|
2554 |
- iNdEx = postIndex |
|
2555 |
- default: |
|
2556 |
- iNdEx = preIndex |
|
2557 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2558 |
- if err != nil { |
|
2559 |
- return err |
|
2560 |
- } |
|
2561 |
- if skippy < 0 { |
|
2562 |
- return ErrInvalidLengthSnapshots |
|
2563 |
- } |
|
2564 |
- if (iNdEx + skippy) > l { |
|
2565 |
- return io.ErrUnexpectedEOF |
|
2566 |
- } |
|
2567 |
- iNdEx += skippy |
|
2568 |
- } |
|
2569 |
- } |
|
2570 |
- |
|
2571 |
- if iNdEx > l { |
|
2572 |
- return io.ErrUnexpectedEOF |
|
2573 |
- } |
|
2574 |
- return nil |
|
2575 |
-} |
|
2576 |
-func (m *MountsResponse) Unmarshal(dAtA []byte) error { |
|
2577 |
- l := len(dAtA) |
|
2578 |
- iNdEx := 0 |
|
2579 |
- for iNdEx < l { |
|
2580 |
- preIndex := iNdEx |
|
2581 |
- var wire uint64 |
|
2582 |
- for shift := uint(0); ; shift += 7 { |
|
2583 |
- if shift >= 64 { |
|
2584 |
- return ErrIntOverflowSnapshots |
|
2585 |
- } |
|
2586 |
- if iNdEx >= l { |
|
2587 |
- return io.ErrUnexpectedEOF |
|
2588 |
- } |
|
2589 |
- b := dAtA[iNdEx] |
|
2590 |
- iNdEx++ |
|
2591 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2592 |
- if b < 0x80 { |
|
2593 |
- break |
|
2594 |
- } |
|
2595 |
- } |
|
2596 |
- fieldNum := int32(wire >> 3) |
|
2597 |
- wireType := int(wire & 0x7) |
|
2598 |
- if wireType == 4 { |
|
2599 |
- return fmt.Errorf("proto: MountsResponse: wiretype end group for non-group") |
|
2600 |
- } |
|
2601 |
- if fieldNum <= 0 { |
|
2602 |
- return fmt.Errorf("proto: MountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2603 |
- } |
|
2604 |
- switch fieldNum { |
|
2605 |
- case 1: |
|
2606 |
- if wireType != 2 { |
|
2607 |
- return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) |
|
2608 |
- } |
|
2609 |
- var msglen int |
|
2610 |
- for shift := uint(0); ; shift += 7 { |
|
2611 |
- if shift >= 64 { |
|
2612 |
- return ErrIntOverflowSnapshots |
|
2613 |
- } |
|
2614 |
- if iNdEx >= l { |
|
2615 |
- return io.ErrUnexpectedEOF |
|
2616 |
- } |
|
2617 |
- b := dAtA[iNdEx] |
|
2618 |
- iNdEx++ |
|
2619 |
- msglen |= (int(b) & 0x7F) << shift |
|
2620 |
- if b < 0x80 { |
|
2621 |
- break |
|
2622 |
- } |
|
2623 |
- } |
|
2624 |
- if msglen < 0 { |
|
2625 |
- return ErrInvalidLengthSnapshots |
|
2626 |
- } |
|
2627 |
- postIndex := iNdEx + msglen |
|
2628 |
- if postIndex > l { |
|
2629 |
- return io.ErrUnexpectedEOF |
|
2630 |
- } |
|
2631 |
- m.Mounts = append(m.Mounts, &containerd_types.Mount{}) |
|
2632 |
- if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
2633 |
- return err |
|
2634 |
- } |
|
2635 |
- iNdEx = postIndex |
|
2636 |
- default: |
|
2637 |
- iNdEx = preIndex |
|
2638 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2639 |
- if err != nil { |
|
2640 |
- return err |
|
2641 |
- } |
|
2642 |
- if skippy < 0 { |
|
2643 |
- return ErrInvalidLengthSnapshots |
|
2644 |
- } |
|
2645 |
- if (iNdEx + skippy) > l { |
|
2646 |
- return io.ErrUnexpectedEOF |
|
2647 |
- } |
|
2648 |
- iNdEx += skippy |
|
2649 |
- } |
|
2650 |
- } |
|
2651 |
- |
|
2652 |
- if iNdEx > l { |
|
2653 |
- return io.ErrUnexpectedEOF |
|
2654 |
- } |
|
2655 |
- return nil |
|
2656 |
-} |
|
2657 |
-func (m *RemoveSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
2658 |
- l := len(dAtA) |
|
2659 |
- iNdEx := 0 |
|
2660 |
- for iNdEx < l { |
|
2661 |
- preIndex := iNdEx |
|
2662 |
- var wire uint64 |
|
2663 |
- for shift := uint(0); ; shift += 7 { |
|
2664 |
- if shift >= 64 { |
|
2665 |
- return ErrIntOverflowSnapshots |
|
2666 |
- } |
|
2667 |
- if iNdEx >= l { |
|
2668 |
- return io.ErrUnexpectedEOF |
|
2669 |
- } |
|
2670 |
- b := dAtA[iNdEx] |
|
2671 |
- iNdEx++ |
|
2672 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2673 |
- if b < 0x80 { |
|
2674 |
- break |
|
2675 |
- } |
|
2676 |
- } |
|
2677 |
- fieldNum := int32(wire >> 3) |
|
2678 |
- wireType := int(wire & 0x7) |
|
2679 |
- if wireType == 4 { |
|
2680 |
- return fmt.Errorf("proto: RemoveSnapshotRequest: wiretype end group for non-group") |
|
2681 |
- } |
|
2682 |
- if fieldNum <= 0 { |
|
2683 |
- return fmt.Errorf("proto: RemoveSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2684 |
- } |
|
2685 |
- switch fieldNum { |
|
2686 |
- case 1: |
|
2687 |
- if wireType != 2 { |
|
2688 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2689 |
- } |
|
2690 |
- var stringLen uint64 |
|
2691 |
- for shift := uint(0); ; shift += 7 { |
|
2692 |
- if shift >= 64 { |
|
2693 |
- return ErrIntOverflowSnapshots |
|
2694 |
- } |
|
2695 |
- if iNdEx >= l { |
|
2696 |
- return io.ErrUnexpectedEOF |
|
2697 |
- } |
|
2698 |
- b := dAtA[iNdEx] |
|
2699 |
- iNdEx++ |
|
2700 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2701 |
- if b < 0x80 { |
|
2702 |
- break |
|
2703 |
- } |
|
2704 |
- } |
|
2705 |
- intStringLen := int(stringLen) |
|
2706 |
- if intStringLen < 0 { |
|
2707 |
- return ErrInvalidLengthSnapshots |
|
2708 |
- } |
|
2709 |
- postIndex := iNdEx + intStringLen |
|
2710 |
- if postIndex > l { |
|
2711 |
- return io.ErrUnexpectedEOF |
|
2712 |
- } |
|
2713 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2714 |
- iNdEx = postIndex |
|
2715 |
- case 2: |
|
2716 |
- if wireType != 2 { |
|
2717 |
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2718 |
- } |
|
2719 |
- var stringLen uint64 |
|
2720 |
- for shift := uint(0); ; shift += 7 { |
|
2721 |
- if shift >= 64 { |
|
2722 |
- return ErrIntOverflowSnapshots |
|
2723 |
- } |
|
2724 |
- if iNdEx >= l { |
|
2725 |
- return io.ErrUnexpectedEOF |
|
2726 |
- } |
|
2727 |
- b := dAtA[iNdEx] |
|
2728 |
- iNdEx++ |
|
2729 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2730 |
- if b < 0x80 { |
|
2731 |
- break |
|
2732 |
- } |
|
2733 |
- } |
|
2734 |
- intStringLen := int(stringLen) |
|
2735 |
- if intStringLen < 0 { |
|
2736 |
- return ErrInvalidLengthSnapshots |
|
2737 |
- } |
|
2738 |
- postIndex := iNdEx + intStringLen |
|
2739 |
- if postIndex > l { |
|
2740 |
- return io.ErrUnexpectedEOF |
|
2741 |
- } |
|
2742 |
- m.Key = string(dAtA[iNdEx:postIndex]) |
|
2743 |
- iNdEx = postIndex |
|
2744 |
- default: |
|
2745 |
- iNdEx = preIndex |
|
2746 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2747 |
- if err != nil { |
|
2748 |
- return err |
|
2749 |
- } |
|
2750 |
- if skippy < 0 { |
|
2751 |
- return ErrInvalidLengthSnapshots |
|
2752 |
- } |
|
2753 |
- if (iNdEx + skippy) > l { |
|
2754 |
- return io.ErrUnexpectedEOF |
|
2755 |
- } |
|
2756 |
- iNdEx += skippy |
|
2757 |
- } |
|
2758 |
- } |
|
2759 |
- |
|
2760 |
- if iNdEx > l { |
|
2761 |
- return io.ErrUnexpectedEOF |
|
2762 |
- } |
|
2763 |
- return nil |
|
2764 |
-} |
|
2765 |
-func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
2766 |
- l := len(dAtA) |
|
2767 |
- iNdEx := 0 |
|
2768 |
- for iNdEx < l { |
|
2769 |
- preIndex := iNdEx |
|
2770 |
- var wire uint64 |
|
2771 |
- for shift := uint(0); ; shift += 7 { |
|
2772 |
- if shift >= 64 { |
|
2773 |
- return ErrIntOverflowSnapshots |
|
2774 |
- } |
|
2775 |
- if iNdEx >= l { |
|
2776 |
- return io.ErrUnexpectedEOF |
|
2777 |
- } |
|
2778 |
- b := dAtA[iNdEx] |
|
2779 |
- iNdEx++ |
|
2780 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2781 |
- if b < 0x80 { |
|
2782 |
- break |
|
2783 |
- } |
|
2784 |
- } |
|
2785 |
- fieldNum := int32(wire >> 3) |
|
2786 |
- wireType := int(wire & 0x7) |
|
2787 |
- if wireType == 4 { |
|
2788 |
- return fmt.Errorf("proto: CommitSnapshotRequest: wiretype end group for non-group") |
|
2789 |
- } |
|
2790 |
- if fieldNum <= 0 { |
|
2791 |
- return fmt.Errorf("proto: CommitSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2792 |
- } |
|
2793 |
- switch fieldNum { |
|
2794 |
- case 1: |
|
2795 |
- if wireType != 2 { |
|
2796 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2797 |
- } |
|
2798 |
- var stringLen uint64 |
|
2799 |
- for shift := uint(0); ; shift += 7 { |
|
2800 |
- if shift >= 64 { |
|
2801 |
- return ErrIntOverflowSnapshots |
|
2802 |
- } |
|
2803 |
- if iNdEx >= l { |
|
2804 |
- return io.ErrUnexpectedEOF |
|
2805 |
- } |
|
2806 |
- b := dAtA[iNdEx] |
|
2807 |
- iNdEx++ |
|
2808 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2809 |
- if b < 0x80 { |
|
2810 |
- break |
|
2811 |
- } |
|
2812 |
- } |
|
2813 |
- intStringLen := int(stringLen) |
|
2814 |
- if intStringLen < 0 { |
|
2815 |
- return ErrInvalidLengthSnapshots |
|
2816 |
- } |
|
2817 |
- postIndex := iNdEx + intStringLen |
|
2818 |
- if postIndex > l { |
|
2819 |
- return io.ErrUnexpectedEOF |
|
2820 |
- } |
|
2821 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2822 |
- iNdEx = postIndex |
|
2823 |
- case 2: |
|
2824 |
- if wireType != 2 { |
|
2825 |
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
|
2826 |
- } |
|
2827 |
- var stringLen uint64 |
|
2828 |
- for shift := uint(0); ; shift += 7 { |
|
2829 |
- if shift >= 64 { |
|
2830 |
- return ErrIntOverflowSnapshots |
|
2831 |
- } |
|
2832 |
- if iNdEx >= l { |
|
2833 |
- return io.ErrUnexpectedEOF |
|
2834 |
- } |
|
2835 |
- b := dAtA[iNdEx] |
|
2836 |
- iNdEx++ |
|
2837 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2838 |
- if b < 0x80 { |
|
2839 |
- break |
|
2840 |
- } |
|
2841 |
- } |
|
2842 |
- intStringLen := int(stringLen) |
|
2843 |
- if intStringLen < 0 { |
|
2844 |
- return ErrInvalidLengthSnapshots |
|
2845 |
- } |
|
2846 |
- postIndex := iNdEx + intStringLen |
|
2847 |
- if postIndex > l { |
|
2848 |
- return io.ErrUnexpectedEOF |
|
2849 |
- } |
|
2850 |
- m.Name = string(dAtA[iNdEx:postIndex]) |
|
2851 |
- iNdEx = postIndex |
|
2852 |
- case 3: |
|
2853 |
- if wireType != 2 { |
|
2854 |
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2855 |
- } |
|
2856 |
- var stringLen uint64 |
|
2857 |
- for shift := uint(0); ; shift += 7 { |
|
2858 |
- if shift >= 64 { |
|
2859 |
- return ErrIntOverflowSnapshots |
|
2860 |
- } |
|
2861 |
- if iNdEx >= l { |
|
2862 |
- return io.ErrUnexpectedEOF |
|
2863 |
- } |
|
2864 |
- b := dAtA[iNdEx] |
|
2865 |
- iNdEx++ |
|
2866 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
2867 |
- if b < 0x80 { |
|
2868 |
- break |
|
2869 |
- } |
|
2870 |
- } |
|
2871 |
- intStringLen := int(stringLen) |
|
2872 |
- if intStringLen < 0 { |
|
2873 |
- return ErrInvalidLengthSnapshots |
|
2874 |
- } |
|
2875 |
- postIndex := iNdEx + intStringLen |
|
2876 |
- if postIndex > l { |
|
2877 |
- return io.ErrUnexpectedEOF |
|
2878 |
- } |
|
2879 |
- m.Key = string(dAtA[iNdEx:postIndex]) |
|
2880 |
- iNdEx = postIndex |
|
2881 |
- case 4: |
|
2882 |
- if wireType != 2 { |
|
2883 |
- return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
2884 |
- } |
|
2885 |
- var msglen int |
|
2886 |
- for shift := uint(0); ; shift += 7 { |
|
2887 |
- if shift >= 64 { |
|
2888 |
- return ErrIntOverflowSnapshots |
|
2889 |
- } |
|
2890 |
- if iNdEx >= l { |
|
2891 |
- return io.ErrUnexpectedEOF |
|
2892 |
- } |
|
2893 |
- b := dAtA[iNdEx] |
|
2894 |
- iNdEx++ |
|
2895 |
- msglen |= (int(b) & 0x7F) << shift |
|
2896 |
- if b < 0x80 { |
|
2897 |
- break |
|
2898 |
- } |
|
2899 |
- } |
|
2900 |
- if msglen < 0 { |
|
2901 |
- return ErrInvalidLengthSnapshots |
|
2902 |
- } |
|
2903 |
- postIndex := iNdEx + msglen |
|
2904 |
- if postIndex > l { |
|
2905 |
- return io.ErrUnexpectedEOF |
|
2906 |
- } |
|
2907 |
- if m.Labels == nil { |
|
2908 |
- m.Labels = make(map[string]string) |
|
2909 |
- } |
|
2910 |
- var mapkey string |
|
2911 |
- var mapvalue string |
|
2912 |
- for iNdEx < postIndex { |
|
2913 |
- entryPreIndex := iNdEx |
|
2914 |
- var wire uint64 |
|
2915 |
- for shift := uint(0); ; shift += 7 { |
|
2916 |
- if shift >= 64 { |
|
2917 |
- return ErrIntOverflowSnapshots |
|
2918 |
- } |
|
2919 |
- if iNdEx >= l { |
|
2920 |
- return io.ErrUnexpectedEOF |
|
2921 |
- } |
|
2922 |
- b := dAtA[iNdEx] |
|
2923 |
- iNdEx++ |
|
2924 |
- wire |= (uint64(b) & 0x7F) << shift |
|
2925 |
- if b < 0x80 { |
|
2926 |
- break |
|
2927 |
- } |
|
2928 |
- } |
|
2929 |
- fieldNum := int32(wire >> 3) |
|
2930 |
- if fieldNum == 1 { |
|
2931 |
- var stringLenmapkey uint64 |
|
2932 |
- for shift := uint(0); ; shift += 7 { |
|
2933 |
- if shift >= 64 { |
|
2934 |
- return ErrIntOverflowSnapshots |
|
2935 |
- } |
|
2936 |
- if iNdEx >= l { |
|
2937 |
- return io.ErrUnexpectedEOF |
|
2938 |
- } |
|
2939 |
- b := dAtA[iNdEx] |
|
2940 |
- iNdEx++ |
|
2941 |
- stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
2942 |
- if b < 0x80 { |
|
2943 |
- break |
|
2944 |
- } |
|
2945 |
- } |
|
2946 |
- intStringLenmapkey := int(stringLenmapkey) |
|
2947 |
- if intStringLenmapkey < 0 { |
|
2948 |
- return ErrInvalidLengthSnapshots |
|
2949 |
- } |
|
2950 |
- postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
2951 |
- if postStringIndexmapkey > l { |
|
2952 |
- return io.ErrUnexpectedEOF |
|
2953 |
- } |
|
2954 |
- mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
2955 |
- iNdEx = postStringIndexmapkey |
|
2956 |
- } else if fieldNum == 2 { |
|
2957 |
- var stringLenmapvalue uint64 |
|
2958 |
- for shift := uint(0); ; shift += 7 { |
|
2959 |
- if shift >= 64 { |
|
2960 |
- return ErrIntOverflowSnapshots |
|
2961 |
- } |
|
2962 |
- if iNdEx >= l { |
|
2963 |
- return io.ErrUnexpectedEOF |
|
2964 |
- } |
|
2965 |
- b := dAtA[iNdEx] |
|
2966 |
- iNdEx++ |
|
2967 |
- stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
2968 |
- if b < 0x80 { |
|
2969 |
- break |
|
2970 |
- } |
|
2971 |
- } |
|
2972 |
- intStringLenmapvalue := int(stringLenmapvalue) |
|
2973 |
- if intStringLenmapvalue < 0 { |
|
2974 |
- return ErrInvalidLengthSnapshots |
|
2975 |
- } |
|
2976 |
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
2977 |
- if postStringIndexmapvalue > l { |
|
2978 |
- return io.ErrUnexpectedEOF |
|
2979 |
- } |
|
2980 |
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
2981 |
- iNdEx = postStringIndexmapvalue |
|
2982 |
- } else { |
|
2983 |
- iNdEx = entryPreIndex |
|
2984 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2985 |
- if err != nil { |
|
2986 |
- return err |
|
2987 |
- } |
|
2988 |
- if skippy < 0 { |
|
2989 |
- return ErrInvalidLengthSnapshots |
|
2990 |
- } |
|
2991 |
- if (iNdEx + skippy) > postIndex { |
|
2992 |
- return io.ErrUnexpectedEOF |
|
2993 |
- } |
|
2994 |
- iNdEx += skippy |
|
2995 |
- } |
|
2996 |
- } |
|
2997 |
- m.Labels[mapkey] = mapvalue |
|
2998 |
- iNdEx = postIndex |
|
2999 |
- default: |
|
3000 |
- iNdEx = preIndex |
|
3001 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3002 |
- if err != nil { |
|
3003 |
- return err |
|
3004 |
- } |
|
3005 |
- if skippy < 0 { |
|
3006 |
- return ErrInvalidLengthSnapshots |
|
3007 |
- } |
|
3008 |
- if (iNdEx + skippy) > l { |
|
3009 |
- return io.ErrUnexpectedEOF |
|
3010 |
- } |
|
3011 |
- iNdEx += skippy |
|
3012 |
- } |
|
3013 |
- } |
|
3014 |
- |
|
3015 |
- if iNdEx > l { |
|
3016 |
- return io.ErrUnexpectedEOF |
|
3017 |
- } |
|
3018 |
- return nil |
|
3019 |
-} |
|
3020 |
-func (m *StatSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
3021 |
- l := len(dAtA) |
|
3022 |
- iNdEx := 0 |
|
3023 |
- for iNdEx < l { |
|
3024 |
- preIndex := iNdEx |
|
3025 |
- var wire uint64 |
|
3026 |
- for shift := uint(0); ; shift += 7 { |
|
3027 |
- if shift >= 64 { |
|
3028 |
- return ErrIntOverflowSnapshots |
|
3029 |
- } |
|
3030 |
- if iNdEx >= l { |
|
3031 |
- return io.ErrUnexpectedEOF |
|
3032 |
- } |
|
3033 |
- b := dAtA[iNdEx] |
|
3034 |
- iNdEx++ |
|
3035 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3036 |
- if b < 0x80 { |
|
3037 |
- break |
|
3038 |
- } |
|
3039 |
- } |
|
3040 |
- fieldNum := int32(wire >> 3) |
|
3041 |
- wireType := int(wire & 0x7) |
|
3042 |
- if wireType == 4 { |
|
3043 |
- return fmt.Errorf("proto: StatSnapshotRequest: wiretype end group for non-group") |
|
3044 |
- } |
|
3045 |
- if fieldNum <= 0 { |
|
3046 |
- return fmt.Errorf("proto: StatSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3047 |
- } |
|
3048 |
- switch fieldNum { |
|
3049 |
- case 1: |
|
3050 |
- if wireType != 2 { |
|
3051 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3052 |
- } |
|
3053 |
- var stringLen uint64 |
|
3054 |
- for shift := uint(0); ; shift += 7 { |
|
3055 |
- if shift >= 64 { |
|
3056 |
- return ErrIntOverflowSnapshots |
|
3057 |
- } |
|
3058 |
- if iNdEx >= l { |
|
3059 |
- return io.ErrUnexpectedEOF |
|
3060 |
- } |
|
3061 |
- b := dAtA[iNdEx] |
|
3062 |
- iNdEx++ |
|
3063 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3064 |
- if b < 0x80 { |
|
3065 |
- break |
|
3066 |
- } |
|
3067 |
- } |
|
3068 |
- intStringLen := int(stringLen) |
|
3069 |
- if intStringLen < 0 { |
|
3070 |
- return ErrInvalidLengthSnapshots |
|
3071 |
- } |
|
3072 |
- postIndex := iNdEx + intStringLen |
|
3073 |
- if postIndex > l { |
|
3074 |
- return io.ErrUnexpectedEOF |
|
3075 |
- } |
|
3076 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3077 |
- iNdEx = postIndex |
|
3078 |
- case 2: |
|
3079 |
- if wireType != 2 { |
|
3080 |
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
3081 |
- } |
|
3082 |
- var stringLen uint64 |
|
3083 |
- for shift := uint(0); ; shift += 7 { |
|
3084 |
- if shift >= 64 { |
|
3085 |
- return ErrIntOverflowSnapshots |
|
3086 |
- } |
|
3087 |
- if iNdEx >= l { |
|
3088 |
- return io.ErrUnexpectedEOF |
|
3089 |
- } |
|
3090 |
- b := dAtA[iNdEx] |
|
3091 |
- iNdEx++ |
|
3092 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3093 |
- if b < 0x80 { |
|
3094 |
- break |
|
3095 |
- } |
|
3096 |
- } |
|
3097 |
- intStringLen := int(stringLen) |
|
3098 |
- if intStringLen < 0 { |
|
3099 |
- return ErrInvalidLengthSnapshots |
|
3100 |
- } |
|
3101 |
- postIndex := iNdEx + intStringLen |
|
3102 |
- if postIndex > l { |
|
3103 |
- return io.ErrUnexpectedEOF |
|
3104 |
- } |
|
3105 |
- m.Key = string(dAtA[iNdEx:postIndex]) |
|
3106 |
- iNdEx = postIndex |
|
3107 |
- default: |
|
3108 |
- iNdEx = preIndex |
|
3109 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3110 |
- if err != nil { |
|
3111 |
- return err |
|
3112 |
- } |
|
3113 |
- if skippy < 0 { |
|
3114 |
- return ErrInvalidLengthSnapshots |
|
3115 |
- } |
|
3116 |
- if (iNdEx + skippy) > l { |
|
3117 |
- return io.ErrUnexpectedEOF |
|
3118 |
- } |
|
3119 |
- iNdEx += skippy |
|
3120 |
- } |
|
3121 |
- } |
|
3122 |
- |
|
3123 |
- if iNdEx > l { |
|
3124 |
- return io.ErrUnexpectedEOF |
|
3125 |
- } |
|
3126 |
- return nil |
|
3127 |
-} |
|
3128 |
-func (m *Info) Unmarshal(dAtA []byte) error { |
|
3129 |
- l := len(dAtA) |
|
3130 |
- iNdEx := 0 |
|
3131 |
- for iNdEx < l { |
|
3132 |
- preIndex := iNdEx |
|
3133 |
- var wire uint64 |
|
3134 |
- for shift := uint(0); ; shift += 7 { |
|
3135 |
- if shift >= 64 { |
|
3136 |
- return ErrIntOverflowSnapshots |
|
3137 |
- } |
|
3138 |
- if iNdEx >= l { |
|
3139 |
- return io.ErrUnexpectedEOF |
|
3140 |
- } |
|
3141 |
- b := dAtA[iNdEx] |
|
3142 |
- iNdEx++ |
|
3143 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3144 |
- if b < 0x80 { |
|
3145 |
- break |
|
3146 |
- } |
|
3147 |
- } |
|
3148 |
- fieldNum := int32(wire >> 3) |
|
3149 |
- wireType := int(wire & 0x7) |
|
3150 |
- if wireType == 4 { |
|
3151 |
- return fmt.Errorf("proto: Info: wiretype end group for non-group") |
|
3152 |
- } |
|
3153 |
- if fieldNum <= 0 { |
|
3154 |
- return fmt.Errorf("proto: Info: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3155 |
- } |
|
3156 |
- switch fieldNum { |
|
3157 |
- case 1: |
|
3158 |
- if wireType != 2 { |
|
3159 |
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
|
3160 |
- } |
|
3161 |
- var stringLen uint64 |
|
3162 |
- for shift := uint(0); ; shift += 7 { |
|
3163 |
- if shift >= 64 { |
|
3164 |
- return ErrIntOverflowSnapshots |
|
3165 |
- } |
|
3166 |
- if iNdEx >= l { |
|
3167 |
- return io.ErrUnexpectedEOF |
|
3168 |
- } |
|
3169 |
- b := dAtA[iNdEx] |
|
3170 |
- iNdEx++ |
|
3171 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3172 |
- if b < 0x80 { |
|
3173 |
- break |
|
3174 |
- } |
|
3175 |
- } |
|
3176 |
- intStringLen := int(stringLen) |
|
3177 |
- if intStringLen < 0 { |
|
3178 |
- return ErrInvalidLengthSnapshots |
|
3179 |
- } |
|
3180 |
- postIndex := iNdEx + intStringLen |
|
3181 |
- if postIndex > l { |
|
3182 |
- return io.ErrUnexpectedEOF |
|
3183 |
- } |
|
3184 |
- m.Name = string(dAtA[iNdEx:postIndex]) |
|
3185 |
- iNdEx = postIndex |
|
3186 |
- case 2: |
|
3187 |
- if wireType != 2 { |
|
3188 |
- return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) |
|
3189 |
- } |
|
3190 |
- var stringLen uint64 |
|
3191 |
- for shift := uint(0); ; shift += 7 { |
|
3192 |
- if shift >= 64 { |
|
3193 |
- return ErrIntOverflowSnapshots |
|
3194 |
- } |
|
3195 |
- if iNdEx >= l { |
|
3196 |
- return io.ErrUnexpectedEOF |
|
3197 |
- } |
|
3198 |
- b := dAtA[iNdEx] |
|
3199 |
- iNdEx++ |
|
3200 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3201 |
- if b < 0x80 { |
|
3202 |
- break |
|
3203 |
- } |
|
3204 |
- } |
|
3205 |
- intStringLen := int(stringLen) |
|
3206 |
- if intStringLen < 0 { |
|
3207 |
- return ErrInvalidLengthSnapshots |
|
3208 |
- } |
|
3209 |
- postIndex := iNdEx + intStringLen |
|
3210 |
- if postIndex > l { |
|
3211 |
- return io.ErrUnexpectedEOF |
|
3212 |
- } |
|
3213 |
- m.Parent = string(dAtA[iNdEx:postIndex]) |
|
3214 |
- iNdEx = postIndex |
|
3215 |
- case 3: |
|
3216 |
- if wireType != 0 { |
|
3217 |
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) |
|
3218 |
- } |
|
3219 |
- m.Kind = 0 |
|
3220 |
- for shift := uint(0); ; shift += 7 { |
|
3221 |
- if shift >= 64 { |
|
3222 |
- return ErrIntOverflowSnapshots |
|
3223 |
- } |
|
3224 |
- if iNdEx >= l { |
|
3225 |
- return io.ErrUnexpectedEOF |
|
3226 |
- } |
|
3227 |
- b := dAtA[iNdEx] |
|
3228 |
- iNdEx++ |
|
3229 |
- m.Kind |= (Kind(b) & 0x7F) << shift |
|
3230 |
- if b < 0x80 { |
|
3231 |
- break |
|
3232 |
- } |
|
3233 |
- } |
|
3234 |
- case 4: |
|
3235 |
- if wireType != 2 { |
|
3236 |
- return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) |
|
3237 |
- } |
|
3238 |
- var msglen int |
|
3239 |
- for shift := uint(0); ; shift += 7 { |
|
3240 |
- if shift >= 64 { |
|
3241 |
- return ErrIntOverflowSnapshots |
|
3242 |
- } |
|
3243 |
- if iNdEx >= l { |
|
3244 |
- return io.ErrUnexpectedEOF |
|
3245 |
- } |
|
3246 |
- b := dAtA[iNdEx] |
|
3247 |
- iNdEx++ |
|
3248 |
- msglen |= (int(b) & 0x7F) << shift |
|
3249 |
- if b < 0x80 { |
|
3250 |
- break |
|
3251 |
- } |
|
3252 |
- } |
|
3253 |
- if msglen < 0 { |
|
3254 |
- return ErrInvalidLengthSnapshots |
|
3255 |
- } |
|
3256 |
- postIndex := iNdEx + msglen |
|
3257 |
- if postIndex > l { |
|
3258 |
- return io.ErrUnexpectedEOF |
|
3259 |
- } |
|
3260 |
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { |
|
3261 |
- return err |
|
3262 |
- } |
|
3263 |
- iNdEx = postIndex |
|
3264 |
- case 5: |
|
3265 |
- if wireType != 2 { |
|
3266 |
- return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) |
|
3267 |
- } |
|
3268 |
- var msglen int |
|
3269 |
- for shift := uint(0); ; shift += 7 { |
|
3270 |
- if shift >= 64 { |
|
3271 |
- return ErrIntOverflowSnapshots |
|
3272 |
- } |
|
3273 |
- if iNdEx >= l { |
|
3274 |
- return io.ErrUnexpectedEOF |
|
3275 |
- } |
|
3276 |
- b := dAtA[iNdEx] |
|
3277 |
- iNdEx++ |
|
3278 |
- msglen |= (int(b) & 0x7F) << shift |
|
3279 |
- if b < 0x80 { |
|
3280 |
- break |
|
3281 |
- } |
|
3282 |
- } |
|
3283 |
- if msglen < 0 { |
|
3284 |
- return ErrInvalidLengthSnapshots |
|
3285 |
- } |
|
3286 |
- postIndex := iNdEx + msglen |
|
3287 |
- if postIndex > l { |
|
3288 |
- return io.ErrUnexpectedEOF |
|
3289 |
- } |
|
3290 |
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil { |
|
3291 |
- return err |
|
3292 |
- } |
|
3293 |
- iNdEx = postIndex |
|
3294 |
- case 6: |
|
3295 |
- if wireType != 2 { |
|
3296 |
- return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
3297 |
- } |
|
3298 |
- var msglen int |
|
3299 |
- for shift := uint(0); ; shift += 7 { |
|
3300 |
- if shift >= 64 { |
|
3301 |
- return ErrIntOverflowSnapshots |
|
3302 |
- } |
|
3303 |
- if iNdEx >= l { |
|
3304 |
- return io.ErrUnexpectedEOF |
|
3305 |
- } |
|
3306 |
- b := dAtA[iNdEx] |
|
3307 |
- iNdEx++ |
|
3308 |
- msglen |= (int(b) & 0x7F) << shift |
|
3309 |
- if b < 0x80 { |
|
3310 |
- break |
|
3311 |
- } |
|
3312 |
- } |
|
3313 |
- if msglen < 0 { |
|
3314 |
- return ErrInvalidLengthSnapshots |
|
3315 |
- } |
|
3316 |
- postIndex := iNdEx + msglen |
|
3317 |
- if postIndex > l { |
|
3318 |
- return io.ErrUnexpectedEOF |
|
3319 |
- } |
|
3320 |
- if m.Labels == nil { |
|
3321 |
- m.Labels = make(map[string]string) |
|
3322 |
- } |
|
3323 |
- var mapkey string |
|
3324 |
- var mapvalue string |
|
3325 |
- for iNdEx < postIndex { |
|
3326 |
- entryPreIndex := iNdEx |
|
3327 |
- var wire uint64 |
|
3328 |
- for shift := uint(0); ; shift += 7 { |
|
3329 |
- if shift >= 64 { |
|
3330 |
- return ErrIntOverflowSnapshots |
|
3331 |
- } |
|
3332 |
- if iNdEx >= l { |
|
3333 |
- return io.ErrUnexpectedEOF |
|
3334 |
- } |
|
3335 |
- b := dAtA[iNdEx] |
|
3336 |
- iNdEx++ |
|
3337 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3338 |
- if b < 0x80 { |
|
3339 |
- break |
|
3340 |
- } |
|
3341 |
- } |
|
3342 |
- fieldNum := int32(wire >> 3) |
|
3343 |
- if fieldNum == 1 { |
|
3344 |
- var stringLenmapkey uint64 |
|
3345 |
- for shift := uint(0); ; shift += 7 { |
|
3346 |
- if shift >= 64 { |
|
3347 |
- return ErrIntOverflowSnapshots |
|
3348 |
- } |
|
3349 |
- if iNdEx >= l { |
|
3350 |
- return io.ErrUnexpectedEOF |
|
3351 |
- } |
|
3352 |
- b := dAtA[iNdEx] |
|
3353 |
- iNdEx++ |
|
3354 |
- stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
3355 |
- if b < 0x80 { |
|
3356 |
- break |
|
3357 |
- } |
|
3358 |
- } |
|
3359 |
- intStringLenmapkey := int(stringLenmapkey) |
|
3360 |
- if intStringLenmapkey < 0 { |
|
3361 |
- return ErrInvalidLengthSnapshots |
|
3362 |
- } |
|
3363 |
- postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
3364 |
- if postStringIndexmapkey > l { |
|
3365 |
- return io.ErrUnexpectedEOF |
|
3366 |
- } |
|
3367 |
- mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
3368 |
- iNdEx = postStringIndexmapkey |
|
3369 |
- } else if fieldNum == 2 { |
|
3370 |
- var stringLenmapvalue uint64 |
|
3371 |
- for shift := uint(0); ; shift += 7 { |
|
3372 |
- if shift >= 64 { |
|
3373 |
- return ErrIntOverflowSnapshots |
|
3374 |
- } |
|
3375 |
- if iNdEx >= l { |
|
3376 |
- return io.ErrUnexpectedEOF |
|
3377 |
- } |
|
3378 |
- b := dAtA[iNdEx] |
|
3379 |
- iNdEx++ |
|
3380 |
- stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
3381 |
- if b < 0x80 { |
|
3382 |
- break |
|
3383 |
- } |
|
3384 |
- } |
|
3385 |
- intStringLenmapvalue := int(stringLenmapvalue) |
|
3386 |
- if intStringLenmapvalue < 0 { |
|
3387 |
- return ErrInvalidLengthSnapshots |
|
3388 |
- } |
|
3389 |
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
3390 |
- if postStringIndexmapvalue > l { |
|
3391 |
- return io.ErrUnexpectedEOF |
|
3392 |
- } |
|
3393 |
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
3394 |
- iNdEx = postStringIndexmapvalue |
|
3395 |
- } else { |
|
3396 |
- iNdEx = entryPreIndex |
|
3397 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3398 |
- if err != nil { |
|
3399 |
- return err |
|
3400 |
- } |
|
3401 |
- if skippy < 0 { |
|
3402 |
- return ErrInvalidLengthSnapshots |
|
3403 |
- } |
|
3404 |
- if (iNdEx + skippy) > postIndex { |
|
3405 |
- return io.ErrUnexpectedEOF |
|
3406 |
- } |
|
3407 |
- iNdEx += skippy |
|
3408 |
- } |
|
3409 |
- } |
|
3410 |
- m.Labels[mapkey] = mapvalue |
|
3411 |
- iNdEx = postIndex |
|
3412 |
- default: |
|
3413 |
- iNdEx = preIndex |
|
3414 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3415 |
- if err != nil { |
|
3416 |
- return err |
|
3417 |
- } |
|
3418 |
- if skippy < 0 { |
|
3419 |
- return ErrInvalidLengthSnapshots |
|
3420 |
- } |
|
3421 |
- if (iNdEx + skippy) > l { |
|
3422 |
- return io.ErrUnexpectedEOF |
|
3423 |
- } |
|
3424 |
- iNdEx += skippy |
|
3425 |
- } |
|
3426 |
- } |
|
3427 |
- |
|
3428 |
- if iNdEx > l { |
|
3429 |
- return io.ErrUnexpectedEOF |
|
3430 |
- } |
|
3431 |
- return nil |
|
3432 |
-} |
|
3433 |
-func (m *StatSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
3434 |
- l := len(dAtA) |
|
3435 |
- iNdEx := 0 |
|
3436 |
- for iNdEx < l { |
|
3437 |
- preIndex := iNdEx |
|
3438 |
- var wire uint64 |
|
3439 |
- for shift := uint(0); ; shift += 7 { |
|
3440 |
- if shift >= 64 { |
|
3441 |
- return ErrIntOverflowSnapshots |
|
3442 |
- } |
|
3443 |
- if iNdEx >= l { |
|
3444 |
- return io.ErrUnexpectedEOF |
|
3445 |
- } |
|
3446 |
- b := dAtA[iNdEx] |
|
3447 |
- iNdEx++ |
|
3448 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3449 |
- if b < 0x80 { |
|
3450 |
- break |
|
3451 |
- } |
|
3452 |
- } |
|
3453 |
- fieldNum := int32(wire >> 3) |
|
3454 |
- wireType := int(wire & 0x7) |
|
3455 |
- if wireType == 4 { |
|
3456 |
- return fmt.Errorf("proto: StatSnapshotResponse: wiretype end group for non-group") |
|
3457 |
- } |
|
3458 |
- if fieldNum <= 0 { |
|
3459 |
- return fmt.Errorf("proto: StatSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3460 |
- } |
|
3461 |
- switch fieldNum { |
|
3462 |
- case 1: |
|
3463 |
- if wireType != 2 { |
|
3464 |
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3465 |
- } |
|
3466 |
- var msglen int |
|
3467 |
- for shift := uint(0); ; shift += 7 { |
|
3468 |
- if shift >= 64 { |
|
3469 |
- return ErrIntOverflowSnapshots |
|
3470 |
- } |
|
3471 |
- if iNdEx >= l { |
|
3472 |
- return io.ErrUnexpectedEOF |
|
3473 |
- } |
|
3474 |
- b := dAtA[iNdEx] |
|
3475 |
- iNdEx++ |
|
3476 |
- msglen |= (int(b) & 0x7F) << shift |
|
3477 |
- if b < 0x80 { |
|
3478 |
- break |
|
3479 |
- } |
|
3480 |
- } |
|
3481 |
- if msglen < 0 { |
|
3482 |
- return ErrInvalidLengthSnapshots |
|
3483 |
- } |
|
3484 |
- postIndex := iNdEx + msglen |
|
3485 |
- if postIndex > l { |
|
3486 |
- return io.ErrUnexpectedEOF |
|
3487 |
- } |
|
3488 |
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3489 |
- return err |
|
3490 |
- } |
|
3491 |
- iNdEx = postIndex |
|
3492 |
- default: |
|
3493 |
- iNdEx = preIndex |
|
3494 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3495 |
- if err != nil { |
|
3496 |
- return err |
|
3497 |
- } |
|
3498 |
- if skippy < 0 { |
|
3499 |
- return ErrInvalidLengthSnapshots |
|
3500 |
- } |
|
3501 |
- if (iNdEx + skippy) > l { |
|
3502 |
- return io.ErrUnexpectedEOF |
|
3503 |
- } |
|
3504 |
- iNdEx += skippy |
|
3505 |
- } |
|
3506 |
- } |
|
3507 |
- |
|
3508 |
- if iNdEx > l { |
|
3509 |
- return io.ErrUnexpectedEOF |
|
3510 |
- } |
|
3511 |
- return nil |
|
3512 |
-} |
|
3513 |
-func (m *UpdateSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
3514 |
- l := len(dAtA) |
|
3515 |
- iNdEx := 0 |
|
3516 |
- for iNdEx < l { |
|
3517 |
- preIndex := iNdEx |
|
3518 |
- var wire uint64 |
|
3519 |
- for shift := uint(0); ; shift += 7 { |
|
3520 |
- if shift >= 64 { |
|
3521 |
- return ErrIntOverflowSnapshots |
|
3522 |
- } |
|
3523 |
- if iNdEx >= l { |
|
3524 |
- return io.ErrUnexpectedEOF |
|
3525 |
- } |
|
3526 |
- b := dAtA[iNdEx] |
|
3527 |
- iNdEx++ |
|
3528 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3529 |
- if b < 0x80 { |
|
3530 |
- break |
|
3531 |
- } |
|
3532 |
- } |
|
3533 |
- fieldNum := int32(wire >> 3) |
|
3534 |
- wireType := int(wire & 0x7) |
|
3535 |
- if wireType == 4 { |
|
3536 |
- return fmt.Errorf("proto: UpdateSnapshotRequest: wiretype end group for non-group") |
|
3537 |
- } |
|
3538 |
- if fieldNum <= 0 { |
|
3539 |
- return fmt.Errorf("proto: UpdateSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3540 |
- } |
|
3541 |
- switch fieldNum { |
|
3542 |
- case 1: |
|
3543 |
- if wireType != 2 { |
|
3544 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3545 |
- } |
|
3546 |
- var stringLen uint64 |
|
3547 |
- for shift := uint(0); ; shift += 7 { |
|
3548 |
- if shift >= 64 { |
|
3549 |
- return ErrIntOverflowSnapshots |
|
3550 |
- } |
|
3551 |
- if iNdEx >= l { |
|
3552 |
- return io.ErrUnexpectedEOF |
|
3553 |
- } |
|
3554 |
- b := dAtA[iNdEx] |
|
3555 |
- iNdEx++ |
|
3556 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3557 |
- if b < 0x80 { |
|
3558 |
- break |
|
3559 |
- } |
|
3560 |
- } |
|
3561 |
- intStringLen := int(stringLen) |
|
3562 |
- if intStringLen < 0 { |
|
3563 |
- return ErrInvalidLengthSnapshots |
|
3564 |
- } |
|
3565 |
- postIndex := iNdEx + intStringLen |
|
3566 |
- if postIndex > l { |
|
3567 |
- return io.ErrUnexpectedEOF |
|
3568 |
- } |
|
3569 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3570 |
- iNdEx = postIndex |
|
3571 |
- case 2: |
|
3572 |
- if wireType != 2 { |
|
3573 |
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3574 |
- } |
|
3575 |
- var msglen int |
|
3576 |
- for shift := uint(0); ; shift += 7 { |
|
3577 |
- if shift >= 64 { |
|
3578 |
- return ErrIntOverflowSnapshots |
|
3579 |
- } |
|
3580 |
- if iNdEx >= l { |
|
3581 |
- return io.ErrUnexpectedEOF |
|
3582 |
- } |
|
3583 |
- b := dAtA[iNdEx] |
|
3584 |
- iNdEx++ |
|
3585 |
- msglen |= (int(b) & 0x7F) << shift |
|
3586 |
- if b < 0x80 { |
|
3587 |
- break |
|
3588 |
- } |
|
3589 |
- } |
|
3590 |
- if msglen < 0 { |
|
3591 |
- return ErrInvalidLengthSnapshots |
|
3592 |
- } |
|
3593 |
- postIndex := iNdEx + msglen |
|
3594 |
- if postIndex > l { |
|
3595 |
- return io.ErrUnexpectedEOF |
|
3596 |
- } |
|
3597 |
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3598 |
- return err |
|
3599 |
- } |
|
3600 |
- iNdEx = postIndex |
|
3601 |
- case 3: |
|
3602 |
- if wireType != 2 { |
|
3603 |
- return fmt.Errorf("proto: wrong wireType = %d for field UpdateMask", wireType) |
|
3604 |
- } |
|
3605 |
- var msglen int |
|
3606 |
- for shift := uint(0); ; shift += 7 { |
|
3607 |
- if shift >= 64 { |
|
3608 |
- return ErrIntOverflowSnapshots |
|
3609 |
- } |
|
3610 |
- if iNdEx >= l { |
|
3611 |
- return io.ErrUnexpectedEOF |
|
3612 |
- } |
|
3613 |
- b := dAtA[iNdEx] |
|
3614 |
- iNdEx++ |
|
3615 |
- msglen |= (int(b) & 0x7F) << shift |
|
3616 |
- if b < 0x80 { |
|
3617 |
- break |
|
3618 |
- } |
|
3619 |
- } |
|
3620 |
- if msglen < 0 { |
|
3621 |
- return ErrInvalidLengthSnapshots |
|
3622 |
- } |
|
3623 |
- postIndex := iNdEx + msglen |
|
3624 |
- if postIndex > l { |
|
3625 |
- return io.ErrUnexpectedEOF |
|
3626 |
- } |
|
3627 |
- if m.UpdateMask == nil { |
|
3628 |
- m.UpdateMask = &google_protobuf2.FieldMask{} |
|
3629 |
- } |
|
3630 |
- if err := m.UpdateMask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3631 |
- return err |
|
3632 |
- } |
|
3633 |
- iNdEx = postIndex |
|
3634 |
- default: |
|
3635 |
- iNdEx = preIndex |
|
3636 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3637 |
- if err != nil { |
|
3638 |
- return err |
|
3639 |
- } |
|
3640 |
- if skippy < 0 { |
|
3641 |
- return ErrInvalidLengthSnapshots |
|
3642 |
- } |
|
3643 |
- if (iNdEx + skippy) > l { |
|
3644 |
- return io.ErrUnexpectedEOF |
|
3645 |
- } |
|
3646 |
- iNdEx += skippy |
|
3647 |
- } |
|
3648 |
- } |
|
3649 |
- |
|
3650 |
- if iNdEx > l { |
|
3651 |
- return io.ErrUnexpectedEOF |
|
3652 |
- } |
|
3653 |
- return nil |
|
3654 |
-} |
|
3655 |
-func (m *UpdateSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
3656 |
- l := len(dAtA) |
|
3657 |
- iNdEx := 0 |
|
3658 |
- for iNdEx < l { |
|
3659 |
- preIndex := iNdEx |
|
3660 |
- var wire uint64 |
|
3661 |
- for shift := uint(0); ; shift += 7 { |
|
3662 |
- if shift >= 64 { |
|
3663 |
- return ErrIntOverflowSnapshots |
|
3664 |
- } |
|
3665 |
- if iNdEx >= l { |
|
3666 |
- return io.ErrUnexpectedEOF |
|
3667 |
- } |
|
3668 |
- b := dAtA[iNdEx] |
|
3669 |
- iNdEx++ |
|
3670 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3671 |
- if b < 0x80 { |
|
3672 |
- break |
|
3673 |
- } |
|
3674 |
- } |
|
3675 |
- fieldNum := int32(wire >> 3) |
|
3676 |
- wireType := int(wire & 0x7) |
|
3677 |
- if wireType == 4 { |
|
3678 |
- return fmt.Errorf("proto: UpdateSnapshotResponse: wiretype end group for non-group") |
|
3679 |
- } |
|
3680 |
- if fieldNum <= 0 { |
|
3681 |
- return fmt.Errorf("proto: UpdateSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3682 |
- } |
|
3683 |
- switch fieldNum { |
|
3684 |
- case 1: |
|
3685 |
- if wireType != 2 { |
|
3686 |
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3687 |
- } |
|
3688 |
- var msglen int |
|
3689 |
- for shift := uint(0); ; shift += 7 { |
|
3690 |
- if shift >= 64 { |
|
3691 |
- return ErrIntOverflowSnapshots |
|
3692 |
- } |
|
3693 |
- if iNdEx >= l { |
|
3694 |
- return io.ErrUnexpectedEOF |
|
3695 |
- } |
|
3696 |
- b := dAtA[iNdEx] |
|
3697 |
- iNdEx++ |
|
3698 |
- msglen |= (int(b) & 0x7F) << shift |
|
3699 |
- if b < 0x80 { |
|
3700 |
- break |
|
3701 |
- } |
|
3702 |
- } |
|
3703 |
- if msglen < 0 { |
|
3704 |
- return ErrInvalidLengthSnapshots |
|
3705 |
- } |
|
3706 |
- postIndex := iNdEx + msglen |
|
3707 |
- if postIndex > l { |
|
3708 |
- return io.ErrUnexpectedEOF |
|
3709 |
- } |
|
3710 |
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3711 |
- return err |
|
3712 |
- } |
|
3713 |
- iNdEx = postIndex |
|
3714 |
- default: |
|
3715 |
- iNdEx = preIndex |
|
3716 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3717 |
- if err != nil { |
|
3718 |
- return err |
|
3719 |
- } |
|
3720 |
- if skippy < 0 { |
|
3721 |
- return ErrInvalidLengthSnapshots |
|
3722 |
- } |
|
3723 |
- if (iNdEx + skippy) > l { |
|
3724 |
- return io.ErrUnexpectedEOF |
|
3725 |
- } |
|
3726 |
- iNdEx += skippy |
|
3727 |
- } |
|
3728 |
- } |
|
3729 |
- |
|
3730 |
- if iNdEx > l { |
|
3731 |
- return io.ErrUnexpectedEOF |
|
3732 |
- } |
|
3733 |
- return nil |
|
3734 |
-} |
|
3735 |
-func (m *ListSnapshotsRequest) Unmarshal(dAtA []byte) error { |
|
3736 |
- l := len(dAtA) |
|
3737 |
- iNdEx := 0 |
|
3738 |
- for iNdEx < l { |
|
3739 |
- preIndex := iNdEx |
|
3740 |
- var wire uint64 |
|
3741 |
- for shift := uint(0); ; shift += 7 { |
|
3742 |
- if shift >= 64 { |
|
3743 |
- return ErrIntOverflowSnapshots |
|
3744 |
- } |
|
3745 |
- if iNdEx >= l { |
|
3746 |
- return io.ErrUnexpectedEOF |
|
3747 |
- } |
|
3748 |
- b := dAtA[iNdEx] |
|
3749 |
- iNdEx++ |
|
3750 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3751 |
- if b < 0x80 { |
|
3752 |
- break |
|
3753 |
- } |
|
3754 |
- } |
|
3755 |
- fieldNum := int32(wire >> 3) |
|
3756 |
- wireType := int(wire & 0x7) |
|
3757 |
- if wireType == 4 { |
|
3758 |
- return fmt.Errorf("proto: ListSnapshotsRequest: wiretype end group for non-group") |
|
3759 |
- } |
|
3760 |
- if fieldNum <= 0 { |
|
3761 |
- return fmt.Errorf("proto: ListSnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3762 |
- } |
|
3763 |
- switch fieldNum { |
|
3764 |
- case 1: |
|
3765 |
- if wireType != 2 { |
|
3766 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3767 |
- } |
|
3768 |
- var stringLen uint64 |
|
3769 |
- for shift := uint(0); ; shift += 7 { |
|
3770 |
- if shift >= 64 { |
|
3771 |
- return ErrIntOverflowSnapshots |
|
3772 |
- } |
|
3773 |
- if iNdEx >= l { |
|
3774 |
- return io.ErrUnexpectedEOF |
|
3775 |
- } |
|
3776 |
- b := dAtA[iNdEx] |
|
3777 |
- iNdEx++ |
|
3778 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3779 |
- if b < 0x80 { |
|
3780 |
- break |
|
3781 |
- } |
|
3782 |
- } |
|
3783 |
- intStringLen := int(stringLen) |
|
3784 |
- if intStringLen < 0 { |
|
3785 |
- return ErrInvalidLengthSnapshots |
|
3786 |
- } |
|
3787 |
- postIndex := iNdEx + intStringLen |
|
3788 |
- if postIndex > l { |
|
3789 |
- return io.ErrUnexpectedEOF |
|
3790 |
- } |
|
3791 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3792 |
- iNdEx = postIndex |
|
3793 |
- default: |
|
3794 |
- iNdEx = preIndex |
|
3795 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3796 |
- if err != nil { |
|
3797 |
- return err |
|
3798 |
- } |
|
3799 |
- if skippy < 0 { |
|
3800 |
- return ErrInvalidLengthSnapshots |
|
3801 |
- } |
|
3802 |
- if (iNdEx + skippy) > l { |
|
3803 |
- return io.ErrUnexpectedEOF |
|
3804 |
- } |
|
3805 |
- iNdEx += skippy |
|
3806 |
- } |
|
3807 |
- } |
|
3808 |
- |
|
3809 |
- if iNdEx > l { |
|
3810 |
- return io.ErrUnexpectedEOF |
|
3811 |
- } |
|
3812 |
- return nil |
|
3813 |
-} |
|
3814 |
-func (m *ListSnapshotsResponse) Unmarshal(dAtA []byte) error { |
|
3815 |
- l := len(dAtA) |
|
3816 |
- iNdEx := 0 |
|
3817 |
- for iNdEx < l { |
|
3818 |
- preIndex := iNdEx |
|
3819 |
- var wire uint64 |
|
3820 |
- for shift := uint(0); ; shift += 7 { |
|
3821 |
- if shift >= 64 { |
|
3822 |
- return ErrIntOverflowSnapshots |
|
3823 |
- } |
|
3824 |
- if iNdEx >= l { |
|
3825 |
- return io.ErrUnexpectedEOF |
|
3826 |
- } |
|
3827 |
- b := dAtA[iNdEx] |
|
3828 |
- iNdEx++ |
|
3829 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3830 |
- if b < 0x80 { |
|
3831 |
- break |
|
3832 |
- } |
|
3833 |
- } |
|
3834 |
- fieldNum := int32(wire >> 3) |
|
3835 |
- wireType := int(wire & 0x7) |
|
3836 |
- if wireType == 4 { |
|
3837 |
- return fmt.Errorf("proto: ListSnapshotsResponse: wiretype end group for non-group") |
|
3838 |
- } |
|
3839 |
- if fieldNum <= 0 { |
|
3840 |
- return fmt.Errorf("proto: ListSnapshotsResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3841 |
- } |
|
3842 |
- switch fieldNum { |
|
3843 |
- case 1: |
|
3844 |
- if wireType != 2 { |
|
3845 |
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3846 |
- } |
|
3847 |
- var msglen int |
|
3848 |
- for shift := uint(0); ; shift += 7 { |
|
3849 |
- if shift >= 64 { |
|
3850 |
- return ErrIntOverflowSnapshots |
|
3851 |
- } |
|
3852 |
- if iNdEx >= l { |
|
3853 |
- return io.ErrUnexpectedEOF |
|
3854 |
- } |
|
3855 |
- b := dAtA[iNdEx] |
|
3856 |
- iNdEx++ |
|
3857 |
- msglen |= (int(b) & 0x7F) << shift |
|
3858 |
- if b < 0x80 { |
|
3859 |
- break |
|
3860 |
- } |
|
3861 |
- } |
|
3862 |
- if msglen < 0 { |
|
3863 |
- return ErrInvalidLengthSnapshots |
|
3864 |
- } |
|
3865 |
- postIndex := iNdEx + msglen |
|
3866 |
- if postIndex > l { |
|
3867 |
- return io.ErrUnexpectedEOF |
|
3868 |
- } |
|
3869 |
- m.Info = append(m.Info, Info{}) |
|
3870 |
- if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3871 |
- return err |
|
3872 |
- } |
|
3873 |
- iNdEx = postIndex |
|
3874 |
- default: |
|
3875 |
- iNdEx = preIndex |
|
3876 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3877 |
- if err != nil { |
|
3878 |
- return err |
|
3879 |
- } |
|
3880 |
- if skippy < 0 { |
|
3881 |
- return ErrInvalidLengthSnapshots |
|
3882 |
- } |
|
3883 |
- if (iNdEx + skippy) > l { |
|
3884 |
- return io.ErrUnexpectedEOF |
|
3885 |
- } |
|
3886 |
- iNdEx += skippy |
|
3887 |
- } |
|
3888 |
- } |
|
3889 |
- |
|
3890 |
- if iNdEx > l { |
|
3891 |
- return io.ErrUnexpectedEOF |
|
3892 |
- } |
|
3893 |
- return nil |
|
3894 |
-} |
|
3895 |
-func (m *UsageRequest) Unmarshal(dAtA []byte) error { |
|
3896 |
- l := len(dAtA) |
|
3897 |
- iNdEx := 0 |
|
3898 |
- for iNdEx < l { |
|
3899 |
- preIndex := iNdEx |
|
3900 |
- var wire uint64 |
|
3901 |
- for shift := uint(0); ; shift += 7 { |
|
3902 |
- if shift >= 64 { |
|
3903 |
- return ErrIntOverflowSnapshots |
|
3904 |
- } |
|
3905 |
- if iNdEx >= l { |
|
3906 |
- return io.ErrUnexpectedEOF |
|
3907 |
- } |
|
3908 |
- b := dAtA[iNdEx] |
|
3909 |
- iNdEx++ |
|
3910 |
- wire |= (uint64(b) & 0x7F) << shift |
|
3911 |
- if b < 0x80 { |
|
3912 |
- break |
|
3913 |
- } |
|
3914 |
- } |
|
3915 |
- fieldNum := int32(wire >> 3) |
|
3916 |
- wireType := int(wire & 0x7) |
|
3917 |
- if wireType == 4 { |
|
3918 |
- return fmt.Errorf("proto: UsageRequest: wiretype end group for non-group") |
|
3919 |
- } |
|
3920 |
- if fieldNum <= 0 { |
|
3921 |
- return fmt.Errorf("proto: UsageRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3922 |
- } |
|
3923 |
- switch fieldNum { |
|
3924 |
- case 1: |
|
3925 |
- if wireType != 2 { |
|
3926 |
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3927 |
- } |
|
3928 |
- var stringLen uint64 |
|
3929 |
- for shift := uint(0); ; shift += 7 { |
|
3930 |
- if shift >= 64 { |
|
3931 |
- return ErrIntOverflowSnapshots |
|
3932 |
- } |
|
3933 |
- if iNdEx >= l { |
|
3934 |
- return io.ErrUnexpectedEOF |
|
3935 |
- } |
|
3936 |
- b := dAtA[iNdEx] |
|
3937 |
- iNdEx++ |
|
3938 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3939 |
- if b < 0x80 { |
|
3940 |
- break |
|
3941 |
- } |
|
3942 |
- } |
|
3943 |
- intStringLen := int(stringLen) |
|
3944 |
- if intStringLen < 0 { |
|
3945 |
- return ErrInvalidLengthSnapshots |
|
3946 |
- } |
|
3947 |
- postIndex := iNdEx + intStringLen |
|
3948 |
- if postIndex > l { |
|
3949 |
- return io.ErrUnexpectedEOF |
|
3950 |
- } |
|
3951 |
- m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3952 |
- iNdEx = postIndex |
|
3953 |
- case 2: |
|
3954 |
- if wireType != 2 { |
|
3955 |
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
3956 |
- } |
|
3957 |
- var stringLen uint64 |
|
3958 |
- for shift := uint(0); ; shift += 7 { |
|
3959 |
- if shift >= 64 { |
|
3960 |
- return ErrIntOverflowSnapshots |
|
3961 |
- } |
|
3962 |
- if iNdEx >= l { |
|
3963 |
- return io.ErrUnexpectedEOF |
|
3964 |
- } |
|
3965 |
- b := dAtA[iNdEx] |
|
3966 |
- iNdEx++ |
|
3967 |
- stringLen |= (uint64(b) & 0x7F) << shift |
|
3968 |
- if b < 0x80 { |
|
3969 |
- break |
|
3970 |
- } |
|
3971 |
- } |
|
3972 |
- intStringLen := int(stringLen) |
|
3973 |
- if intStringLen < 0 { |
|
3974 |
- return ErrInvalidLengthSnapshots |
|
3975 |
- } |
|
3976 |
- postIndex := iNdEx + intStringLen |
|
3977 |
- if postIndex > l { |
|
3978 |
- return io.ErrUnexpectedEOF |
|
3979 |
- } |
|
3980 |
- m.Key = string(dAtA[iNdEx:postIndex]) |
|
3981 |
- iNdEx = postIndex |
|
3982 |
- default: |
|
3983 |
- iNdEx = preIndex |
|
3984 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3985 |
- if err != nil { |
|
3986 |
- return err |
|
3987 |
- } |
|
3988 |
- if skippy < 0 { |
|
3989 |
- return ErrInvalidLengthSnapshots |
|
3990 |
- } |
|
3991 |
- if (iNdEx + skippy) > l { |
|
3992 |
- return io.ErrUnexpectedEOF |
|
3993 |
- } |
|
3994 |
- iNdEx += skippy |
|
3995 |
- } |
|
3996 |
- } |
|
3997 |
- |
|
3998 |
- if iNdEx > l { |
|
3999 |
- return io.ErrUnexpectedEOF |
|
4000 |
- } |
|
4001 |
- return nil |
|
4002 |
-} |
|
4003 |
-func (m *UsageResponse) Unmarshal(dAtA []byte) error { |
|
4004 |
- l := len(dAtA) |
|
4005 |
- iNdEx := 0 |
|
4006 |
- for iNdEx < l { |
|
4007 |
- preIndex := iNdEx |
|
4008 |
- var wire uint64 |
|
4009 |
- for shift := uint(0); ; shift += 7 { |
|
4010 |
- if shift >= 64 { |
|
4011 |
- return ErrIntOverflowSnapshots |
|
4012 |
- } |
|
4013 |
- if iNdEx >= l { |
|
4014 |
- return io.ErrUnexpectedEOF |
|
4015 |
- } |
|
4016 |
- b := dAtA[iNdEx] |
|
4017 |
- iNdEx++ |
|
4018 |
- wire |= (uint64(b) & 0x7F) << shift |
|
4019 |
- if b < 0x80 { |
|
4020 |
- break |
|
4021 |
- } |
|
4022 |
- } |
|
4023 |
- fieldNum := int32(wire >> 3) |
|
4024 |
- wireType := int(wire & 0x7) |
|
4025 |
- if wireType == 4 { |
|
4026 |
- return fmt.Errorf("proto: UsageResponse: wiretype end group for non-group") |
|
4027 |
- } |
|
4028 |
- if fieldNum <= 0 { |
|
4029 |
- return fmt.Errorf("proto: UsageResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
4030 |
- } |
|
4031 |
- switch fieldNum { |
|
4032 |
- case 1: |
|
4033 |
- if wireType != 0 { |
|
4034 |
- return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) |
|
4035 |
- } |
|
4036 |
- m.Size_ = 0 |
|
4037 |
- for shift := uint(0); ; shift += 7 { |
|
4038 |
- if shift >= 64 { |
|
4039 |
- return ErrIntOverflowSnapshots |
|
4040 |
- } |
|
4041 |
- if iNdEx >= l { |
|
4042 |
- return io.ErrUnexpectedEOF |
|
4043 |
- } |
|
4044 |
- b := dAtA[iNdEx] |
|
4045 |
- iNdEx++ |
|
4046 |
- m.Size_ |= (int64(b) & 0x7F) << shift |
|
4047 |
- if b < 0x80 { |
|
4048 |
- break |
|
4049 |
- } |
|
4050 |
- } |
|
4051 |
- case 2: |
|
4052 |
- if wireType != 0 { |
|
4053 |
- return fmt.Errorf("proto: wrong wireType = %d for field Inodes", wireType) |
|
4054 |
- } |
|
4055 |
- m.Inodes = 0 |
|
4056 |
- for shift := uint(0); ; shift += 7 { |
|
4057 |
- if shift >= 64 { |
|
4058 |
- return ErrIntOverflowSnapshots |
|
4059 |
- } |
|
4060 |
- if iNdEx >= l { |
|
4061 |
- return io.ErrUnexpectedEOF |
|
4062 |
- } |
|
4063 |
- b := dAtA[iNdEx] |
|
4064 |
- iNdEx++ |
|
4065 |
- m.Inodes |= (int64(b) & 0x7F) << shift |
|
4066 |
- if b < 0x80 { |
|
4067 |
- break |
|
4068 |
- } |
|
4069 |
- } |
|
4070 |
- default: |
|
4071 |
- iNdEx = preIndex |
|
4072 |
- skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
4073 |
- if err != nil { |
|
4074 |
- return err |
|
4075 |
- } |
|
4076 |
- if skippy < 0 { |
|
4077 |
- return ErrInvalidLengthSnapshots |
|
4078 |
- } |
|
4079 |
- if (iNdEx + skippy) > l { |
|
4080 |
- return io.ErrUnexpectedEOF |
|
4081 |
- } |
|
4082 |
- iNdEx += skippy |
|
4083 |
- } |
|
4084 |
- } |
|
4085 |
- |
|
4086 |
- if iNdEx > l { |
|
4087 |
- return io.ErrUnexpectedEOF |
|
4088 |
- } |
|
4089 |
- return nil |
|
4090 |
-} |
|
4091 |
-func skipSnapshots(dAtA []byte) (n int, err error) { |
|
4092 |
- l := len(dAtA) |
|
4093 |
- iNdEx := 0 |
|
4094 |
- for iNdEx < l { |
|
4095 |
- var wire uint64 |
|
4096 |
- for shift := uint(0); ; shift += 7 { |
|
4097 |
- if shift >= 64 { |
|
4098 |
- return 0, ErrIntOverflowSnapshots |
|
4099 |
- } |
|
4100 |
- if iNdEx >= l { |
|
4101 |
- return 0, io.ErrUnexpectedEOF |
|
4102 |
- } |
|
4103 |
- b := dAtA[iNdEx] |
|
4104 |
- iNdEx++ |
|
4105 |
- wire |= (uint64(b) & 0x7F) << shift |
|
4106 |
- if b < 0x80 { |
|
4107 |
- break |
|
4108 |
- } |
|
4109 |
- } |
|
4110 |
- wireType := int(wire & 0x7) |
|
4111 |
- switch wireType { |
|
4112 |
- case 0: |
|
4113 |
- for shift := uint(0); ; shift += 7 { |
|
4114 |
- if shift >= 64 { |
|
4115 |
- return 0, ErrIntOverflowSnapshots |
|
4116 |
- } |
|
4117 |
- if iNdEx >= l { |
|
4118 |
- return 0, io.ErrUnexpectedEOF |
|
4119 |
- } |
|
4120 |
- iNdEx++ |
|
4121 |
- if dAtA[iNdEx-1] < 0x80 { |
|
4122 |
- break |
|
4123 |
- } |
|
4124 |
- } |
|
4125 |
- return iNdEx, nil |
|
4126 |
- case 1: |
|
4127 |
- iNdEx += 8 |
|
4128 |
- return iNdEx, nil |
|
4129 |
- case 2: |
|
4130 |
- var length int |
|
4131 |
- for shift := uint(0); ; shift += 7 { |
|
4132 |
- if shift >= 64 { |
|
4133 |
- return 0, ErrIntOverflowSnapshots |
|
4134 |
- } |
|
4135 |
- if iNdEx >= l { |
|
4136 |
- return 0, io.ErrUnexpectedEOF |
|
4137 |
- } |
|
4138 |
- b := dAtA[iNdEx] |
|
4139 |
- iNdEx++ |
|
4140 |
- length |= (int(b) & 0x7F) << shift |
|
4141 |
- if b < 0x80 { |
|
4142 |
- break |
|
4143 |
- } |
|
4144 |
- } |
|
4145 |
- iNdEx += length |
|
4146 |
- if length < 0 { |
|
4147 |
- return 0, ErrInvalidLengthSnapshots |
|
4148 |
- } |
|
4149 |
- return iNdEx, nil |
|
4150 |
- case 3: |
|
4151 |
- for { |
|
4152 |
- var innerWire uint64 |
|
4153 |
- var start int = iNdEx |
|
4154 |
- for shift := uint(0); ; shift += 7 { |
|
4155 |
- if shift >= 64 { |
|
4156 |
- return 0, ErrIntOverflowSnapshots |
|
4157 |
- } |
|
4158 |
- if iNdEx >= l { |
|
4159 |
- return 0, io.ErrUnexpectedEOF |
|
4160 |
- } |
|
4161 |
- b := dAtA[iNdEx] |
|
4162 |
- iNdEx++ |
|
4163 |
- innerWire |= (uint64(b) & 0x7F) << shift |
|
4164 |
- if b < 0x80 { |
|
4165 |
- break |
|
4166 |
- } |
|
4167 |
- } |
|
4168 |
- innerWireType := int(innerWire & 0x7) |
|
4169 |
- if innerWireType == 4 { |
|
4170 |
- break |
|
4171 |
- } |
|
4172 |
- next, err := skipSnapshots(dAtA[start:]) |
|
4173 |
- if err != nil { |
|
4174 |
- return 0, err |
|
4175 |
- } |
|
4176 |
- iNdEx = start + next |
|
4177 |
- } |
|
4178 |
- return iNdEx, nil |
|
4179 |
- case 4: |
|
4180 |
- return iNdEx, nil |
|
4181 |
- case 5: |
|
4182 |
- iNdEx += 4 |
|
4183 |
- return iNdEx, nil |
|
4184 |
- default: |
|
4185 |
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
|
4186 |
- } |
|
4187 |
- } |
|
4188 |
- panic("unreachable") |
|
4189 |
-} |
|
4190 |
- |
|
4191 |
-var ( |
|
4192 |
- ErrInvalidLengthSnapshots = fmt.Errorf("proto: negative length found during unmarshaling") |
|
4193 |
- ErrIntOverflowSnapshots = fmt.Errorf("proto: integer overflow") |
|
4194 |
-) |
|
4195 |
- |
|
4196 |
-func init() { |
|
4197 |
- proto.RegisterFile("github.com/containerd/containerd/api/services/snapshot/v1/snapshots.proto", fileDescriptorSnapshots) |
|
4198 |
-} |
|
4199 |
- |
|
4200 |
-var fileDescriptorSnapshots = []byte{ |
|
4201 |
- // 1006 bytes of a gzipped FileDescriptorProto |
|
4202 |
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1a, 0x47, |
|
4203 |
- 0x14, 0x67, 0x60, 0x8d, 0xe3, 0x87, 0xed, 0xd2, 0x09, 0x26, 0x68, 0x5b, 0xe1, 0x15, 0x87, 0xca, |
|
4204 |
- 0xea, 0x61, 0x37, 0xa1, 0x6a, 0xe2, 0xc4, 0x97, 0x02, 0xa1, 0x15, 0x71, 0xec, 0x54, 0x1b, 0xdb, |
|
4205 |
- 0x89, 0xd3, 0x48, 0xd1, 0x1a, 0xc6, 0x78, 0x05, 0xbb, 0x4b, 0x99, 0x81, 0x88, 0x56, 0xaa, 0x7a, |
|
4206 |
- 0x8c, 0x7c, 0xea, 0x17, 0xf0, 0xa9, 0xfd, 0x10, 0x55, 0x3f, 0x81, 0x8f, 0x3d, 0xf6, 0xd4, 0x36, |
|
4207 |
- 0xfe, 0x12, 0x3d, 0xf5, 0x8f, 0x66, 0x76, 0x16, 0x30, 0xa6, 0x62, 0xc1, 0xe4, 0xf6, 0x76, 0x66, |
|
4208 |
- 0xde, 0x7b, 0xbf, 0xf7, 0x7b, 0xf3, 0xde, 0x9b, 0x85, 0x4a, 0xdd, 0x66, 0x27, 0x9d, 0x23, 0xbd, |
|
4209 |
- 0xea, 0x39, 0x46, 0xd5, 0x73, 0x99, 0x65, 0xbb, 0xa4, 0x5d, 0x1b, 0x16, 0xad, 0x96, 0x6d, 0x50, |
|
4210 |
- 0xd2, 0xee, 0xda, 0x55, 0x42, 0x0d, 0xea, 0x5a, 0x2d, 0x7a, 0xe2, 0x31, 0xa3, 0x7b, 0xa7, 0x2f, |
|
4211 |
- 0x53, 0xbd, 0xd5, 0xf6, 0x98, 0x87, 0xb5, 0x81, 0x92, 0x1e, 0x28, 0xe8, 0x83, 0x43, 0xdd, 0x3b, |
|
4212 |
- 0x6a, 0xaa, 0xee, 0xd5, 0x3d, 0x71, 0xd8, 0xe0, 0x92, 0xaf, 0xa7, 0x7e, 0x50, 0xf7, 0xbc, 0x7a, |
|
4213 |
- 0x93, 0x18, 0xe2, 0xeb, 0xa8, 0x73, 0x6c, 0x10, 0xa7, 0xc5, 0x7a, 0x72, 0x53, 0x1b, 0xdd, 0x3c, |
|
4214 |
- 0xb6, 0x49, 0xb3, 0xf6, 0xca, 0xb1, 0x68, 0x43, 0x9e, 0x58, 0x1f, 0x3d, 0xc1, 0x6c, 0x87, 0x50, |
|
4215 |
- 0x66, 0x39, 0x2d, 0x79, 0xe0, 0x6e, 0xa8, 0x10, 0x59, 0xaf, 0x45, 0xa8, 0xe1, 0x78, 0x1d, 0x97, |
|
4216 |
- 0xf9, 0x7a, 0xb9, 0xbf, 0x11, 0xa4, 0xbf, 0x6c, 0x93, 0x96, 0xd5, 0x26, 0x4f, 0x65, 0x14, 0x26, |
|
4217 |
- 0xf9, 0xba, 0x43, 0x28, 0xc3, 0x1a, 0x24, 0x82, 0xc0, 0x18, 0x69, 0x67, 0x90, 0x86, 0x36, 0x96, |
|
4218 |
- 0xcc, 0xe1, 0x25, 0x9c, 0x84, 0x58, 0x83, 0xf4, 0x32, 0x51, 0xb1, 0xc3, 0x45, 0x9c, 0x86, 0x38, |
|
4219 |
- 0x37, 0xe5, 0xb2, 0x4c, 0x4c, 0x2c, 0xca, 0x2f, 0xfc, 0x12, 0xe2, 0x4d, 0xeb, 0x88, 0x34, 0x69, |
|
4220 |
- 0x46, 0xd1, 0x62, 0x1b, 0x89, 0xfc, 0x43, 0x7d, 0x12, 0x8f, 0xfa, 0x78, 0x54, 0xfa, 0x63, 0x61, |
|
4221 |
- 0xa6, 0xec, 0xb2, 0x76, 0xcf, 0x94, 0x36, 0xd5, 0xfb, 0x90, 0x18, 0x5a, 0x0e, 0x60, 0xa1, 0x01, |
|
4222 |
- 0xac, 0x14, 0x2c, 0x74, 0xad, 0x66, 0x87, 0x48, 0xa8, 0xfe, 0xc7, 0x83, 0xe8, 0x26, 0xca, 0x3d, |
|
4223 |
- 0x82, 0x5b, 0x57, 0x1c, 0xd1, 0x96, 0xe7, 0x52, 0x82, 0x0d, 0x88, 0x0b, 0xa6, 0x68, 0x06, 0x09, |
|
4224 |
- 0xcc, 0xb7, 0x86, 0x31, 0x0b, 0x26, 0xf5, 0x1d, 0xbe, 0x6f, 0xca, 0x63, 0xb9, 0xbf, 0x10, 0xdc, |
|
4225 |
- 0x3c, 0xb0, 0xc9, 0xeb, 0x77, 0x49, 0xe4, 0xe1, 0x08, 0x91, 0x85, 0xc9, 0x44, 0x8e, 0x81, 0x34, |
|
4226 |
- 0x6f, 0x16, 0xbf, 0x80, 0xd4, 0x65, 0x2f, 0xb3, 0x52, 0x58, 0x82, 0x15, 0xb1, 0x40, 0xaf, 0xc1, |
|
4227 |
- 0x5d, 0xae, 0x00, 0xab, 0x81, 0x91, 0x59, 0x71, 0x6c, 0xc3, 0x9a, 0x49, 0x1c, 0xaf, 0x3b, 0x8f, |
|
4228 |
- 0xa2, 0xe0, 0xf7, 0x62, 0xad, 0xe4, 0x39, 0x8e, 0xcd, 0xa6, 0xb7, 0x86, 0x41, 0x71, 0x2d, 0x27, |
|
4229 |
- 0xa0, 0x5c, 0xc8, 0x81, 0x87, 0xd8, 0x20, 0x33, 0x5f, 0x8d, 0xdc, 0x8a, 0xd2, 0xe4, 0x5b, 0x31, |
|
4230 |
- 0x16, 0xd0, 0xbc, 0xef, 0x45, 0x05, 0x6e, 0x3e, 0x65, 0x16, 0x9b, 0x07, 0x89, 0xff, 0x46, 0x41, |
|
4231 |
- 0xa9, 0xb8, 0xc7, 0x5e, 0x9f, 0x11, 0x34, 0xc4, 0xc8, 0xa0, 0x5a, 0xa2, 0x97, 0xaa, 0xe5, 0x01, |
|
4232 |
- 0x28, 0x0d, 0xdb, 0xad, 0x09, 0xaa, 0x56, 0xf3, 0x1f, 0x4d, 0x66, 0x65, 0xdb, 0x76, 0x6b, 0xa6, |
|
4233 |
- 0xd0, 0xc1, 0x25, 0x80, 0x6a, 0x9b, 0x58, 0x8c, 0xd4, 0x5e, 0x59, 0x2c, 0xa3, 0x68, 0x68, 0x23, |
|
4234 |
- 0x91, 0x57, 0x75, 0xbf, 0x0f, 0xeb, 0x41, 0x1f, 0xd6, 0xf7, 0x82, 0x3e, 0x5c, 0xbc, 0x71, 0xfe, |
|
4235 |
- 0xfb, 0x7a, 0xe4, 0x87, 0x3f, 0xd6, 0x91, 0xb9, 0x24, 0xf5, 0x0a, 0x8c, 0x1b, 0xe9, 0xb4, 0x6a, |
|
4236 |
- 0x81, 0x91, 0x85, 0x69, 0x8c, 0x48, 0xbd, 0x02, 0xc3, 0x8f, 0xfa, 0xd9, 0x8d, 0x8b, 0xec, 0xe6, |
|
4237 |
- 0x27, 0xc7, 0xc1, 0x99, 0x9a, 0x77, 0x32, 0x9f, 0x43, 0xea, 0x72, 0x32, 0x65, 0x71, 0x7d, 0x06, |
|
4238 |
- 0x8a, 0xed, 0x1e, 0x7b, 0xc2, 0x48, 0x22, 0x0c, 0xc9, 0x1c, 0x5c, 0x51, 0xe1, 0x91, 0x9a, 0x42, |
|
4239 |
- 0x33, 0xf7, 0x33, 0x82, 0xb5, 0x7d, 0x11, 0xee, 0xf4, 0x37, 0x25, 0xf0, 0x1e, 0x9d, 0xd5, 0x3b, |
|
4240 |
- 0xde, 0x82, 0x84, 0xcf, 0xb5, 0x18, 0xb8, 0xe2, 0xae, 0x8c, 0x4b, 0xd2, 0xe7, 0x7c, 0x26, 0xef, |
|
4241 |
- 0x58, 0xb4, 0x61, 0xca, 0x94, 0x72, 0x39, 0xf7, 0x02, 0xd2, 0xa3, 0xc8, 0xe7, 0x46, 0xcb, 0x26, |
|
4242 |
- 0xa4, 0x1e, 0xdb, 0xb4, 0x4f, 0x78, 0xf8, 0x9e, 0x98, 0x3b, 0x84, 0xb5, 0x11, 0xcd, 0x2b, 0xa0, |
|
4243 |
- 0x62, 0x33, 0x82, 0x2a, 0xc2, 0xf2, 0x3e, 0xb5, 0xea, 0xe4, 0x3a, 0xb5, 0xbc, 0x05, 0x2b, 0xd2, |
|
4244 |
- 0x86, 0x84, 0x85, 0x41, 0xa1, 0xf6, 0x37, 0x7e, 0x4d, 0xc7, 0x4c, 0x21, 0xf3, 0x9a, 0xb6, 0x5d, |
|
4245 |
- 0xaf, 0x46, 0xa8, 0xd0, 0x8c, 0x99, 0xf2, 0xeb, 0xe3, 0x37, 0x08, 0x14, 0x5e, 0xa6, 0xf8, 0x43, |
|
4246 |
- 0x58, 0xdc, 0xdf, 0xdd, 0xde, 0x7d, 0xf2, 0x6c, 0x37, 0x19, 0x51, 0xdf, 0x3b, 0x3d, 0xd3, 0x12, |
|
4247 |
- 0x7c, 0x79, 0xdf, 0x6d, 0xb8, 0xde, 0x6b, 0x17, 0xa7, 0x41, 0x39, 0xa8, 0x94, 0x9f, 0x25, 0x91, |
|
4248 |
- 0xba, 0x7c, 0x7a, 0xa6, 0xdd, 0xe0, 0x5b, 0x7c, 0x44, 0x61, 0x15, 0xe2, 0x85, 0xd2, 0x5e, 0xe5, |
|
4249 |
- 0xa0, 0x9c, 0x8c, 0xaa, 0xab, 0xa7, 0x67, 0x1a, 0xf0, 0x9d, 0x42, 0x95, 0xd9, 0x5d, 0x82, 0x35, |
|
4250 |
- 0x58, 0x2a, 0x3d, 0xd9, 0xd9, 0xa9, 0xec, 0xed, 0x95, 0x1f, 0x26, 0x63, 0xea, 0xfb, 0xa7, 0x67, |
|
4251 |
- 0xda, 0x0a, 0xdf, 0xf6, 0x7b, 0x25, 0x23, 0x35, 0x75, 0xf9, 0xcd, 0x8f, 0xd9, 0xc8, 0x2f, 0x3f, |
|
4252 |
- 0x65, 0x05, 0x82, 0xfc, 0x3f, 0x8b, 0xb0, 0xd4, 0xe7, 0x18, 0x7f, 0x07, 0x8b, 0xf2, 0x29, 0x81, |
|
4253 |
- 0x37, 0x67, 0x7d, 0xde, 0xa8, 0xf7, 0x67, 0xd0, 0x94, 0x24, 0x76, 0x40, 0x11, 0x11, 0x7e, 0x3a, |
|
4254 |
- 0xd3, 0x93, 0x40, 0xbd, 0x3b, 0xad, 0x9a, 0x74, 0xdb, 0x80, 0xb8, 0x3f, 0x6d, 0xb1, 0x31, 0xd9, |
|
4255 |
- 0xc2, 0xa5, 0xe1, 0xae, 0xde, 0x0e, 0xaf, 0x20, 0x9d, 0x1d, 0x42, 0xdc, 0x4f, 0x06, 0xbe, 0x37, |
|
4256 |
- 0xe3, 0x88, 0x53, 0xd3, 0x57, 0x2a, 0xbb, 0xcc, 0x9f, 0xe2, 0xdc, 0xb4, 0x3f, 0xf2, 0xc3, 0x98, |
|
4257 |
- 0x1e, 0xfb, 0x38, 0xf8, 0x5f, 0xd3, 0x1d, 0x50, 0x78, 0xe7, 0x0c, 0x93, 0x99, 0x31, 0xe3, 0x32, |
|
4258 |
- 0x4c, 0x66, 0xc6, 0x36, 0xe6, 0x6f, 0x21, 0xee, 0xf7, 0xa6, 0x30, 0x11, 0x8d, 0xed, 0xbf, 0xea, |
|
4259 |
- 0xe6, 0xf4, 0x8a, 0xd2, 0x79, 0x0f, 0x14, 0xde, 0x82, 0x70, 0x08, 0xf0, 0xe3, 0x9a, 0x9c, 0x7a, |
|
4260 |
- 0x6f, 0x6a, 0x3d, 0xdf, 0xf1, 0x6d, 0x84, 0x4f, 0x60, 0x41, 0xb4, 0x17, 0xac, 0x87, 0x40, 0x3f, |
|
4261 |
- 0xd4, 0xcb, 0x54, 0x23, 0xf4, 0x79, 0xdf, 0x57, 0xf1, 0xe5, 0xf9, 0xdb, 0x6c, 0xe4, 0xb7, 0xb7, |
|
4262 |
- 0xd9, 0xc8, 0xf7, 0x17, 0x59, 0x74, 0x7e, 0x91, 0x45, 0xbf, 0x5e, 0x64, 0xd1, 0x9f, 0x17, 0x59, |
|
4263 |
- 0xf4, 0xa2, 0x38, 0xf3, 0x2f, 0xe7, 0x56, 0x20, 0x3f, 0x8f, 0x1c, 0xc5, 0xc5, 0x45, 0xfa, 0xe4, |
|
4264 |
- 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0x58, 0xc4, 0xcf, 0xc1, 0x0e, 0x00, 0x00, |
|
4265 |
-} |
4266 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,150 +0,0 @@ |
1 |
-syntax = "proto3"; |
|
2 |
- |
|
3 |
-package containerd.services.snapshots.v1; |
|
4 |
- |
|
5 |
-import weak "gogoproto/gogo.proto"; |
|
6 |
-import "google/protobuf/empty.proto"; |
|
7 |
-import "google/protobuf/field_mask.proto"; |
|
8 |
-import "google/protobuf/timestamp.proto"; |
|
9 |
-import "github.com/containerd/containerd/api/types/mount.proto"; |
|
10 |
- |
|
11 |
-option go_package = "github.com/containerd/containerd/api/services/snapshot/v1;snapshot"; |
|
12 |
- |
|
13 |
-// Snapshot service manages snapshots |
|
14 |
-service Snapshots { |
|
15 |
- rpc Prepare(PrepareSnapshotRequest) returns (PrepareSnapshotResponse); |
|
16 |
- rpc View(ViewSnapshotRequest) returns (ViewSnapshotResponse); |
|
17 |
- rpc Mounts(MountsRequest) returns (MountsResponse); |
|
18 |
- rpc Commit(CommitSnapshotRequest) returns (google.protobuf.Empty); |
|
19 |
- rpc Remove(RemoveSnapshotRequest) returns (google.protobuf.Empty); |
|
20 |
- rpc Stat(StatSnapshotRequest) returns (StatSnapshotResponse); |
|
21 |
- rpc Update(UpdateSnapshotRequest) returns (UpdateSnapshotResponse); |
|
22 |
- rpc List(ListSnapshotsRequest) returns (stream ListSnapshotsResponse); |
|
23 |
- rpc Usage(UsageRequest) returns (UsageResponse); |
|
24 |
-} |
|
25 |
- |
|
26 |
-message PrepareSnapshotRequest { |
|
27 |
- string snapshotter = 1; |
|
28 |
- string key = 2; |
|
29 |
- string parent = 3; |
|
30 |
- |
|
31 |
- // Labels are arbitrary data on snapshots. |
|
32 |
- // |
|
33 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
34 |
- map<string, string> labels = 4; |
|
35 |
-} |
|
36 |
- |
|
37 |
-message PrepareSnapshotResponse { |
|
38 |
- repeated containerd.types.Mount mounts = 1; |
|
39 |
-} |
|
40 |
- |
|
41 |
-message ViewSnapshotRequest { |
|
42 |
- string snapshotter = 1; |
|
43 |
- string key = 2; |
|
44 |
- string parent = 3; |
|
45 |
- |
|
46 |
- // Labels are arbitrary data on snapshots. |
|
47 |
- // |
|
48 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
49 |
- map<string, string> labels = 4; |
|
50 |
-} |
|
51 |
- |
|
52 |
-message ViewSnapshotResponse { |
|
53 |
- repeated containerd.types.Mount mounts = 1; |
|
54 |
-} |
|
55 |
- |
|
56 |
-message MountsRequest { |
|
57 |
- string snapshotter = 1; |
|
58 |
- string key = 2; |
|
59 |
-} |
|
60 |
- |
|
61 |
-message MountsResponse { |
|
62 |
- repeated containerd.types.Mount mounts = 1; |
|
63 |
-} |
|
64 |
- |
|
65 |
-message RemoveSnapshotRequest { |
|
66 |
- string snapshotter = 1; |
|
67 |
- string key = 2; |
|
68 |
-} |
|
69 |
- |
|
70 |
-message CommitSnapshotRequest { |
|
71 |
- string snapshotter = 1; |
|
72 |
- string name = 2; |
|
73 |
- string key = 3; |
|
74 |
- |
|
75 |
- // Labels are arbitrary data on snapshots. |
|
76 |
- // |
|
77 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
78 |
- map<string, string> labels = 4; |
|
79 |
-} |
|
80 |
- |
|
81 |
-message StatSnapshotRequest { |
|
82 |
- string snapshotter = 1; |
|
83 |
- string key = 2; |
|
84 |
-} |
|
85 |
- |
|
86 |
-enum Kind { |
|
87 |
- option (gogoproto.goproto_enum_prefix) = false; |
|
88 |
- option (gogoproto.enum_customname) = "Kind"; |
|
89 |
- |
|
90 |
- UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "KindUnknown"]; |
|
91 |
- VIEW = 1 [(gogoproto.enumvalue_customname) = "KindView"]; |
|
92 |
- ACTIVE = 2 [(gogoproto.enumvalue_customname) = "KindActive"]; |
|
93 |
- COMMITTED = 3 [(gogoproto.enumvalue_customname) = "KindCommitted"]; |
|
94 |
-} |
|
95 |
- |
|
96 |
-message Info { |
|
97 |
- string name = 1; |
|
98 |
- string parent = 2; |
|
99 |
- Kind kind = 3; |
|
100 |
- |
|
101 |
- // CreatedAt provides the time at which the snapshot was created. |
|
102 |
- google.protobuf.Timestamp created_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; |
|
103 |
- |
|
104 |
- // UpdatedAt provides the time the info was last updated. |
|
105 |
- google.protobuf.Timestamp updated_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; |
|
106 |
- |
|
107 |
- // Labels are arbitrary data on snapshots. |
|
108 |
- // |
|
109 |
- // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
110 |
- map<string, string> labels = 6; |
|
111 |
-} |
|
112 |
- |
|
113 |
-message StatSnapshotResponse { |
|
114 |
- Info info = 1 [(gogoproto.nullable) = false]; |
|
115 |
-} |
|
116 |
- |
|
117 |
-message UpdateSnapshotRequest { |
|
118 |
- string snapshotter = 1; |
|
119 |
- Info info = 2 [(gogoproto.nullable) = false]; |
|
120 |
- |
|
121 |
- // UpdateMask specifies which fields to perform the update on. If empty, |
|
122 |
- // the operation applies to all fields. |
|
123 |
- // |
|
124 |
- // In info, Name, Parent, Kind, Created are immutable, |
|
125 |
- // other field may be updated using this mask. |
|
126 |
- // If no mask is provided, all mutable field are updated. |
|
127 |
- google.protobuf.FieldMask update_mask = 3; |
|
128 |
-} |
|
129 |
- |
|
130 |
-message UpdateSnapshotResponse { |
|
131 |
- Info info = 1 [(gogoproto.nullable) = false]; |
|
132 |
-} |
|
133 |
- |
|
134 |
-message ListSnapshotsRequest{ |
|
135 |
- string snapshotter = 1; |
|
136 |
-} |
|
137 |
- |
|
138 |
-message ListSnapshotsResponse { |
|
139 |
- repeated Info info = 1 [(gogoproto.nullable) = false]; |
|
140 |
-} |
|
141 |
- |
|
142 |
-message UsageRequest { |
|
143 |
- string snapshotter = 1; |
|
144 |
- string key = 2; |
|
145 |
-} |
|
146 |
- |
|
147 |
-message UsageResponse { |
|
148 |
- int64 size = 1; |
|
149 |
- int64 inodes = 2; |
|
150 |
-} |
151 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,4265 @@ |
0 |
+// Code generated by protoc-gen-gogo. DO NOT EDIT. |
|
1 |
+// source: github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto |
|
2 |
+ |
|
3 |
+/* |
|
4 |
+ Package snapshots is a generated protocol buffer package. |
|
5 |
+ |
|
6 |
+ It is generated from these files: |
|
7 |
+ github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto |
|
8 |
+ |
|
9 |
+ It has these top-level messages: |
|
10 |
+ PrepareSnapshotRequest |
|
11 |
+ PrepareSnapshotResponse |
|
12 |
+ ViewSnapshotRequest |
|
13 |
+ ViewSnapshotResponse |
|
14 |
+ MountsRequest |
|
15 |
+ MountsResponse |
|
16 |
+ RemoveSnapshotRequest |
|
17 |
+ CommitSnapshotRequest |
|
18 |
+ StatSnapshotRequest |
|
19 |
+ Info |
|
20 |
+ StatSnapshotResponse |
|
21 |
+ UpdateSnapshotRequest |
|
22 |
+ UpdateSnapshotResponse |
|
23 |
+ ListSnapshotsRequest |
|
24 |
+ ListSnapshotsResponse |
|
25 |
+ UsageRequest |
|
26 |
+ UsageResponse |
|
27 |
+*/ |
|
28 |
+package snapshots |
|
29 |
+ |
|
30 |
+import proto "github.com/gogo/protobuf/proto" |
|
31 |
+import fmt "fmt" |
|
32 |
+import math "math" |
|
33 |
+ |
|
34 |
+// skipping weak import gogoproto "github.com/gogo/protobuf/gogoproto" |
|
35 |
+import google_protobuf1 "github.com/gogo/protobuf/types" |
|
36 |
+import google_protobuf2 "github.com/gogo/protobuf/types" |
|
37 |
+import _ "github.com/gogo/protobuf/types" |
|
38 |
+import containerd_types "github.com/containerd/containerd/api/types" |
|
39 |
+ |
|
40 |
+import time "time" |
|
41 |
+ |
|
42 |
+import ( |
|
43 |
+ context "golang.org/x/net/context" |
|
44 |
+ grpc "google.golang.org/grpc" |
|
45 |
+) |
|
46 |
+ |
|
47 |
+import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" |
|
48 |
+ |
|
49 |
+import strings "strings" |
|
50 |
+import reflect "reflect" |
|
51 |
+import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" |
|
52 |
+ |
|
53 |
+import io "io" |
|
54 |
+ |
|
55 |
+// Reference imports to suppress errors if they are not otherwise used. |
|
56 |
+var _ = proto.Marshal |
|
57 |
+var _ = fmt.Errorf |
|
58 |
+var _ = math.Inf |
|
59 |
+var _ = time.Kitchen |
|
60 |
+ |
|
61 |
+// This is a compile-time assertion to ensure that this generated file |
|
62 |
+// is compatible with the proto package it is being compiled against. |
|
63 |
+// A compilation error at this line likely means your copy of the |
|
64 |
+// proto package needs to be updated. |
|
65 |
+const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package |
|
66 |
+ |
|
67 |
+type Kind int32 |
|
68 |
+ |
|
69 |
+const ( |
|
70 |
+ KindUnknown Kind = 0 |
|
71 |
+ KindView Kind = 1 |
|
72 |
+ KindActive Kind = 2 |
|
73 |
+ KindCommitted Kind = 3 |
|
74 |
+) |
|
75 |
+ |
|
76 |
+var Kind_name = map[int32]string{ |
|
77 |
+ 0: "UNKNOWN", |
|
78 |
+ 1: "VIEW", |
|
79 |
+ 2: "ACTIVE", |
|
80 |
+ 3: "COMMITTED", |
|
81 |
+} |
|
82 |
+var Kind_value = map[string]int32{ |
|
83 |
+ "UNKNOWN": 0, |
|
84 |
+ "VIEW": 1, |
|
85 |
+ "ACTIVE": 2, |
|
86 |
+ "COMMITTED": 3, |
|
87 |
+} |
|
88 |
+ |
|
89 |
+func (x Kind) String() string { |
|
90 |
+ return proto.EnumName(Kind_name, int32(x)) |
|
91 |
+} |
|
92 |
+func (Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{0} } |
|
93 |
+ |
|
94 |
+type PrepareSnapshotRequest struct { |
|
95 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
96 |
+ Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
97 |
+ Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` |
|
98 |
+ // Labels are arbitrary data on snapshots. |
|
99 |
+ // |
|
100 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
101 |
+ Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
102 |
+} |
|
103 |
+ |
|
104 |
+func (m *PrepareSnapshotRequest) Reset() { *m = PrepareSnapshotRequest{} } |
|
105 |
+func (*PrepareSnapshotRequest) ProtoMessage() {} |
|
106 |
+func (*PrepareSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{0} } |
|
107 |
+ |
|
108 |
+type PrepareSnapshotResponse struct { |
|
109 |
+ Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"` |
|
110 |
+} |
|
111 |
+ |
|
112 |
+func (m *PrepareSnapshotResponse) Reset() { *m = PrepareSnapshotResponse{} } |
|
113 |
+func (*PrepareSnapshotResponse) ProtoMessage() {} |
|
114 |
+func (*PrepareSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{1} } |
|
115 |
+ |
|
116 |
+type ViewSnapshotRequest struct { |
|
117 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
118 |
+ Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
119 |
+ Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"` |
|
120 |
+ // Labels are arbitrary data on snapshots. |
|
121 |
+ // |
|
122 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
123 |
+ Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
124 |
+} |
|
125 |
+ |
|
126 |
+func (m *ViewSnapshotRequest) Reset() { *m = ViewSnapshotRequest{} } |
|
127 |
+func (*ViewSnapshotRequest) ProtoMessage() {} |
|
128 |
+func (*ViewSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{2} } |
|
129 |
+ |
|
130 |
+type ViewSnapshotResponse struct { |
|
131 |
+ Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"` |
|
132 |
+} |
|
133 |
+ |
|
134 |
+func (m *ViewSnapshotResponse) Reset() { *m = ViewSnapshotResponse{} } |
|
135 |
+func (*ViewSnapshotResponse) ProtoMessage() {} |
|
136 |
+func (*ViewSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{3} } |
|
137 |
+ |
|
138 |
+type MountsRequest struct { |
|
139 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
140 |
+ Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
141 |
+} |
|
142 |
+ |
|
143 |
+func (m *MountsRequest) Reset() { *m = MountsRequest{} } |
|
144 |
+func (*MountsRequest) ProtoMessage() {} |
|
145 |
+func (*MountsRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{4} } |
|
146 |
+ |
|
147 |
+type MountsResponse struct { |
|
148 |
+ Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"` |
|
149 |
+} |
|
150 |
+ |
|
151 |
+func (m *MountsResponse) Reset() { *m = MountsResponse{} } |
|
152 |
+func (*MountsResponse) ProtoMessage() {} |
|
153 |
+func (*MountsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{5} } |
|
154 |
+ |
|
155 |
+type RemoveSnapshotRequest struct { |
|
156 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
157 |
+ Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
158 |
+} |
|
159 |
+ |
|
160 |
+func (m *RemoveSnapshotRequest) Reset() { *m = RemoveSnapshotRequest{} } |
|
161 |
+func (*RemoveSnapshotRequest) ProtoMessage() {} |
|
162 |
+func (*RemoveSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{6} } |
|
163 |
+ |
|
164 |
+type CommitSnapshotRequest struct { |
|
165 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
166 |
+ Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` |
|
167 |
+ Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` |
|
168 |
+ // Labels are arbitrary data on snapshots. |
|
169 |
+ // |
|
170 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
171 |
+ Labels map[string]string `protobuf:"bytes,4,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
172 |
+} |
|
173 |
+ |
|
174 |
+func (m *CommitSnapshotRequest) Reset() { *m = CommitSnapshotRequest{} } |
|
175 |
+func (*CommitSnapshotRequest) ProtoMessage() {} |
|
176 |
+func (*CommitSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{7} } |
|
177 |
+ |
|
178 |
+type StatSnapshotRequest struct { |
|
179 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
180 |
+ Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
181 |
+} |
|
182 |
+ |
|
183 |
+func (m *StatSnapshotRequest) Reset() { *m = StatSnapshotRequest{} } |
|
184 |
+func (*StatSnapshotRequest) ProtoMessage() {} |
|
185 |
+func (*StatSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{8} } |
|
186 |
+ |
|
187 |
+type Info struct { |
|
188 |
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
|
189 |
+ Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` |
|
190 |
+ Kind Kind `protobuf:"varint,3,opt,name=kind,proto3,enum=containerd.services.snapshots.v1.Kind" json:"kind,omitempty"` |
|
191 |
+ // CreatedAt provides the time at which the snapshot was created. |
|
192 |
+ CreatedAt time.Time `protobuf:"bytes,4,opt,name=created_at,json=createdAt,stdtime" json:"created_at"` |
|
193 |
+ // UpdatedAt provides the time the info was last updated. |
|
194 |
+ UpdatedAt time.Time `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,stdtime" json:"updated_at"` |
|
195 |
+ // Labels are arbitrary data on snapshots. |
|
196 |
+ // |
|
197 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
198 |
+ Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
|
199 |
+} |
|
200 |
+ |
|
201 |
+func (m *Info) Reset() { *m = Info{} } |
|
202 |
+func (*Info) ProtoMessage() {} |
|
203 |
+func (*Info) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{9} } |
|
204 |
+ |
|
205 |
+type StatSnapshotResponse struct { |
|
206 |
+ Info Info `protobuf:"bytes,1,opt,name=info" json:"info"` |
|
207 |
+} |
|
208 |
+ |
|
209 |
+func (m *StatSnapshotResponse) Reset() { *m = StatSnapshotResponse{} } |
|
210 |
+func (*StatSnapshotResponse) ProtoMessage() {} |
|
211 |
+func (*StatSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{10} } |
|
212 |
+ |
|
213 |
+type UpdateSnapshotRequest struct { |
|
214 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
215 |
+ Info Info `protobuf:"bytes,2,opt,name=info" json:"info"` |
|
216 |
+ // UpdateMask specifies which fields to perform the update on. If empty, |
|
217 |
+ // the operation applies to all fields. |
|
218 |
+ // |
|
219 |
+ // In info, Name, Parent, Kind, Created are immutable, |
|
220 |
+ // other field may be updated using this mask. |
|
221 |
+ // If no mask is provided, all mutable field are updated. |
|
222 |
+ UpdateMask *google_protobuf2.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask" json:"update_mask,omitempty"` |
|
223 |
+} |
|
224 |
+ |
|
225 |
+func (m *UpdateSnapshotRequest) Reset() { *m = UpdateSnapshotRequest{} } |
|
226 |
+func (*UpdateSnapshotRequest) ProtoMessage() {} |
|
227 |
+func (*UpdateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{11} } |
|
228 |
+ |
|
229 |
+type UpdateSnapshotResponse struct { |
|
230 |
+ Info Info `protobuf:"bytes,1,opt,name=info" json:"info"` |
|
231 |
+} |
|
232 |
+ |
|
233 |
+func (m *UpdateSnapshotResponse) Reset() { *m = UpdateSnapshotResponse{} } |
|
234 |
+func (*UpdateSnapshotResponse) ProtoMessage() {} |
|
235 |
+func (*UpdateSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{12} } |
|
236 |
+ |
|
237 |
+type ListSnapshotsRequest struct { |
|
238 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
239 |
+} |
|
240 |
+ |
|
241 |
+func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} } |
|
242 |
+func (*ListSnapshotsRequest) ProtoMessage() {} |
|
243 |
+func (*ListSnapshotsRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{13} } |
|
244 |
+ |
|
245 |
+type ListSnapshotsResponse struct { |
|
246 |
+ Info []Info `protobuf:"bytes,1,rep,name=info" json:"info"` |
|
247 |
+} |
|
248 |
+ |
|
249 |
+func (m *ListSnapshotsResponse) Reset() { *m = ListSnapshotsResponse{} } |
|
250 |
+func (*ListSnapshotsResponse) ProtoMessage() {} |
|
251 |
+func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{14} } |
|
252 |
+ |
|
253 |
+type UsageRequest struct { |
|
254 |
+ Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` |
|
255 |
+ Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
|
256 |
+} |
|
257 |
+ |
|
258 |
+func (m *UsageRequest) Reset() { *m = UsageRequest{} } |
|
259 |
+func (*UsageRequest) ProtoMessage() {} |
|
260 |
+func (*UsageRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{15} } |
|
261 |
+ |
|
262 |
+type UsageResponse struct { |
|
263 |
+ Size_ int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` |
|
264 |
+ Inodes int64 `protobuf:"varint,2,opt,name=inodes,proto3" json:"inodes,omitempty"` |
|
265 |
+} |
|
266 |
+ |
|
267 |
+func (m *UsageResponse) Reset() { *m = UsageResponse{} } |
|
268 |
+func (*UsageResponse) ProtoMessage() {} |
|
269 |
+func (*UsageResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{16} } |
|
270 |
+ |
|
271 |
+func init() { |
|
272 |
+ proto.RegisterType((*PrepareSnapshotRequest)(nil), "containerd.services.snapshots.v1.PrepareSnapshotRequest") |
|
273 |
+ proto.RegisterType((*PrepareSnapshotResponse)(nil), "containerd.services.snapshots.v1.PrepareSnapshotResponse") |
|
274 |
+ proto.RegisterType((*ViewSnapshotRequest)(nil), "containerd.services.snapshots.v1.ViewSnapshotRequest") |
|
275 |
+ proto.RegisterType((*ViewSnapshotResponse)(nil), "containerd.services.snapshots.v1.ViewSnapshotResponse") |
|
276 |
+ proto.RegisterType((*MountsRequest)(nil), "containerd.services.snapshots.v1.MountsRequest") |
|
277 |
+ proto.RegisterType((*MountsResponse)(nil), "containerd.services.snapshots.v1.MountsResponse") |
|
278 |
+ proto.RegisterType((*RemoveSnapshotRequest)(nil), "containerd.services.snapshots.v1.RemoveSnapshotRequest") |
|
279 |
+ proto.RegisterType((*CommitSnapshotRequest)(nil), "containerd.services.snapshots.v1.CommitSnapshotRequest") |
|
280 |
+ proto.RegisterType((*StatSnapshotRequest)(nil), "containerd.services.snapshots.v1.StatSnapshotRequest") |
|
281 |
+ proto.RegisterType((*Info)(nil), "containerd.services.snapshots.v1.Info") |
|
282 |
+ proto.RegisterType((*StatSnapshotResponse)(nil), "containerd.services.snapshots.v1.StatSnapshotResponse") |
|
283 |
+ proto.RegisterType((*UpdateSnapshotRequest)(nil), "containerd.services.snapshots.v1.UpdateSnapshotRequest") |
|
284 |
+ proto.RegisterType((*UpdateSnapshotResponse)(nil), "containerd.services.snapshots.v1.UpdateSnapshotResponse") |
|
285 |
+ proto.RegisterType((*ListSnapshotsRequest)(nil), "containerd.services.snapshots.v1.ListSnapshotsRequest") |
|
286 |
+ proto.RegisterType((*ListSnapshotsResponse)(nil), "containerd.services.snapshots.v1.ListSnapshotsResponse") |
|
287 |
+ proto.RegisterType((*UsageRequest)(nil), "containerd.services.snapshots.v1.UsageRequest") |
|
288 |
+ proto.RegisterType((*UsageResponse)(nil), "containerd.services.snapshots.v1.UsageResponse") |
|
289 |
+ proto.RegisterEnum("containerd.services.snapshots.v1.Kind", Kind_name, Kind_value) |
|
290 |
+} |
|
291 |
+ |
|
292 |
+// Reference imports to suppress errors if they are not otherwise used. |
|
293 |
+var _ context.Context |
|
294 |
+var _ grpc.ClientConn |
|
295 |
+ |
|
296 |
+// This is a compile-time assertion to ensure that this generated file |
|
297 |
+// is compatible with the grpc package it is being compiled against. |
|
298 |
+const _ = grpc.SupportPackageIsVersion4 |
|
299 |
+ |
|
300 |
+// Client API for Snapshots service |
|
301 |
+ |
|
302 |
+type SnapshotsClient interface { |
|
303 |
+ Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) |
|
304 |
+ View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) |
|
305 |
+ Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) |
|
306 |
+ Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) |
|
307 |
+ Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) |
|
308 |
+ Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) |
|
309 |
+ Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) |
|
310 |
+ List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) |
|
311 |
+ Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) |
|
312 |
+} |
|
313 |
+ |
|
314 |
+type snapshotsClient struct { |
|
315 |
+ cc *grpc.ClientConn |
|
316 |
+} |
|
317 |
+ |
|
318 |
+func NewSnapshotsClient(cc *grpc.ClientConn) SnapshotsClient { |
|
319 |
+ return &snapshotsClient{cc} |
|
320 |
+} |
|
321 |
+ |
|
322 |
+func (c *snapshotsClient) Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) { |
|
323 |
+ out := new(PrepareSnapshotResponse) |
|
324 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Prepare", in, out, c.cc, opts...) |
|
325 |
+ if err != nil { |
|
326 |
+ return nil, err |
|
327 |
+ } |
|
328 |
+ return out, nil |
|
329 |
+} |
|
330 |
+ |
|
331 |
+func (c *snapshotsClient) View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) { |
|
332 |
+ out := new(ViewSnapshotResponse) |
|
333 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/View", in, out, c.cc, opts...) |
|
334 |
+ if err != nil { |
|
335 |
+ return nil, err |
|
336 |
+ } |
|
337 |
+ return out, nil |
|
338 |
+} |
|
339 |
+ |
|
340 |
+func (c *snapshotsClient) Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) { |
|
341 |
+ out := new(MountsResponse) |
|
342 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Mounts", in, out, c.cc, opts...) |
|
343 |
+ if err != nil { |
|
344 |
+ return nil, err |
|
345 |
+ } |
|
346 |
+ return out, nil |
|
347 |
+} |
|
348 |
+ |
|
349 |
+func (c *snapshotsClient) Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { |
|
350 |
+ out := new(google_protobuf1.Empty) |
|
351 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Commit", in, out, c.cc, opts...) |
|
352 |
+ if err != nil { |
|
353 |
+ return nil, err |
|
354 |
+ } |
|
355 |
+ return out, nil |
|
356 |
+} |
|
357 |
+ |
|
358 |
+func (c *snapshotsClient) Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { |
|
359 |
+ out := new(google_protobuf1.Empty) |
|
360 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Remove", in, out, c.cc, opts...) |
|
361 |
+ if err != nil { |
|
362 |
+ return nil, err |
|
363 |
+ } |
|
364 |
+ return out, nil |
|
365 |
+} |
|
366 |
+ |
|
367 |
+func (c *snapshotsClient) Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) { |
|
368 |
+ out := new(StatSnapshotResponse) |
|
369 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Stat", in, out, c.cc, opts...) |
|
370 |
+ if err != nil { |
|
371 |
+ return nil, err |
|
372 |
+ } |
|
373 |
+ return out, nil |
|
374 |
+} |
|
375 |
+ |
|
376 |
+func (c *snapshotsClient) Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) { |
|
377 |
+ out := new(UpdateSnapshotResponse) |
|
378 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Update", in, out, c.cc, opts...) |
|
379 |
+ if err != nil { |
|
380 |
+ return nil, err |
|
381 |
+ } |
|
382 |
+ return out, nil |
|
383 |
+} |
|
384 |
+ |
|
385 |
+func (c *snapshotsClient) List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) { |
|
386 |
+ stream, err := grpc.NewClientStream(ctx, &_Snapshots_serviceDesc.Streams[0], c.cc, "/containerd.services.snapshots.v1.Snapshots/List", opts...) |
|
387 |
+ if err != nil { |
|
388 |
+ return nil, err |
|
389 |
+ } |
|
390 |
+ x := &snapshotsListClient{stream} |
|
391 |
+ if err := x.ClientStream.SendMsg(in); err != nil { |
|
392 |
+ return nil, err |
|
393 |
+ } |
|
394 |
+ if err := x.ClientStream.CloseSend(); err != nil { |
|
395 |
+ return nil, err |
|
396 |
+ } |
|
397 |
+ return x, nil |
|
398 |
+} |
|
399 |
+ |
|
400 |
+type Snapshots_ListClient interface { |
|
401 |
+ Recv() (*ListSnapshotsResponse, error) |
|
402 |
+ grpc.ClientStream |
|
403 |
+} |
|
404 |
+ |
|
405 |
+type snapshotsListClient struct { |
|
406 |
+ grpc.ClientStream |
|
407 |
+} |
|
408 |
+ |
|
409 |
+func (x *snapshotsListClient) Recv() (*ListSnapshotsResponse, error) { |
|
410 |
+ m := new(ListSnapshotsResponse) |
|
411 |
+ if err := x.ClientStream.RecvMsg(m); err != nil { |
|
412 |
+ return nil, err |
|
413 |
+ } |
|
414 |
+ return m, nil |
|
415 |
+} |
|
416 |
+ |
|
417 |
+func (c *snapshotsClient) Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) { |
|
418 |
+ out := new(UsageResponse) |
|
419 |
+ err := grpc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Usage", in, out, c.cc, opts...) |
|
420 |
+ if err != nil { |
|
421 |
+ return nil, err |
|
422 |
+ } |
|
423 |
+ return out, nil |
|
424 |
+} |
|
425 |
+ |
|
426 |
+// Server API for Snapshots service |
|
427 |
+ |
|
428 |
+type SnapshotsServer interface { |
|
429 |
+ Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) |
|
430 |
+ View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error) |
|
431 |
+ Mounts(context.Context, *MountsRequest) (*MountsResponse, error) |
|
432 |
+ Commit(context.Context, *CommitSnapshotRequest) (*google_protobuf1.Empty, error) |
|
433 |
+ Remove(context.Context, *RemoveSnapshotRequest) (*google_protobuf1.Empty, error) |
|
434 |
+ Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error) |
|
435 |
+ Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) |
|
436 |
+ List(*ListSnapshotsRequest, Snapshots_ListServer) error |
|
437 |
+ Usage(context.Context, *UsageRequest) (*UsageResponse, error) |
|
438 |
+} |
|
439 |
+ |
|
440 |
+func RegisterSnapshotsServer(s *grpc.Server, srv SnapshotsServer) { |
|
441 |
+ s.RegisterService(&_Snapshots_serviceDesc, srv) |
|
442 |
+} |
|
443 |
+ |
|
444 |
+func _Snapshots_Prepare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
445 |
+ in := new(PrepareSnapshotRequest) |
|
446 |
+ if err := dec(in); err != nil { |
|
447 |
+ return nil, err |
|
448 |
+ } |
|
449 |
+ if interceptor == nil { |
|
450 |
+ return srv.(SnapshotsServer).Prepare(ctx, in) |
|
451 |
+ } |
|
452 |
+ info := &grpc.UnaryServerInfo{ |
|
453 |
+ Server: srv, |
|
454 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/Prepare", |
|
455 |
+ } |
|
456 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
457 |
+ return srv.(SnapshotsServer).Prepare(ctx, req.(*PrepareSnapshotRequest)) |
|
458 |
+ } |
|
459 |
+ return interceptor(ctx, in, info, handler) |
|
460 |
+} |
|
461 |
+ |
|
462 |
+func _Snapshots_View_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
463 |
+ in := new(ViewSnapshotRequest) |
|
464 |
+ if err := dec(in); err != nil { |
|
465 |
+ return nil, err |
|
466 |
+ } |
|
467 |
+ if interceptor == nil { |
|
468 |
+ return srv.(SnapshotsServer).View(ctx, in) |
|
469 |
+ } |
|
470 |
+ info := &grpc.UnaryServerInfo{ |
|
471 |
+ Server: srv, |
|
472 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/View", |
|
473 |
+ } |
|
474 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
475 |
+ return srv.(SnapshotsServer).View(ctx, req.(*ViewSnapshotRequest)) |
|
476 |
+ } |
|
477 |
+ return interceptor(ctx, in, info, handler) |
|
478 |
+} |
|
479 |
+ |
|
480 |
+func _Snapshots_Mounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
481 |
+ in := new(MountsRequest) |
|
482 |
+ if err := dec(in); err != nil { |
|
483 |
+ return nil, err |
|
484 |
+ } |
|
485 |
+ if interceptor == nil { |
|
486 |
+ return srv.(SnapshotsServer).Mounts(ctx, in) |
|
487 |
+ } |
|
488 |
+ info := &grpc.UnaryServerInfo{ |
|
489 |
+ Server: srv, |
|
490 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/Mounts", |
|
491 |
+ } |
|
492 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
493 |
+ return srv.(SnapshotsServer).Mounts(ctx, req.(*MountsRequest)) |
|
494 |
+ } |
|
495 |
+ return interceptor(ctx, in, info, handler) |
|
496 |
+} |
|
497 |
+ |
|
498 |
+func _Snapshots_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
499 |
+ in := new(CommitSnapshotRequest) |
|
500 |
+ if err := dec(in); err != nil { |
|
501 |
+ return nil, err |
|
502 |
+ } |
|
503 |
+ if interceptor == nil { |
|
504 |
+ return srv.(SnapshotsServer).Commit(ctx, in) |
|
505 |
+ } |
|
506 |
+ info := &grpc.UnaryServerInfo{ |
|
507 |
+ Server: srv, |
|
508 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/Commit", |
|
509 |
+ } |
|
510 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
511 |
+ return srv.(SnapshotsServer).Commit(ctx, req.(*CommitSnapshotRequest)) |
|
512 |
+ } |
|
513 |
+ return interceptor(ctx, in, info, handler) |
|
514 |
+} |
|
515 |
+ |
|
516 |
+func _Snapshots_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
517 |
+ in := new(RemoveSnapshotRequest) |
|
518 |
+ if err := dec(in); err != nil { |
|
519 |
+ return nil, err |
|
520 |
+ } |
|
521 |
+ if interceptor == nil { |
|
522 |
+ return srv.(SnapshotsServer).Remove(ctx, in) |
|
523 |
+ } |
|
524 |
+ info := &grpc.UnaryServerInfo{ |
|
525 |
+ Server: srv, |
|
526 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/Remove", |
|
527 |
+ } |
|
528 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
529 |
+ return srv.(SnapshotsServer).Remove(ctx, req.(*RemoveSnapshotRequest)) |
|
530 |
+ } |
|
531 |
+ return interceptor(ctx, in, info, handler) |
|
532 |
+} |
|
533 |
+ |
|
534 |
+func _Snapshots_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
535 |
+ in := new(StatSnapshotRequest) |
|
536 |
+ if err := dec(in); err != nil { |
|
537 |
+ return nil, err |
|
538 |
+ } |
|
539 |
+ if interceptor == nil { |
|
540 |
+ return srv.(SnapshotsServer).Stat(ctx, in) |
|
541 |
+ } |
|
542 |
+ info := &grpc.UnaryServerInfo{ |
|
543 |
+ Server: srv, |
|
544 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/Stat", |
|
545 |
+ } |
|
546 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
547 |
+ return srv.(SnapshotsServer).Stat(ctx, req.(*StatSnapshotRequest)) |
|
548 |
+ } |
|
549 |
+ return interceptor(ctx, in, info, handler) |
|
550 |
+} |
|
551 |
+ |
|
552 |
+func _Snapshots_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
553 |
+ in := new(UpdateSnapshotRequest) |
|
554 |
+ if err := dec(in); err != nil { |
|
555 |
+ return nil, err |
|
556 |
+ } |
|
557 |
+ if interceptor == nil { |
|
558 |
+ return srv.(SnapshotsServer).Update(ctx, in) |
|
559 |
+ } |
|
560 |
+ info := &grpc.UnaryServerInfo{ |
|
561 |
+ Server: srv, |
|
562 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/Update", |
|
563 |
+ } |
|
564 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
565 |
+ return srv.(SnapshotsServer).Update(ctx, req.(*UpdateSnapshotRequest)) |
|
566 |
+ } |
|
567 |
+ return interceptor(ctx, in, info, handler) |
|
568 |
+} |
|
569 |
+ |
|
570 |
+func _Snapshots_List_Handler(srv interface{}, stream grpc.ServerStream) error { |
|
571 |
+ m := new(ListSnapshotsRequest) |
|
572 |
+ if err := stream.RecvMsg(m); err != nil { |
|
573 |
+ return err |
|
574 |
+ } |
|
575 |
+ return srv.(SnapshotsServer).List(m, &snapshotsListServer{stream}) |
|
576 |
+} |
|
577 |
+ |
|
578 |
+type Snapshots_ListServer interface { |
|
579 |
+ Send(*ListSnapshotsResponse) error |
|
580 |
+ grpc.ServerStream |
|
581 |
+} |
|
582 |
+ |
|
583 |
+type snapshotsListServer struct { |
|
584 |
+ grpc.ServerStream |
|
585 |
+} |
|
586 |
+ |
|
587 |
+func (x *snapshotsListServer) Send(m *ListSnapshotsResponse) error { |
|
588 |
+ return x.ServerStream.SendMsg(m) |
|
589 |
+} |
|
590 |
+ |
|
591 |
+func _Snapshots_Usage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
592 |
+ in := new(UsageRequest) |
|
593 |
+ if err := dec(in); err != nil { |
|
594 |
+ return nil, err |
|
595 |
+ } |
|
596 |
+ if interceptor == nil { |
|
597 |
+ return srv.(SnapshotsServer).Usage(ctx, in) |
|
598 |
+ } |
|
599 |
+ info := &grpc.UnaryServerInfo{ |
|
600 |
+ Server: srv, |
|
601 |
+ FullMethod: "/containerd.services.snapshots.v1.Snapshots/Usage", |
|
602 |
+ } |
|
603 |
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
604 |
+ return srv.(SnapshotsServer).Usage(ctx, req.(*UsageRequest)) |
|
605 |
+ } |
|
606 |
+ return interceptor(ctx, in, info, handler) |
|
607 |
+} |
|
608 |
+ |
|
609 |
+var _Snapshots_serviceDesc = grpc.ServiceDesc{ |
|
610 |
+ ServiceName: "containerd.services.snapshots.v1.Snapshots", |
|
611 |
+ HandlerType: (*SnapshotsServer)(nil), |
|
612 |
+ Methods: []grpc.MethodDesc{ |
|
613 |
+ { |
|
614 |
+ MethodName: "Prepare", |
|
615 |
+ Handler: _Snapshots_Prepare_Handler, |
|
616 |
+ }, |
|
617 |
+ { |
|
618 |
+ MethodName: "View", |
|
619 |
+ Handler: _Snapshots_View_Handler, |
|
620 |
+ }, |
|
621 |
+ { |
|
622 |
+ MethodName: "Mounts", |
|
623 |
+ Handler: _Snapshots_Mounts_Handler, |
|
624 |
+ }, |
|
625 |
+ { |
|
626 |
+ MethodName: "Commit", |
|
627 |
+ Handler: _Snapshots_Commit_Handler, |
|
628 |
+ }, |
|
629 |
+ { |
|
630 |
+ MethodName: "Remove", |
|
631 |
+ Handler: _Snapshots_Remove_Handler, |
|
632 |
+ }, |
|
633 |
+ { |
|
634 |
+ MethodName: "Stat", |
|
635 |
+ Handler: _Snapshots_Stat_Handler, |
|
636 |
+ }, |
|
637 |
+ { |
|
638 |
+ MethodName: "Update", |
|
639 |
+ Handler: _Snapshots_Update_Handler, |
|
640 |
+ }, |
|
641 |
+ { |
|
642 |
+ MethodName: "Usage", |
|
643 |
+ Handler: _Snapshots_Usage_Handler, |
|
644 |
+ }, |
|
645 |
+ }, |
|
646 |
+ Streams: []grpc.StreamDesc{ |
|
647 |
+ { |
|
648 |
+ StreamName: "List", |
|
649 |
+ Handler: _Snapshots_List_Handler, |
|
650 |
+ ServerStreams: true, |
|
651 |
+ }, |
|
652 |
+ }, |
|
653 |
+ Metadata: "github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto", |
|
654 |
+} |
|
655 |
+ |
|
656 |
+func (m *PrepareSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
657 |
+ size := m.Size() |
|
658 |
+ dAtA = make([]byte, size) |
|
659 |
+ n, err := m.MarshalTo(dAtA) |
|
660 |
+ if err != nil { |
|
661 |
+ return nil, err |
|
662 |
+ } |
|
663 |
+ return dAtA[:n], nil |
|
664 |
+} |
|
665 |
+ |
|
666 |
+func (m *PrepareSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
667 |
+ var i int |
|
668 |
+ _ = i |
|
669 |
+ var l int |
|
670 |
+ _ = l |
|
671 |
+ if len(m.Snapshotter) > 0 { |
|
672 |
+ dAtA[i] = 0xa |
|
673 |
+ i++ |
|
674 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
675 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
676 |
+ } |
|
677 |
+ if len(m.Key) > 0 { |
|
678 |
+ dAtA[i] = 0x12 |
|
679 |
+ i++ |
|
680 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
681 |
+ i += copy(dAtA[i:], m.Key) |
|
682 |
+ } |
|
683 |
+ if len(m.Parent) > 0 { |
|
684 |
+ dAtA[i] = 0x1a |
|
685 |
+ i++ |
|
686 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) |
|
687 |
+ i += copy(dAtA[i:], m.Parent) |
|
688 |
+ } |
|
689 |
+ if len(m.Labels) > 0 { |
|
690 |
+ for k, _ := range m.Labels { |
|
691 |
+ dAtA[i] = 0x22 |
|
692 |
+ i++ |
|
693 |
+ v := m.Labels[k] |
|
694 |
+ mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
695 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
696 |
+ dAtA[i] = 0xa |
|
697 |
+ i++ |
|
698 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
699 |
+ i += copy(dAtA[i:], k) |
|
700 |
+ dAtA[i] = 0x12 |
|
701 |
+ i++ |
|
702 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
703 |
+ i += copy(dAtA[i:], v) |
|
704 |
+ } |
|
705 |
+ } |
|
706 |
+ return i, nil |
|
707 |
+} |
|
708 |
+ |
|
709 |
+func (m *PrepareSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
710 |
+ size := m.Size() |
|
711 |
+ dAtA = make([]byte, size) |
|
712 |
+ n, err := m.MarshalTo(dAtA) |
|
713 |
+ if err != nil { |
|
714 |
+ return nil, err |
|
715 |
+ } |
|
716 |
+ return dAtA[:n], nil |
|
717 |
+} |
|
718 |
+ |
|
719 |
+func (m *PrepareSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
720 |
+ var i int |
|
721 |
+ _ = i |
|
722 |
+ var l int |
|
723 |
+ _ = l |
|
724 |
+ if len(m.Mounts) > 0 { |
|
725 |
+ for _, msg := range m.Mounts { |
|
726 |
+ dAtA[i] = 0xa |
|
727 |
+ i++ |
|
728 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
729 |
+ n, err := msg.MarshalTo(dAtA[i:]) |
|
730 |
+ if err != nil { |
|
731 |
+ return 0, err |
|
732 |
+ } |
|
733 |
+ i += n |
|
734 |
+ } |
|
735 |
+ } |
|
736 |
+ return i, nil |
|
737 |
+} |
|
738 |
+ |
|
739 |
+func (m *ViewSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
740 |
+ size := m.Size() |
|
741 |
+ dAtA = make([]byte, size) |
|
742 |
+ n, err := m.MarshalTo(dAtA) |
|
743 |
+ if err != nil { |
|
744 |
+ return nil, err |
|
745 |
+ } |
|
746 |
+ return dAtA[:n], nil |
|
747 |
+} |
|
748 |
+ |
|
749 |
+func (m *ViewSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
750 |
+ var i int |
|
751 |
+ _ = i |
|
752 |
+ var l int |
|
753 |
+ _ = l |
|
754 |
+ if len(m.Snapshotter) > 0 { |
|
755 |
+ dAtA[i] = 0xa |
|
756 |
+ i++ |
|
757 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
758 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
759 |
+ } |
|
760 |
+ if len(m.Key) > 0 { |
|
761 |
+ dAtA[i] = 0x12 |
|
762 |
+ i++ |
|
763 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
764 |
+ i += copy(dAtA[i:], m.Key) |
|
765 |
+ } |
|
766 |
+ if len(m.Parent) > 0 { |
|
767 |
+ dAtA[i] = 0x1a |
|
768 |
+ i++ |
|
769 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) |
|
770 |
+ i += copy(dAtA[i:], m.Parent) |
|
771 |
+ } |
|
772 |
+ if len(m.Labels) > 0 { |
|
773 |
+ for k, _ := range m.Labels { |
|
774 |
+ dAtA[i] = 0x22 |
|
775 |
+ i++ |
|
776 |
+ v := m.Labels[k] |
|
777 |
+ mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
778 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
779 |
+ dAtA[i] = 0xa |
|
780 |
+ i++ |
|
781 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
782 |
+ i += copy(dAtA[i:], k) |
|
783 |
+ dAtA[i] = 0x12 |
|
784 |
+ i++ |
|
785 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
786 |
+ i += copy(dAtA[i:], v) |
|
787 |
+ } |
|
788 |
+ } |
|
789 |
+ return i, nil |
|
790 |
+} |
|
791 |
+ |
|
792 |
+func (m *ViewSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
793 |
+ size := m.Size() |
|
794 |
+ dAtA = make([]byte, size) |
|
795 |
+ n, err := m.MarshalTo(dAtA) |
|
796 |
+ if err != nil { |
|
797 |
+ return nil, err |
|
798 |
+ } |
|
799 |
+ return dAtA[:n], nil |
|
800 |
+} |
|
801 |
+ |
|
802 |
+func (m *ViewSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
803 |
+ var i int |
|
804 |
+ _ = i |
|
805 |
+ var l int |
|
806 |
+ _ = l |
|
807 |
+ if len(m.Mounts) > 0 { |
|
808 |
+ for _, msg := range m.Mounts { |
|
809 |
+ dAtA[i] = 0xa |
|
810 |
+ i++ |
|
811 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
812 |
+ n, err := msg.MarshalTo(dAtA[i:]) |
|
813 |
+ if err != nil { |
|
814 |
+ return 0, err |
|
815 |
+ } |
|
816 |
+ i += n |
|
817 |
+ } |
|
818 |
+ } |
|
819 |
+ return i, nil |
|
820 |
+} |
|
821 |
+ |
|
822 |
+func (m *MountsRequest) Marshal() (dAtA []byte, err error) { |
|
823 |
+ size := m.Size() |
|
824 |
+ dAtA = make([]byte, size) |
|
825 |
+ n, err := m.MarshalTo(dAtA) |
|
826 |
+ if err != nil { |
|
827 |
+ return nil, err |
|
828 |
+ } |
|
829 |
+ return dAtA[:n], nil |
|
830 |
+} |
|
831 |
+ |
|
832 |
+func (m *MountsRequest) MarshalTo(dAtA []byte) (int, error) { |
|
833 |
+ var i int |
|
834 |
+ _ = i |
|
835 |
+ var l int |
|
836 |
+ _ = l |
|
837 |
+ if len(m.Snapshotter) > 0 { |
|
838 |
+ dAtA[i] = 0xa |
|
839 |
+ i++ |
|
840 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
841 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
842 |
+ } |
|
843 |
+ if len(m.Key) > 0 { |
|
844 |
+ dAtA[i] = 0x12 |
|
845 |
+ i++ |
|
846 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
847 |
+ i += copy(dAtA[i:], m.Key) |
|
848 |
+ } |
|
849 |
+ return i, nil |
|
850 |
+} |
|
851 |
+ |
|
852 |
+func (m *MountsResponse) Marshal() (dAtA []byte, err error) { |
|
853 |
+ size := m.Size() |
|
854 |
+ dAtA = make([]byte, size) |
|
855 |
+ n, err := m.MarshalTo(dAtA) |
|
856 |
+ if err != nil { |
|
857 |
+ return nil, err |
|
858 |
+ } |
|
859 |
+ return dAtA[:n], nil |
|
860 |
+} |
|
861 |
+ |
|
862 |
+func (m *MountsResponse) MarshalTo(dAtA []byte) (int, error) { |
|
863 |
+ var i int |
|
864 |
+ _ = i |
|
865 |
+ var l int |
|
866 |
+ _ = l |
|
867 |
+ if len(m.Mounts) > 0 { |
|
868 |
+ for _, msg := range m.Mounts { |
|
869 |
+ dAtA[i] = 0xa |
|
870 |
+ i++ |
|
871 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
872 |
+ n, err := msg.MarshalTo(dAtA[i:]) |
|
873 |
+ if err != nil { |
|
874 |
+ return 0, err |
|
875 |
+ } |
|
876 |
+ i += n |
|
877 |
+ } |
|
878 |
+ } |
|
879 |
+ return i, nil |
|
880 |
+} |
|
881 |
+ |
|
882 |
+func (m *RemoveSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
883 |
+ size := m.Size() |
|
884 |
+ dAtA = make([]byte, size) |
|
885 |
+ n, err := m.MarshalTo(dAtA) |
|
886 |
+ if err != nil { |
|
887 |
+ return nil, err |
|
888 |
+ } |
|
889 |
+ return dAtA[:n], nil |
|
890 |
+} |
|
891 |
+ |
|
892 |
+func (m *RemoveSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
893 |
+ var i int |
|
894 |
+ _ = i |
|
895 |
+ var l int |
|
896 |
+ _ = l |
|
897 |
+ if len(m.Snapshotter) > 0 { |
|
898 |
+ dAtA[i] = 0xa |
|
899 |
+ i++ |
|
900 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
901 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
902 |
+ } |
|
903 |
+ if len(m.Key) > 0 { |
|
904 |
+ dAtA[i] = 0x12 |
|
905 |
+ i++ |
|
906 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
907 |
+ i += copy(dAtA[i:], m.Key) |
|
908 |
+ } |
|
909 |
+ return i, nil |
|
910 |
+} |
|
911 |
+ |
|
912 |
+func (m *CommitSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
913 |
+ size := m.Size() |
|
914 |
+ dAtA = make([]byte, size) |
|
915 |
+ n, err := m.MarshalTo(dAtA) |
|
916 |
+ if err != nil { |
|
917 |
+ return nil, err |
|
918 |
+ } |
|
919 |
+ return dAtA[:n], nil |
|
920 |
+} |
|
921 |
+ |
|
922 |
+func (m *CommitSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
923 |
+ var i int |
|
924 |
+ _ = i |
|
925 |
+ var l int |
|
926 |
+ _ = l |
|
927 |
+ if len(m.Snapshotter) > 0 { |
|
928 |
+ dAtA[i] = 0xa |
|
929 |
+ i++ |
|
930 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
931 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
932 |
+ } |
|
933 |
+ if len(m.Name) > 0 { |
|
934 |
+ dAtA[i] = 0x12 |
|
935 |
+ i++ |
|
936 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name))) |
|
937 |
+ i += copy(dAtA[i:], m.Name) |
|
938 |
+ } |
|
939 |
+ if len(m.Key) > 0 { |
|
940 |
+ dAtA[i] = 0x1a |
|
941 |
+ i++ |
|
942 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
943 |
+ i += copy(dAtA[i:], m.Key) |
|
944 |
+ } |
|
945 |
+ if len(m.Labels) > 0 { |
|
946 |
+ for k, _ := range m.Labels { |
|
947 |
+ dAtA[i] = 0x22 |
|
948 |
+ i++ |
|
949 |
+ v := m.Labels[k] |
|
950 |
+ mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
951 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
952 |
+ dAtA[i] = 0xa |
|
953 |
+ i++ |
|
954 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
955 |
+ i += copy(dAtA[i:], k) |
|
956 |
+ dAtA[i] = 0x12 |
|
957 |
+ i++ |
|
958 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
959 |
+ i += copy(dAtA[i:], v) |
|
960 |
+ } |
|
961 |
+ } |
|
962 |
+ return i, nil |
|
963 |
+} |
|
964 |
+ |
|
965 |
+func (m *StatSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
966 |
+ size := m.Size() |
|
967 |
+ dAtA = make([]byte, size) |
|
968 |
+ n, err := m.MarshalTo(dAtA) |
|
969 |
+ if err != nil { |
|
970 |
+ return nil, err |
|
971 |
+ } |
|
972 |
+ return dAtA[:n], nil |
|
973 |
+} |
|
974 |
+ |
|
975 |
+func (m *StatSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
976 |
+ var i int |
|
977 |
+ _ = i |
|
978 |
+ var l int |
|
979 |
+ _ = l |
|
980 |
+ if len(m.Snapshotter) > 0 { |
|
981 |
+ dAtA[i] = 0xa |
|
982 |
+ i++ |
|
983 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
984 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
985 |
+ } |
|
986 |
+ if len(m.Key) > 0 { |
|
987 |
+ dAtA[i] = 0x12 |
|
988 |
+ i++ |
|
989 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
990 |
+ i += copy(dAtA[i:], m.Key) |
|
991 |
+ } |
|
992 |
+ return i, nil |
|
993 |
+} |
|
994 |
+ |
|
995 |
+func (m *Info) Marshal() (dAtA []byte, err error) { |
|
996 |
+ size := m.Size() |
|
997 |
+ dAtA = make([]byte, size) |
|
998 |
+ n, err := m.MarshalTo(dAtA) |
|
999 |
+ if err != nil { |
|
1000 |
+ return nil, err |
|
1001 |
+ } |
|
1002 |
+ return dAtA[:n], nil |
|
1003 |
+} |
|
1004 |
+ |
|
1005 |
+func (m *Info) MarshalTo(dAtA []byte) (int, error) { |
|
1006 |
+ var i int |
|
1007 |
+ _ = i |
|
1008 |
+ var l int |
|
1009 |
+ _ = l |
|
1010 |
+ if len(m.Name) > 0 { |
|
1011 |
+ dAtA[i] = 0xa |
|
1012 |
+ i++ |
|
1013 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name))) |
|
1014 |
+ i += copy(dAtA[i:], m.Name) |
|
1015 |
+ } |
|
1016 |
+ if len(m.Parent) > 0 { |
|
1017 |
+ dAtA[i] = 0x12 |
|
1018 |
+ i++ |
|
1019 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) |
|
1020 |
+ i += copy(dAtA[i:], m.Parent) |
|
1021 |
+ } |
|
1022 |
+ if m.Kind != 0 { |
|
1023 |
+ dAtA[i] = 0x18 |
|
1024 |
+ i++ |
|
1025 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(m.Kind)) |
|
1026 |
+ } |
|
1027 |
+ dAtA[i] = 0x22 |
|
1028 |
+ i++ |
|
1029 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) |
|
1030 |
+ n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) |
|
1031 |
+ if err != nil { |
|
1032 |
+ return 0, err |
|
1033 |
+ } |
|
1034 |
+ i += n1 |
|
1035 |
+ dAtA[i] = 0x2a |
|
1036 |
+ i++ |
|
1037 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt))) |
|
1038 |
+ n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i:]) |
|
1039 |
+ if err != nil { |
|
1040 |
+ return 0, err |
|
1041 |
+ } |
|
1042 |
+ i += n2 |
|
1043 |
+ if len(m.Labels) > 0 { |
|
1044 |
+ for k, _ := range m.Labels { |
|
1045 |
+ dAtA[i] = 0x32 |
|
1046 |
+ i++ |
|
1047 |
+ v := m.Labels[k] |
|
1048 |
+ mapSize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1049 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(mapSize)) |
|
1050 |
+ dAtA[i] = 0xa |
|
1051 |
+ i++ |
|
1052 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(k))) |
|
1053 |
+ i += copy(dAtA[i:], k) |
|
1054 |
+ dAtA[i] = 0x12 |
|
1055 |
+ i++ |
|
1056 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(v))) |
|
1057 |
+ i += copy(dAtA[i:], v) |
|
1058 |
+ } |
|
1059 |
+ } |
|
1060 |
+ return i, nil |
|
1061 |
+} |
|
1062 |
+ |
|
1063 |
+func (m *StatSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
1064 |
+ size := m.Size() |
|
1065 |
+ dAtA = make([]byte, size) |
|
1066 |
+ n, err := m.MarshalTo(dAtA) |
|
1067 |
+ if err != nil { |
|
1068 |
+ return nil, err |
|
1069 |
+ } |
|
1070 |
+ return dAtA[:n], nil |
|
1071 |
+} |
|
1072 |
+ |
|
1073 |
+func (m *StatSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1074 |
+ var i int |
|
1075 |
+ _ = i |
|
1076 |
+ var l int |
|
1077 |
+ _ = l |
|
1078 |
+ dAtA[i] = 0xa |
|
1079 |
+ i++ |
|
1080 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(m.Info.Size())) |
|
1081 |
+ n3, err := m.Info.MarshalTo(dAtA[i:]) |
|
1082 |
+ if err != nil { |
|
1083 |
+ return 0, err |
|
1084 |
+ } |
|
1085 |
+ i += n3 |
|
1086 |
+ return i, nil |
|
1087 |
+} |
|
1088 |
+ |
|
1089 |
+func (m *UpdateSnapshotRequest) Marshal() (dAtA []byte, err error) { |
|
1090 |
+ size := m.Size() |
|
1091 |
+ dAtA = make([]byte, size) |
|
1092 |
+ n, err := m.MarshalTo(dAtA) |
|
1093 |
+ if err != nil { |
|
1094 |
+ return nil, err |
|
1095 |
+ } |
|
1096 |
+ return dAtA[:n], nil |
|
1097 |
+} |
|
1098 |
+ |
|
1099 |
+func (m *UpdateSnapshotRequest) MarshalTo(dAtA []byte) (int, error) { |
|
1100 |
+ var i int |
|
1101 |
+ _ = i |
|
1102 |
+ var l int |
|
1103 |
+ _ = l |
|
1104 |
+ if len(m.Snapshotter) > 0 { |
|
1105 |
+ dAtA[i] = 0xa |
|
1106 |
+ i++ |
|
1107 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
1108 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
1109 |
+ } |
|
1110 |
+ dAtA[i] = 0x12 |
|
1111 |
+ i++ |
|
1112 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(m.Info.Size())) |
|
1113 |
+ n4, err := m.Info.MarshalTo(dAtA[i:]) |
|
1114 |
+ if err != nil { |
|
1115 |
+ return 0, err |
|
1116 |
+ } |
|
1117 |
+ i += n4 |
|
1118 |
+ if m.UpdateMask != nil { |
|
1119 |
+ dAtA[i] = 0x1a |
|
1120 |
+ i++ |
|
1121 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(m.UpdateMask.Size())) |
|
1122 |
+ n5, err := m.UpdateMask.MarshalTo(dAtA[i:]) |
|
1123 |
+ if err != nil { |
|
1124 |
+ return 0, err |
|
1125 |
+ } |
|
1126 |
+ i += n5 |
|
1127 |
+ } |
|
1128 |
+ return i, nil |
|
1129 |
+} |
|
1130 |
+ |
|
1131 |
+func (m *UpdateSnapshotResponse) Marshal() (dAtA []byte, err error) { |
|
1132 |
+ size := m.Size() |
|
1133 |
+ dAtA = make([]byte, size) |
|
1134 |
+ n, err := m.MarshalTo(dAtA) |
|
1135 |
+ if err != nil { |
|
1136 |
+ return nil, err |
|
1137 |
+ } |
|
1138 |
+ return dAtA[:n], nil |
|
1139 |
+} |
|
1140 |
+ |
|
1141 |
+func (m *UpdateSnapshotResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1142 |
+ var i int |
|
1143 |
+ _ = i |
|
1144 |
+ var l int |
|
1145 |
+ _ = l |
|
1146 |
+ dAtA[i] = 0xa |
|
1147 |
+ i++ |
|
1148 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(m.Info.Size())) |
|
1149 |
+ n6, err := m.Info.MarshalTo(dAtA[i:]) |
|
1150 |
+ if err != nil { |
|
1151 |
+ return 0, err |
|
1152 |
+ } |
|
1153 |
+ i += n6 |
|
1154 |
+ return i, nil |
|
1155 |
+} |
|
1156 |
+ |
|
1157 |
+func (m *ListSnapshotsRequest) Marshal() (dAtA []byte, err error) { |
|
1158 |
+ size := m.Size() |
|
1159 |
+ dAtA = make([]byte, size) |
|
1160 |
+ n, err := m.MarshalTo(dAtA) |
|
1161 |
+ if err != nil { |
|
1162 |
+ return nil, err |
|
1163 |
+ } |
|
1164 |
+ return dAtA[:n], nil |
|
1165 |
+} |
|
1166 |
+ |
|
1167 |
+func (m *ListSnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { |
|
1168 |
+ var i int |
|
1169 |
+ _ = i |
|
1170 |
+ var l int |
|
1171 |
+ _ = l |
|
1172 |
+ if len(m.Snapshotter) > 0 { |
|
1173 |
+ dAtA[i] = 0xa |
|
1174 |
+ i++ |
|
1175 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
1176 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
1177 |
+ } |
|
1178 |
+ return i, nil |
|
1179 |
+} |
|
1180 |
+ |
|
1181 |
+func (m *ListSnapshotsResponse) Marshal() (dAtA []byte, err error) { |
|
1182 |
+ size := m.Size() |
|
1183 |
+ dAtA = make([]byte, size) |
|
1184 |
+ n, err := m.MarshalTo(dAtA) |
|
1185 |
+ if err != nil { |
|
1186 |
+ return nil, err |
|
1187 |
+ } |
|
1188 |
+ return dAtA[:n], nil |
|
1189 |
+} |
|
1190 |
+ |
|
1191 |
+func (m *ListSnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1192 |
+ var i int |
|
1193 |
+ _ = i |
|
1194 |
+ var l int |
|
1195 |
+ _ = l |
|
1196 |
+ if len(m.Info) > 0 { |
|
1197 |
+ for _, msg := range m.Info { |
|
1198 |
+ dAtA[i] = 0xa |
|
1199 |
+ i++ |
|
1200 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(msg.Size())) |
|
1201 |
+ n, err := msg.MarshalTo(dAtA[i:]) |
|
1202 |
+ if err != nil { |
|
1203 |
+ return 0, err |
|
1204 |
+ } |
|
1205 |
+ i += n |
|
1206 |
+ } |
|
1207 |
+ } |
|
1208 |
+ return i, nil |
|
1209 |
+} |
|
1210 |
+ |
|
1211 |
+func (m *UsageRequest) Marshal() (dAtA []byte, err error) { |
|
1212 |
+ size := m.Size() |
|
1213 |
+ dAtA = make([]byte, size) |
|
1214 |
+ n, err := m.MarshalTo(dAtA) |
|
1215 |
+ if err != nil { |
|
1216 |
+ return nil, err |
|
1217 |
+ } |
|
1218 |
+ return dAtA[:n], nil |
|
1219 |
+} |
|
1220 |
+ |
|
1221 |
+func (m *UsageRequest) MarshalTo(dAtA []byte) (int, error) { |
|
1222 |
+ var i int |
|
1223 |
+ _ = i |
|
1224 |
+ var l int |
|
1225 |
+ _ = l |
|
1226 |
+ if len(m.Snapshotter) > 0 { |
|
1227 |
+ dAtA[i] = 0xa |
|
1228 |
+ i++ |
|
1229 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter))) |
|
1230 |
+ i += copy(dAtA[i:], m.Snapshotter) |
|
1231 |
+ } |
|
1232 |
+ if len(m.Key) > 0 { |
|
1233 |
+ dAtA[i] = 0x12 |
|
1234 |
+ i++ |
|
1235 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) |
|
1236 |
+ i += copy(dAtA[i:], m.Key) |
|
1237 |
+ } |
|
1238 |
+ return i, nil |
|
1239 |
+} |
|
1240 |
+ |
|
1241 |
+func (m *UsageResponse) Marshal() (dAtA []byte, err error) { |
|
1242 |
+ size := m.Size() |
|
1243 |
+ dAtA = make([]byte, size) |
|
1244 |
+ n, err := m.MarshalTo(dAtA) |
|
1245 |
+ if err != nil { |
|
1246 |
+ return nil, err |
|
1247 |
+ } |
|
1248 |
+ return dAtA[:n], nil |
|
1249 |
+} |
|
1250 |
+ |
|
1251 |
+func (m *UsageResponse) MarshalTo(dAtA []byte) (int, error) { |
|
1252 |
+ var i int |
|
1253 |
+ _ = i |
|
1254 |
+ var l int |
|
1255 |
+ _ = l |
|
1256 |
+ if m.Size_ != 0 { |
|
1257 |
+ dAtA[i] = 0x8 |
|
1258 |
+ i++ |
|
1259 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(m.Size_)) |
|
1260 |
+ } |
|
1261 |
+ if m.Inodes != 0 { |
|
1262 |
+ dAtA[i] = 0x10 |
|
1263 |
+ i++ |
|
1264 |
+ i = encodeVarintSnapshots(dAtA, i, uint64(m.Inodes)) |
|
1265 |
+ } |
|
1266 |
+ return i, nil |
|
1267 |
+} |
|
1268 |
+ |
|
1269 |
+func encodeVarintSnapshots(dAtA []byte, offset int, v uint64) int { |
|
1270 |
+ for v >= 1<<7 { |
|
1271 |
+ dAtA[offset] = uint8(v&0x7f | 0x80) |
|
1272 |
+ v >>= 7 |
|
1273 |
+ offset++ |
|
1274 |
+ } |
|
1275 |
+ dAtA[offset] = uint8(v) |
|
1276 |
+ return offset + 1 |
|
1277 |
+} |
|
1278 |
+func (m *PrepareSnapshotRequest) Size() (n int) { |
|
1279 |
+ var l int |
|
1280 |
+ _ = l |
|
1281 |
+ l = len(m.Snapshotter) |
|
1282 |
+ if l > 0 { |
|
1283 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1284 |
+ } |
|
1285 |
+ l = len(m.Key) |
|
1286 |
+ if l > 0 { |
|
1287 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1288 |
+ } |
|
1289 |
+ l = len(m.Parent) |
|
1290 |
+ if l > 0 { |
|
1291 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1292 |
+ } |
|
1293 |
+ if len(m.Labels) > 0 { |
|
1294 |
+ for k, v := range m.Labels { |
|
1295 |
+ _ = k |
|
1296 |
+ _ = v |
|
1297 |
+ mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1298 |
+ n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1299 |
+ } |
|
1300 |
+ } |
|
1301 |
+ return n |
|
1302 |
+} |
|
1303 |
+ |
|
1304 |
+func (m *PrepareSnapshotResponse) Size() (n int) { |
|
1305 |
+ var l int |
|
1306 |
+ _ = l |
|
1307 |
+ if len(m.Mounts) > 0 { |
|
1308 |
+ for _, e := range m.Mounts { |
|
1309 |
+ l = e.Size() |
|
1310 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1311 |
+ } |
|
1312 |
+ } |
|
1313 |
+ return n |
|
1314 |
+} |
|
1315 |
+ |
|
1316 |
+func (m *ViewSnapshotRequest) Size() (n int) { |
|
1317 |
+ var l int |
|
1318 |
+ _ = l |
|
1319 |
+ l = len(m.Snapshotter) |
|
1320 |
+ if l > 0 { |
|
1321 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1322 |
+ } |
|
1323 |
+ l = len(m.Key) |
|
1324 |
+ if l > 0 { |
|
1325 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1326 |
+ } |
|
1327 |
+ l = len(m.Parent) |
|
1328 |
+ if l > 0 { |
|
1329 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1330 |
+ } |
|
1331 |
+ if len(m.Labels) > 0 { |
|
1332 |
+ for k, v := range m.Labels { |
|
1333 |
+ _ = k |
|
1334 |
+ _ = v |
|
1335 |
+ mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1336 |
+ n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1337 |
+ } |
|
1338 |
+ } |
|
1339 |
+ return n |
|
1340 |
+} |
|
1341 |
+ |
|
1342 |
+func (m *ViewSnapshotResponse) Size() (n int) { |
|
1343 |
+ var l int |
|
1344 |
+ _ = l |
|
1345 |
+ if len(m.Mounts) > 0 { |
|
1346 |
+ for _, e := range m.Mounts { |
|
1347 |
+ l = e.Size() |
|
1348 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1349 |
+ } |
|
1350 |
+ } |
|
1351 |
+ return n |
|
1352 |
+} |
|
1353 |
+ |
|
1354 |
+func (m *MountsRequest) Size() (n int) { |
|
1355 |
+ var l int |
|
1356 |
+ _ = l |
|
1357 |
+ l = len(m.Snapshotter) |
|
1358 |
+ if l > 0 { |
|
1359 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1360 |
+ } |
|
1361 |
+ l = len(m.Key) |
|
1362 |
+ if l > 0 { |
|
1363 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1364 |
+ } |
|
1365 |
+ return n |
|
1366 |
+} |
|
1367 |
+ |
|
1368 |
+func (m *MountsResponse) Size() (n int) { |
|
1369 |
+ var l int |
|
1370 |
+ _ = l |
|
1371 |
+ if len(m.Mounts) > 0 { |
|
1372 |
+ for _, e := range m.Mounts { |
|
1373 |
+ l = e.Size() |
|
1374 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1375 |
+ } |
|
1376 |
+ } |
|
1377 |
+ return n |
|
1378 |
+} |
|
1379 |
+ |
|
1380 |
+func (m *RemoveSnapshotRequest) Size() (n int) { |
|
1381 |
+ var l int |
|
1382 |
+ _ = l |
|
1383 |
+ l = len(m.Snapshotter) |
|
1384 |
+ if l > 0 { |
|
1385 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1386 |
+ } |
|
1387 |
+ l = len(m.Key) |
|
1388 |
+ if l > 0 { |
|
1389 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1390 |
+ } |
|
1391 |
+ return n |
|
1392 |
+} |
|
1393 |
+ |
|
1394 |
+func (m *CommitSnapshotRequest) Size() (n int) { |
|
1395 |
+ var l int |
|
1396 |
+ _ = l |
|
1397 |
+ l = len(m.Snapshotter) |
|
1398 |
+ if l > 0 { |
|
1399 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1400 |
+ } |
|
1401 |
+ l = len(m.Name) |
|
1402 |
+ if l > 0 { |
|
1403 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1404 |
+ } |
|
1405 |
+ l = len(m.Key) |
|
1406 |
+ if l > 0 { |
|
1407 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1408 |
+ } |
|
1409 |
+ if len(m.Labels) > 0 { |
|
1410 |
+ for k, v := range m.Labels { |
|
1411 |
+ _ = k |
|
1412 |
+ _ = v |
|
1413 |
+ mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1414 |
+ n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1415 |
+ } |
|
1416 |
+ } |
|
1417 |
+ return n |
|
1418 |
+} |
|
1419 |
+ |
|
1420 |
+func (m *StatSnapshotRequest) Size() (n int) { |
|
1421 |
+ var l int |
|
1422 |
+ _ = l |
|
1423 |
+ l = len(m.Snapshotter) |
|
1424 |
+ if l > 0 { |
|
1425 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1426 |
+ } |
|
1427 |
+ l = len(m.Key) |
|
1428 |
+ if l > 0 { |
|
1429 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1430 |
+ } |
|
1431 |
+ return n |
|
1432 |
+} |
|
1433 |
+ |
|
1434 |
+func (m *Info) Size() (n int) { |
|
1435 |
+ var l int |
|
1436 |
+ _ = l |
|
1437 |
+ l = len(m.Name) |
|
1438 |
+ if l > 0 { |
|
1439 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1440 |
+ } |
|
1441 |
+ l = len(m.Parent) |
|
1442 |
+ if l > 0 { |
|
1443 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1444 |
+ } |
|
1445 |
+ if m.Kind != 0 { |
|
1446 |
+ n += 1 + sovSnapshots(uint64(m.Kind)) |
|
1447 |
+ } |
|
1448 |
+ l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) |
|
1449 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1450 |
+ l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt) |
|
1451 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1452 |
+ if len(m.Labels) > 0 { |
|
1453 |
+ for k, v := range m.Labels { |
|
1454 |
+ _ = k |
|
1455 |
+ _ = v |
|
1456 |
+ mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v))) |
|
1457 |
+ n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize)) |
|
1458 |
+ } |
|
1459 |
+ } |
|
1460 |
+ return n |
|
1461 |
+} |
|
1462 |
+ |
|
1463 |
+func (m *StatSnapshotResponse) Size() (n int) { |
|
1464 |
+ var l int |
|
1465 |
+ _ = l |
|
1466 |
+ l = m.Info.Size() |
|
1467 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1468 |
+ return n |
|
1469 |
+} |
|
1470 |
+ |
|
1471 |
+func (m *UpdateSnapshotRequest) Size() (n int) { |
|
1472 |
+ var l int |
|
1473 |
+ _ = l |
|
1474 |
+ l = len(m.Snapshotter) |
|
1475 |
+ if l > 0 { |
|
1476 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1477 |
+ } |
|
1478 |
+ l = m.Info.Size() |
|
1479 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1480 |
+ if m.UpdateMask != nil { |
|
1481 |
+ l = m.UpdateMask.Size() |
|
1482 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1483 |
+ } |
|
1484 |
+ return n |
|
1485 |
+} |
|
1486 |
+ |
|
1487 |
+func (m *UpdateSnapshotResponse) Size() (n int) { |
|
1488 |
+ var l int |
|
1489 |
+ _ = l |
|
1490 |
+ l = m.Info.Size() |
|
1491 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1492 |
+ return n |
|
1493 |
+} |
|
1494 |
+ |
|
1495 |
+func (m *ListSnapshotsRequest) Size() (n int) { |
|
1496 |
+ var l int |
|
1497 |
+ _ = l |
|
1498 |
+ l = len(m.Snapshotter) |
|
1499 |
+ if l > 0 { |
|
1500 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1501 |
+ } |
|
1502 |
+ return n |
|
1503 |
+} |
|
1504 |
+ |
|
1505 |
+func (m *ListSnapshotsResponse) Size() (n int) { |
|
1506 |
+ var l int |
|
1507 |
+ _ = l |
|
1508 |
+ if len(m.Info) > 0 { |
|
1509 |
+ for _, e := range m.Info { |
|
1510 |
+ l = e.Size() |
|
1511 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1512 |
+ } |
|
1513 |
+ } |
|
1514 |
+ return n |
|
1515 |
+} |
|
1516 |
+ |
|
1517 |
+func (m *UsageRequest) Size() (n int) { |
|
1518 |
+ var l int |
|
1519 |
+ _ = l |
|
1520 |
+ l = len(m.Snapshotter) |
|
1521 |
+ if l > 0 { |
|
1522 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1523 |
+ } |
|
1524 |
+ l = len(m.Key) |
|
1525 |
+ if l > 0 { |
|
1526 |
+ n += 1 + l + sovSnapshots(uint64(l)) |
|
1527 |
+ } |
|
1528 |
+ return n |
|
1529 |
+} |
|
1530 |
+ |
|
1531 |
+func (m *UsageResponse) Size() (n int) { |
|
1532 |
+ var l int |
|
1533 |
+ _ = l |
|
1534 |
+ if m.Size_ != 0 { |
|
1535 |
+ n += 1 + sovSnapshots(uint64(m.Size_)) |
|
1536 |
+ } |
|
1537 |
+ if m.Inodes != 0 { |
|
1538 |
+ n += 1 + sovSnapshots(uint64(m.Inodes)) |
|
1539 |
+ } |
|
1540 |
+ return n |
|
1541 |
+} |
|
1542 |
+ |
|
1543 |
+func sovSnapshots(x uint64) (n int) { |
|
1544 |
+ for { |
|
1545 |
+ n++ |
|
1546 |
+ x >>= 7 |
|
1547 |
+ if x == 0 { |
|
1548 |
+ break |
|
1549 |
+ } |
|
1550 |
+ } |
|
1551 |
+ return n |
|
1552 |
+} |
|
1553 |
+func sozSnapshots(x uint64) (n int) { |
|
1554 |
+ return sovSnapshots(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
|
1555 |
+} |
|
1556 |
+func (this *PrepareSnapshotRequest) String() string { |
|
1557 |
+ if this == nil { |
|
1558 |
+ return "nil" |
|
1559 |
+ } |
|
1560 |
+ keysForLabels := make([]string, 0, len(this.Labels)) |
|
1561 |
+ for k, _ := range this.Labels { |
|
1562 |
+ keysForLabels = append(keysForLabels, k) |
|
1563 |
+ } |
|
1564 |
+ github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1565 |
+ mapStringForLabels := "map[string]string{" |
|
1566 |
+ for _, k := range keysForLabels { |
|
1567 |
+ mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1568 |
+ } |
|
1569 |
+ mapStringForLabels += "}" |
|
1570 |
+ s := strings.Join([]string{`&PrepareSnapshotRequest{`, |
|
1571 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1572 |
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1573 |
+ `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, |
|
1574 |
+ `Labels:` + mapStringForLabels + `,`, |
|
1575 |
+ `}`, |
|
1576 |
+ }, "") |
|
1577 |
+ return s |
|
1578 |
+} |
|
1579 |
+func (this *PrepareSnapshotResponse) String() string { |
|
1580 |
+ if this == nil { |
|
1581 |
+ return "nil" |
|
1582 |
+ } |
|
1583 |
+ s := strings.Join([]string{`&PrepareSnapshotResponse{`, |
|
1584 |
+ `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`, |
|
1585 |
+ `}`, |
|
1586 |
+ }, "") |
|
1587 |
+ return s |
|
1588 |
+} |
|
1589 |
+func (this *ViewSnapshotRequest) String() string { |
|
1590 |
+ if this == nil { |
|
1591 |
+ return "nil" |
|
1592 |
+ } |
|
1593 |
+ keysForLabels := make([]string, 0, len(this.Labels)) |
|
1594 |
+ for k, _ := range this.Labels { |
|
1595 |
+ keysForLabels = append(keysForLabels, k) |
|
1596 |
+ } |
|
1597 |
+ github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1598 |
+ mapStringForLabels := "map[string]string{" |
|
1599 |
+ for _, k := range keysForLabels { |
|
1600 |
+ mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1601 |
+ } |
|
1602 |
+ mapStringForLabels += "}" |
|
1603 |
+ s := strings.Join([]string{`&ViewSnapshotRequest{`, |
|
1604 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1605 |
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1606 |
+ `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, |
|
1607 |
+ `Labels:` + mapStringForLabels + `,`, |
|
1608 |
+ `}`, |
|
1609 |
+ }, "") |
|
1610 |
+ return s |
|
1611 |
+} |
|
1612 |
+func (this *ViewSnapshotResponse) String() string { |
|
1613 |
+ if this == nil { |
|
1614 |
+ return "nil" |
|
1615 |
+ } |
|
1616 |
+ s := strings.Join([]string{`&ViewSnapshotResponse{`, |
|
1617 |
+ `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`, |
|
1618 |
+ `}`, |
|
1619 |
+ }, "") |
|
1620 |
+ return s |
|
1621 |
+} |
|
1622 |
+func (this *MountsRequest) String() string { |
|
1623 |
+ if this == nil { |
|
1624 |
+ return "nil" |
|
1625 |
+ } |
|
1626 |
+ s := strings.Join([]string{`&MountsRequest{`, |
|
1627 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1628 |
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1629 |
+ `}`, |
|
1630 |
+ }, "") |
|
1631 |
+ return s |
|
1632 |
+} |
|
1633 |
+func (this *MountsResponse) String() string { |
|
1634 |
+ if this == nil { |
|
1635 |
+ return "nil" |
|
1636 |
+ } |
|
1637 |
+ s := strings.Join([]string{`&MountsResponse{`, |
|
1638 |
+ `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`, |
|
1639 |
+ `}`, |
|
1640 |
+ }, "") |
|
1641 |
+ return s |
|
1642 |
+} |
|
1643 |
+func (this *RemoveSnapshotRequest) String() string { |
|
1644 |
+ if this == nil { |
|
1645 |
+ return "nil" |
|
1646 |
+ } |
|
1647 |
+ s := strings.Join([]string{`&RemoveSnapshotRequest{`, |
|
1648 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1649 |
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1650 |
+ `}`, |
|
1651 |
+ }, "") |
|
1652 |
+ return s |
|
1653 |
+} |
|
1654 |
+func (this *CommitSnapshotRequest) String() string { |
|
1655 |
+ if this == nil { |
|
1656 |
+ return "nil" |
|
1657 |
+ } |
|
1658 |
+ keysForLabels := make([]string, 0, len(this.Labels)) |
|
1659 |
+ for k, _ := range this.Labels { |
|
1660 |
+ keysForLabels = append(keysForLabels, k) |
|
1661 |
+ } |
|
1662 |
+ github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1663 |
+ mapStringForLabels := "map[string]string{" |
|
1664 |
+ for _, k := range keysForLabels { |
|
1665 |
+ mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1666 |
+ } |
|
1667 |
+ mapStringForLabels += "}" |
|
1668 |
+ s := strings.Join([]string{`&CommitSnapshotRequest{`, |
|
1669 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1670 |
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`, |
|
1671 |
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1672 |
+ `Labels:` + mapStringForLabels + `,`, |
|
1673 |
+ `}`, |
|
1674 |
+ }, "") |
|
1675 |
+ return s |
|
1676 |
+} |
|
1677 |
+func (this *StatSnapshotRequest) String() string { |
|
1678 |
+ if this == nil { |
|
1679 |
+ return "nil" |
|
1680 |
+ } |
|
1681 |
+ s := strings.Join([]string{`&StatSnapshotRequest{`, |
|
1682 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1683 |
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1684 |
+ `}`, |
|
1685 |
+ }, "") |
|
1686 |
+ return s |
|
1687 |
+} |
|
1688 |
+func (this *Info) String() string { |
|
1689 |
+ if this == nil { |
|
1690 |
+ return "nil" |
|
1691 |
+ } |
|
1692 |
+ keysForLabels := make([]string, 0, len(this.Labels)) |
|
1693 |
+ for k, _ := range this.Labels { |
|
1694 |
+ keysForLabels = append(keysForLabels, k) |
|
1695 |
+ } |
|
1696 |
+ github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) |
|
1697 |
+ mapStringForLabels := "map[string]string{" |
|
1698 |
+ for _, k := range keysForLabels { |
|
1699 |
+ mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) |
|
1700 |
+ } |
|
1701 |
+ mapStringForLabels += "}" |
|
1702 |
+ s := strings.Join([]string{`&Info{`, |
|
1703 |
+ `Name:` + fmt.Sprintf("%v", this.Name) + `,`, |
|
1704 |
+ `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, |
|
1705 |
+ `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, |
|
1706 |
+ `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, |
|
1707 |
+ `UpdatedAt:` + strings.Replace(strings.Replace(this.UpdatedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, |
|
1708 |
+ `Labels:` + mapStringForLabels + `,`, |
|
1709 |
+ `}`, |
|
1710 |
+ }, "") |
|
1711 |
+ return s |
|
1712 |
+} |
|
1713 |
+func (this *StatSnapshotResponse) String() string { |
|
1714 |
+ if this == nil { |
|
1715 |
+ return "nil" |
|
1716 |
+ } |
|
1717 |
+ s := strings.Join([]string{`&StatSnapshotResponse{`, |
|
1718 |
+ `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1719 |
+ `}`, |
|
1720 |
+ }, "") |
|
1721 |
+ return s |
|
1722 |
+} |
|
1723 |
+func (this *UpdateSnapshotRequest) String() string { |
|
1724 |
+ if this == nil { |
|
1725 |
+ return "nil" |
|
1726 |
+ } |
|
1727 |
+ s := strings.Join([]string{`&UpdateSnapshotRequest{`, |
|
1728 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1729 |
+ `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1730 |
+ `UpdateMask:` + strings.Replace(fmt.Sprintf("%v", this.UpdateMask), "FieldMask", "google_protobuf2.FieldMask", 1) + `,`, |
|
1731 |
+ `}`, |
|
1732 |
+ }, "") |
|
1733 |
+ return s |
|
1734 |
+} |
|
1735 |
+func (this *UpdateSnapshotResponse) String() string { |
|
1736 |
+ if this == nil { |
|
1737 |
+ return "nil" |
|
1738 |
+ } |
|
1739 |
+ s := strings.Join([]string{`&UpdateSnapshotResponse{`, |
|
1740 |
+ `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1741 |
+ `}`, |
|
1742 |
+ }, "") |
|
1743 |
+ return s |
|
1744 |
+} |
|
1745 |
+func (this *ListSnapshotsRequest) String() string { |
|
1746 |
+ if this == nil { |
|
1747 |
+ return "nil" |
|
1748 |
+ } |
|
1749 |
+ s := strings.Join([]string{`&ListSnapshotsRequest{`, |
|
1750 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1751 |
+ `}`, |
|
1752 |
+ }, "") |
|
1753 |
+ return s |
|
1754 |
+} |
|
1755 |
+func (this *ListSnapshotsResponse) String() string { |
|
1756 |
+ if this == nil { |
|
1757 |
+ return "nil" |
|
1758 |
+ } |
|
1759 |
+ s := strings.Join([]string{`&ListSnapshotsResponse{`, |
|
1760 |
+ `Info:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Info), "Info", "Info", 1), `&`, ``, 1) + `,`, |
|
1761 |
+ `}`, |
|
1762 |
+ }, "") |
|
1763 |
+ return s |
|
1764 |
+} |
|
1765 |
+func (this *UsageRequest) String() string { |
|
1766 |
+ if this == nil { |
|
1767 |
+ return "nil" |
|
1768 |
+ } |
|
1769 |
+ s := strings.Join([]string{`&UsageRequest{`, |
|
1770 |
+ `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`, |
|
1771 |
+ `Key:` + fmt.Sprintf("%v", this.Key) + `,`, |
|
1772 |
+ `}`, |
|
1773 |
+ }, "") |
|
1774 |
+ return s |
|
1775 |
+} |
|
1776 |
+func (this *UsageResponse) String() string { |
|
1777 |
+ if this == nil { |
|
1778 |
+ return "nil" |
|
1779 |
+ } |
|
1780 |
+ s := strings.Join([]string{`&UsageResponse{`, |
|
1781 |
+ `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, |
|
1782 |
+ `Inodes:` + fmt.Sprintf("%v", this.Inodes) + `,`, |
|
1783 |
+ `}`, |
|
1784 |
+ }, "") |
|
1785 |
+ return s |
|
1786 |
+} |
|
1787 |
+func valueToStringSnapshots(v interface{}) string { |
|
1788 |
+ rv := reflect.ValueOf(v) |
|
1789 |
+ if rv.IsNil() { |
|
1790 |
+ return "nil" |
|
1791 |
+ } |
|
1792 |
+ pv := reflect.Indirect(rv).Interface() |
|
1793 |
+ return fmt.Sprintf("*%v", pv) |
|
1794 |
+} |
|
1795 |
+func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
1796 |
+ l := len(dAtA) |
|
1797 |
+ iNdEx := 0 |
|
1798 |
+ for iNdEx < l { |
|
1799 |
+ preIndex := iNdEx |
|
1800 |
+ var wire uint64 |
|
1801 |
+ for shift := uint(0); ; shift += 7 { |
|
1802 |
+ if shift >= 64 { |
|
1803 |
+ return ErrIntOverflowSnapshots |
|
1804 |
+ } |
|
1805 |
+ if iNdEx >= l { |
|
1806 |
+ return io.ErrUnexpectedEOF |
|
1807 |
+ } |
|
1808 |
+ b := dAtA[iNdEx] |
|
1809 |
+ iNdEx++ |
|
1810 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
1811 |
+ if b < 0x80 { |
|
1812 |
+ break |
|
1813 |
+ } |
|
1814 |
+ } |
|
1815 |
+ fieldNum := int32(wire >> 3) |
|
1816 |
+ wireType := int(wire & 0x7) |
|
1817 |
+ if wireType == 4 { |
|
1818 |
+ return fmt.Errorf("proto: PrepareSnapshotRequest: wiretype end group for non-group") |
|
1819 |
+ } |
|
1820 |
+ if fieldNum <= 0 { |
|
1821 |
+ return fmt.Errorf("proto: PrepareSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
1822 |
+ } |
|
1823 |
+ switch fieldNum { |
|
1824 |
+ case 1: |
|
1825 |
+ if wireType != 2 { |
|
1826 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
1827 |
+ } |
|
1828 |
+ var stringLen uint64 |
|
1829 |
+ for shift := uint(0); ; shift += 7 { |
|
1830 |
+ if shift >= 64 { |
|
1831 |
+ return ErrIntOverflowSnapshots |
|
1832 |
+ } |
|
1833 |
+ if iNdEx >= l { |
|
1834 |
+ return io.ErrUnexpectedEOF |
|
1835 |
+ } |
|
1836 |
+ b := dAtA[iNdEx] |
|
1837 |
+ iNdEx++ |
|
1838 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
1839 |
+ if b < 0x80 { |
|
1840 |
+ break |
|
1841 |
+ } |
|
1842 |
+ } |
|
1843 |
+ intStringLen := int(stringLen) |
|
1844 |
+ if intStringLen < 0 { |
|
1845 |
+ return ErrInvalidLengthSnapshots |
|
1846 |
+ } |
|
1847 |
+ postIndex := iNdEx + intStringLen |
|
1848 |
+ if postIndex > l { |
|
1849 |
+ return io.ErrUnexpectedEOF |
|
1850 |
+ } |
|
1851 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
1852 |
+ iNdEx = postIndex |
|
1853 |
+ case 2: |
|
1854 |
+ if wireType != 2 { |
|
1855 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
1856 |
+ } |
|
1857 |
+ var stringLen uint64 |
|
1858 |
+ for shift := uint(0); ; shift += 7 { |
|
1859 |
+ if shift >= 64 { |
|
1860 |
+ return ErrIntOverflowSnapshots |
|
1861 |
+ } |
|
1862 |
+ if iNdEx >= l { |
|
1863 |
+ return io.ErrUnexpectedEOF |
|
1864 |
+ } |
|
1865 |
+ b := dAtA[iNdEx] |
|
1866 |
+ iNdEx++ |
|
1867 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
1868 |
+ if b < 0x80 { |
|
1869 |
+ break |
|
1870 |
+ } |
|
1871 |
+ } |
|
1872 |
+ intStringLen := int(stringLen) |
|
1873 |
+ if intStringLen < 0 { |
|
1874 |
+ return ErrInvalidLengthSnapshots |
|
1875 |
+ } |
|
1876 |
+ postIndex := iNdEx + intStringLen |
|
1877 |
+ if postIndex > l { |
|
1878 |
+ return io.ErrUnexpectedEOF |
|
1879 |
+ } |
|
1880 |
+ m.Key = string(dAtA[iNdEx:postIndex]) |
|
1881 |
+ iNdEx = postIndex |
|
1882 |
+ case 3: |
|
1883 |
+ if wireType != 2 { |
|
1884 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) |
|
1885 |
+ } |
|
1886 |
+ var stringLen uint64 |
|
1887 |
+ for shift := uint(0); ; shift += 7 { |
|
1888 |
+ if shift >= 64 { |
|
1889 |
+ return ErrIntOverflowSnapshots |
|
1890 |
+ } |
|
1891 |
+ if iNdEx >= l { |
|
1892 |
+ return io.ErrUnexpectedEOF |
|
1893 |
+ } |
|
1894 |
+ b := dAtA[iNdEx] |
|
1895 |
+ iNdEx++ |
|
1896 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
1897 |
+ if b < 0x80 { |
|
1898 |
+ break |
|
1899 |
+ } |
|
1900 |
+ } |
|
1901 |
+ intStringLen := int(stringLen) |
|
1902 |
+ if intStringLen < 0 { |
|
1903 |
+ return ErrInvalidLengthSnapshots |
|
1904 |
+ } |
|
1905 |
+ postIndex := iNdEx + intStringLen |
|
1906 |
+ if postIndex > l { |
|
1907 |
+ return io.ErrUnexpectedEOF |
|
1908 |
+ } |
|
1909 |
+ m.Parent = string(dAtA[iNdEx:postIndex]) |
|
1910 |
+ iNdEx = postIndex |
|
1911 |
+ case 4: |
|
1912 |
+ if wireType != 2 { |
|
1913 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
1914 |
+ } |
|
1915 |
+ var msglen int |
|
1916 |
+ for shift := uint(0); ; shift += 7 { |
|
1917 |
+ if shift >= 64 { |
|
1918 |
+ return ErrIntOverflowSnapshots |
|
1919 |
+ } |
|
1920 |
+ if iNdEx >= l { |
|
1921 |
+ return io.ErrUnexpectedEOF |
|
1922 |
+ } |
|
1923 |
+ b := dAtA[iNdEx] |
|
1924 |
+ iNdEx++ |
|
1925 |
+ msglen |= (int(b) & 0x7F) << shift |
|
1926 |
+ if b < 0x80 { |
|
1927 |
+ break |
|
1928 |
+ } |
|
1929 |
+ } |
|
1930 |
+ if msglen < 0 { |
|
1931 |
+ return ErrInvalidLengthSnapshots |
|
1932 |
+ } |
|
1933 |
+ postIndex := iNdEx + msglen |
|
1934 |
+ if postIndex > l { |
|
1935 |
+ return io.ErrUnexpectedEOF |
|
1936 |
+ } |
|
1937 |
+ if m.Labels == nil { |
|
1938 |
+ m.Labels = make(map[string]string) |
|
1939 |
+ } |
|
1940 |
+ var mapkey string |
|
1941 |
+ var mapvalue string |
|
1942 |
+ for iNdEx < postIndex { |
|
1943 |
+ entryPreIndex := iNdEx |
|
1944 |
+ var wire uint64 |
|
1945 |
+ for shift := uint(0); ; shift += 7 { |
|
1946 |
+ if shift >= 64 { |
|
1947 |
+ return ErrIntOverflowSnapshots |
|
1948 |
+ } |
|
1949 |
+ if iNdEx >= l { |
|
1950 |
+ return io.ErrUnexpectedEOF |
|
1951 |
+ } |
|
1952 |
+ b := dAtA[iNdEx] |
|
1953 |
+ iNdEx++ |
|
1954 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
1955 |
+ if b < 0x80 { |
|
1956 |
+ break |
|
1957 |
+ } |
|
1958 |
+ } |
|
1959 |
+ fieldNum := int32(wire >> 3) |
|
1960 |
+ if fieldNum == 1 { |
|
1961 |
+ var stringLenmapkey uint64 |
|
1962 |
+ for shift := uint(0); ; shift += 7 { |
|
1963 |
+ if shift >= 64 { |
|
1964 |
+ return ErrIntOverflowSnapshots |
|
1965 |
+ } |
|
1966 |
+ if iNdEx >= l { |
|
1967 |
+ return io.ErrUnexpectedEOF |
|
1968 |
+ } |
|
1969 |
+ b := dAtA[iNdEx] |
|
1970 |
+ iNdEx++ |
|
1971 |
+ stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
1972 |
+ if b < 0x80 { |
|
1973 |
+ break |
|
1974 |
+ } |
|
1975 |
+ } |
|
1976 |
+ intStringLenmapkey := int(stringLenmapkey) |
|
1977 |
+ if intStringLenmapkey < 0 { |
|
1978 |
+ return ErrInvalidLengthSnapshots |
|
1979 |
+ } |
|
1980 |
+ postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
1981 |
+ if postStringIndexmapkey > l { |
|
1982 |
+ return io.ErrUnexpectedEOF |
|
1983 |
+ } |
|
1984 |
+ mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
1985 |
+ iNdEx = postStringIndexmapkey |
|
1986 |
+ } else if fieldNum == 2 { |
|
1987 |
+ var stringLenmapvalue uint64 |
|
1988 |
+ for shift := uint(0); ; shift += 7 { |
|
1989 |
+ if shift >= 64 { |
|
1990 |
+ return ErrIntOverflowSnapshots |
|
1991 |
+ } |
|
1992 |
+ if iNdEx >= l { |
|
1993 |
+ return io.ErrUnexpectedEOF |
|
1994 |
+ } |
|
1995 |
+ b := dAtA[iNdEx] |
|
1996 |
+ iNdEx++ |
|
1997 |
+ stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
1998 |
+ if b < 0x80 { |
|
1999 |
+ break |
|
2000 |
+ } |
|
2001 |
+ } |
|
2002 |
+ intStringLenmapvalue := int(stringLenmapvalue) |
|
2003 |
+ if intStringLenmapvalue < 0 { |
|
2004 |
+ return ErrInvalidLengthSnapshots |
|
2005 |
+ } |
|
2006 |
+ postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
2007 |
+ if postStringIndexmapvalue > l { |
|
2008 |
+ return io.ErrUnexpectedEOF |
|
2009 |
+ } |
|
2010 |
+ mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
2011 |
+ iNdEx = postStringIndexmapvalue |
|
2012 |
+ } else { |
|
2013 |
+ iNdEx = entryPreIndex |
|
2014 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2015 |
+ if err != nil { |
|
2016 |
+ return err |
|
2017 |
+ } |
|
2018 |
+ if skippy < 0 { |
|
2019 |
+ return ErrInvalidLengthSnapshots |
|
2020 |
+ } |
|
2021 |
+ if (iNdEx + skippy) > postIndex { |
|
2022 |
+ return io.ErrUnexpectedEOF |
|
2023 |
+ } |
|
2024 |
+ iNdEx += skippy |
|
2025 |
+ } |
|
2026 |
+ } |
|
2027 |
+ m.Labels[mapkey] = mapvalue |
|
2028 |
+ iNdEx = postIndex |
|
2029 |
+ default: |
|
2030 |
+ iNdEx = preIndex |
|
2031 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2032 |
+ if err != nil { |
|
2033 |
+ return err |
|
2034 |
+ } |
|
2035 |
+ if skippy < 0 { |
|
2036 |
+ return ErrInvalidLengthSnapshots |
|
2037 |
+ } |
|
2038 |
+ if (iNdEx + skippy) > l { |
|
2039 |
+ return io.ErrUnexpectedEOF |
|
2040 |
+ } |
|
2041 |
+ iNdEx += skippy |
|
2042 |
+ } |
|
2043 |
+ } |
|
2044 |
+ |
|
2045 |
+ if iNdEx > l { |
|
2046 |
+ return io.ErrUnexpectedEOF |
|
2047 |
+ } |
|
2048 |
+ return nil |
|
2049 |
+} |
|
2050 |
+func (m *PrepareSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
2051 |
+ l := len(dAtA) |
|
2052 |
+ iNdEx := 0 |
|
2053 |
+ for iNdEx < l { |
|
2054 |
+ preIndex := iNdEx |
|
2055 |
+ var wire uint64 |
|
2056 |
+ for shift := uint(0); ; shift += 7 { |
|
2057 |
+ if shift >= 64 { |
|
2058 |
+ return ErrIntOverflowSnapshots |
|
2059 |
+ } |
|
2060 |
+ if iNdEx >= l { |
|
2061 |
+ return io.ErrUnexpectedEOF |
|
2062 |
+ } |
|
2063 |
+ b := dAtA[iNdEx] |
|
2064 |
+ iNdEx++ |
|
2065 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2066 |
+ if b < 0x80 { |
|
2067 |
+ break |
|
2068 |
+ } |
|
2069 |
+ } |
|
2070 |
+ fieldNum := int32(wire >> 3) |
|
2071 |
+ wireType := int(wire & 0x7) |
|
2072 |
+ if wireType == 4 { |
|
2073 |
+ return fmt.Errorf("proto: PrepareSnapshotResponse: wiretype end group for non-group") |
|
2074 |
+ } |
|
2075 |
+ if fieldNum <= 0 { |
|
2076 |
+ return fmt.Errorf("proto: PrepareSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2077 |
+ } |
|
2078 |
+ switch fieldNum { |
|
2079 |
+ case 1: |
|
2080 |
+ if wireType != 2 { |
|
2081 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) |
|
2082 |
+ } |
|
2083 |
+ var msglen int |
|
2084 |
+ for shift := uint(0); ; shift += 7 { |
|
2085 |
+ if shift >= 64 { |
|
2086 |
+ return ErrIntOverflowSnapshots |
|
2087 |
+ } |
|
2088 |
+ if iNdEx >= l { |
|
2089 |
+ return io.ErrUnexpectedEOF |
|
2090 |
+ } |
|
2091 |
+ b := dAtA[iNdEx] |
|
2092 |
+ iNdEx++ |
|
2093 |
+ msglen |= (int(b) & 0x7F) << shift |
|
2094 |
+ if b < 0x80 { |
|
2095 |
+ break |
|
2096 |
+ } |
|
2097 |
+ } |
|
2098 |
+ if msglen < 0 { |
|
2099 |
+ return ErrInvalidLengthSnapshots |
|
2100 |
+ } |
|
2101 |
+ postIndex := iNdEx + msglen |
|
2102 |
+ if postIndex > l { |
|
2103 |
+ return io.ErrUnexpectedEOF |
|
2104 |
+ } |
|
2105 |
+ m.Mounts = append(m.Mounts, &containerd_types.Mount{}) |
|
2106 |
+ if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
2107 |
+ return err |
|
2108 |
+ } |
|
2109 |
+ iNdEx = postIndex |
|
2110 |
+ default: |
|
2111 |
+ iNdEx = preIndex |
|
2112 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2113 |
+ if err != nil { |
|
2114 |
+ return err |
|
2115 |
+ } |
|
2116 |
+ if skippy < 0 { |
|
2117 |
+ return ErrInvalidLengthSnapshots |
|
2118 |
+ } |
|
2119 |
+ if (iNdEx + skippy) > l { |
|
2120 |
+ return io.ErrUnexpectedEOF |
|
2121 |
+ } |
|
2122 |
+ iNdEx += skippy |
|
2123 |
+ } |
|
2124 |
+ } |
|
2125 |
+ |
|
2126 |
+ if iNdEx > l { |
|
2127 |
+ return io.ErrUnexpectedEOF |
|
2128 |
+ } |
|
2129 |
+ return nil |
|
2130 |
+} |
|
2131 |
+func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
2132 |
+ l := len(dAtA) |
|
2133 |
+ iNdEx := 0 |
|
2134 |
+ for iNdEx < l { |
|
2135 |
+ preIndex := iNdEx |
|
2136 |
+ var wire uint64 |
|
2137 |
+ for shift := uint(0); ; shift += 7 { |
|
2138 |
+ if shift >= 64 { |
|
2139 |
+ return ErrIntOverflowSnapshots |
|
2140 |
+ } |
|
2141 |
+ if iNdEx >= l { |
|
2142 |
+ return io.ErrUnexpectedEOF |
|
2143 |
+ } |
|
2144 |
+ b := dAtA[iNdEx] |
|
2145 |
+ iNdEx++ |
|
2146 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2147 |
+ if b < 0x80 { |
|
2148 |
+ break |
|
2149 |
+ } |
|
2150 |
+ } |
|
2151 |
+ fieldNum := int32(wire >> 3) |
|
2152 |
+ wireType := int(wire & 0x7) |
|
2153 |
+ if wireType == 4 { |
|
2154 |
+ return fmt.Errorf("proto: ViewSnapshotRequest: wiretype end group for non-group") |
|
2155 |
+ } |
|
2156 |
+ if fieldNum <= 0 { |
|
2157 |
+ return fmt.Errorf("proto: ViewSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2158 |
+ } |
|
2159 |
+ switch fieldNum { |
|
2160 |
+ case 1: |
|
2161 |
+ if wireType != 2 { |
|
2162 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2163 |
+ } |
|
2164 |
+ var stringLen uint64 |
|
2165 |
+ for shift := uint(0); ; shift += 7 { |
|
2166 |
+ if shift >= 64 { |
|
2167 |
+ return ErrIntOverflowSnapshots |
|
2168 |
+ } |
|
2169 |
+ if iNdEx >= l { |
|
2170 |
+ return io.ErrUnexpectedEOF |
|
2171 |
+ } |
|
2172 |
+ b := dAtA[iNdEx] |
|
2173 |
+ iNdEx++ |
|
2174 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2175 |
+ if b < 0x80 { |
|
2176 |
+ break |
|
2177 |
+ } |
|
2178 |
+ } |
|
2179 |
+ intStringLen := int(stringLen) |
|
2180 |
+ if intStringLen < 0 { |
|
2181 |
+ return ErrInvalidLengthSnapshots |
|
2182 |
+ } |
|
2183 |
+ postIndex := iNdEx + intStringLen |
|
2184 |
+ if postIndex > l { |
|
2185 |
+ return io.ErrUnexpectedEOF |
|
2186 |
+ } |
|
2187 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2188 |
+ iNdEx = postIndex |
|
2189 |
+ case 2: |
|
2190 |
+ if wireType != 2 { |
|
2191 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2192 |
+ } |
|
2193 |
+ var stringLen uint64 |
|
2194 |
+ for shift := uint(0); ; shift += 7 { |
|
2195 |
+ if shift >= 64 { |
|
2196 |
+ return ErrIntOverflowSnapshots |
|
2197 |
+ } |
|
2198 |
+ if iNdEx >= l { |
|
2199 |
+ return io.ErrUnexpectedEOF |
|
2200 |
+ } |
|
2201 |
+ b := dAtA[iNdEx] |
|
2202 |
+ iNdEx++ |
|
2203 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2204 |
+ if b < 0x80 { |
|
2205 |
+ break |
|
2206 |
+ } |
|
2207 |
+ } |
|
2208 |
+ intStringLen := int(stringLen) |
|
2209 |
+ if intStringLen < 0 { |
|
2210 |
+ return ErrInvalidLengthSnapshots |
|
2211 |
+ } |
|
2212 |
+ postIndex := iNdEx + intStringLen |
|
2213 |
+ if postIndex > l { |
|
2214 |
+ return io.ErrUnexpectedEOF |
|
2215 |
+ } |
|
2216 |
+ m.Key = string(dAtA[iNdEx:postIndex]) |
|
2217 |
+ iNdEx = postIndex |
|
2218 |
+ case 3: |
|
2219 |
+ if wireType != 2 { |
|
2220 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) |
|
2221 |
+ } |
|
2222 |
+ var stringLen uint64 |
|
2223 |
+ for shift := uint(0); ; shift += 7 { |
|
2224 |
+ if shift >= 64 { |
|
2225 |
+ return ErrIntOverflowSnapshots |
|
2226 |
+ } |
|
2227 |
+ if iNdEx >= l { |
|
2228 |
+ return io.ErrUnexpectedEOF |
|
2229 |
+ } |
|
2230 |
+ b := dAtA[iNdEx] |
|
2231 |
+ iNdEx++ |
|
2232 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2233 |
+ if b < 0x80 { |
|
2234 |
+ break |
|
2235 |
+ } |
|
2236 |
+ } |
|
2237 |
+ intStringLen := int(stringLen) |
|
2238 |
+ if intStringLen < 0 { |
|
2239 |
+ return ErrInvalidLengthSnapshots |
|
2240 |
+ } |
|
2241 |
+ postIndex := iNdEx + intStringLen |
|
2242 |
+ if postIndex > l { |
|
2243 |
+ return io.ErrUnexpectedEOF |
|
2244 |
+ } |
|
2245 |
+ m.Parent = string(dAtA[iNdEx:postIndex]) |
|
2246 |
+ iNdEx = postIndex |
|
2247 |
+ case 4: |
|
2248 |
+ if wireType != 2 { |
|
2249 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
2250 |
+ } |
|
2251 |
+ var msglen int |
|
2252 |
+ for shift := uint(0); ; shift += 7 { |
|
2253 |
+ if shift >= 64 { |
|
2254 |
+ return ErrIntOverflowSnapshots |
|
2255 |
+ } |
|
2256 |
+ if iNdEx >= l { |
|
2257 |
+ return io.ErrUnexpectedEOF |
|
2258 |
+ } |
|
2259 |
+ b := dAtA[iNdEx] |
|
2260 |
+ iNdEx++ |
|
2261 |
+ msglen |= (int(b) & 0x7F) << shift |
|
2262 |
+ if b < 0x80 { |
|
2263 |
+ break |
|
2264 |
+ } |
|
2265 |
+ } |
|
2266 |
+ if msglen < 0 { |
|
2267 |
+ return ErrInvalidLengthSnapshots |
|
2268 |
+ } |
|
2269 |
+ postIndex := iNdEx + msglen |
|
2270 |
+ if postIndex > l { |
|
2271 |
+ return io.ErrUnexpectedEOF |
|
2272 |
+ } |
|
2273 |
+ if m.Labels == nil { |
|
2274 |
+ m.Labels = make(map[string]string) |
|
2275 |
+ } |
|
2276 |
+ var mapkey string |
|
2277 |
+ var mapvalue string |
|
2278 |
+ for iNdEx < postIndex { |
|
2279 |
+ entryPreIndex := iNdEx |
|
2280 |
+ var wire uint64 |
|
2281 |
+ for shift := uint(0); ; shift += 7 { |
|
2282 |
+ if shift >= 64 { |
|
2283 |
+ return ErrIntOverflowSnapshots |
|
2284 |
+ } |
|
2285 |
+ if iNdEx >= l { |
|
2286 |
+ return io.ErrUnexpectedEOF |
|
2287 |
+ } |
|
2288 |
+ b := dAtA[iNdEx] |
|
2289 |
+ iNdEx++ |
|
2290 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2291 |
+ if b < 0x80 { |
|
2292 |
+ break |
|
2293 |
+ } |
|
2294 |
+ } |
|
2295 |
+ fieldNum := int32(wire >> 3) |
|
2296 |
+ if fieldNum == 1 { |
|
2297 |
+ var stringLenmapkey uint64 |
|
2298 |
+ for shift := uint(0); ; shift += 7 { |
|
2299 |
+ if shift >= 64 { |
|
2300 |
+ return ErrIntOverflowSnapshots |
|
2301 |
+ } |
|
2302 |
+ if iNdEx >= l { |
|
2303 |
+ return io.ErrUnexpectedEOF |
|
2304 |
+ } |
|
2305 |
+ b := dAtA[iNdEx] |
|
2306 |
+ iNdEx++ |
|
2307 |
+ stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
2308 |
+ if b < 0x80 { |
|
2309 |
+ break |
|
2310 |
+ } |
|
2311 |
+ } |
|
2312 |
+ intStringLenmapkey := int(stringLenmapkey) |
|
2313 |
+ if intStringLenmapkey < 0 { |
|
2314 |
+ return ErrInvalidLengthSnapshots |
|
2315 |
+ } |
|
2316 |
+ postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
2317 |
+ if postStringIndexmapkey > l { |
|
2318 |
+ return io.ErrUnexpectedEOF |
|
2319 |
+ } |
|
2320 |
+ mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
2321 |
+ iNdEx = postStringIndexmapkey |
|
2322 |
+ } else if fieldNum == 2 { |
|
2323 |
+ var stringLenmapvalue uint64 |
|
2324 |
+ for shift := uint(0); ; shift += 7 { |
|
2325 |
+ if shift >= 64 { |
|
2326 |
+ return ErrIntOverflowSnapshots |
|
2327 |
+ } |
|
2328 |
+ if iNdEx >= l { |
|
2329 |
+ return io.ErrUnexpectedEOF |
|
2330 |
+ } |
|
2331 |
+ b := dAtA[iNdEx] |
|
2332 |
+ iNdEx++ |
|
2333 |
+ stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
2334 |
+ if b < 0x80 { |
|
2335 |
+ break |
|
2336 |
+ } |
|
2337 |
+ } |
|
2338 |
+ intStringLenmapvalue := int(stringLenmapvalue) |
|
2339 |
+ if intStringLenmapvalue < 0 { |
|
2340 |
+ return ErrInvalidLengthSnapshots |
|
2341 |
+ } |
|
2342 |
+ postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
2343 |
+ if postStringIndexmapvalue > l { |
|
2344 |
+ return io.ErrUnexpectedEOF |
|
2345 |
+ } |
|
2346 |
+ mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
2347 |
+ iNdEx = postStringIndexmapvalue |
|
2348 |
+ } else { |
|
2349 |
+ iNdEx = entryPreIndex |
|
2350 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2351 |
+ if err != nil { |
|
2352 |
+ return err |
|
2353 |
+ } |
|
2354 |
+ if skippy < 0 { |
|
2355 |
+ return ErrInvalidLengthSnapshots |
|
2356 |
+ } |
|
2357 |
+ if (iNdEx + skippy) > postIndex { |
|
2358 |
+ return io.ErrUnexpectedEOF |
|
2359 |
+ } |
|
2360 |
+ iNdEx += skippy |
|
2361 |
+ } |
|
2362 |
+ } |
|
2363 |
+ m.Labels[mapkey] = mapvalue |
|
2364 |
+ iNdEx = postIndex |
|
2365 |
+ default: |
|
2366 |
+ iNdEx = preIndex |
|
2367 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2368 |
+ if err != nil { |
|
2369 |
+ return err |
|
2370 |
+ } |
|
2371 |
+ if skippy < 0 { |
|
2372 |
+ return ErrInvalidLengthSnapshots |
|
2373 |
+ } |
|
2374 |
+ if (iNdEx + skippy) > l { |
|
2375 |
+ return io.ErrUnexpectedEOF |
|
2376 |
+ } |
|
2377 |
+ iNdEx += skippy |
|
2378 |
+ } |
|
2379 |
+ } |
|
2380 |
+ |
|
2381 |
+ if iNdEx > l { |
|
2382 |
+ return io.ErrUnexpectedEOF |
|
2383 |
+ } |
|
2384 |
+ return nil |
|
2385 |
+} |
|
2386 |
+func (m *ViewSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
2387 |
+ l := len(dAtA) |
|
2388 |
+ iNdEx := 0 |
|
2389 |
+ for iNdEx < l { |
|
2390 |
+ preIndex := iNdEx |
|
2391 |
+ var wire uint64 |
|
2392 |
+ for shift := uint(0); ; shift += 7 { |
|
2393 |
+ if shift >= 64 { |
|
2394 |
+ return ErrIntOverflowSnapshots |
|
2395 |
+ } |
|
2396 |
+ if iNdEx >= l { |
|
2397 |
+ return io.ErrUnexpectedEOF |
|
2398 |
+ } |
|
2399 |
+ b := dAtA[iNdEx] |
|
2400 |
+ iNdEx++ |
|
2401 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2402 |
+ if b < 0x80 { |
|
2403 |
+ break |
|
2404 |
+ } |
|
2405 |
+ } |
|
2406 |
+ fieldNum := int32(wire >> 3) |
|
2407 |
+ wireType := int(wire & 0x7) |
|
2408 |
+ if wireType == 4 { |
|
2409 |
+ return fmt.Errorf("proto: ViewSnapshotResponse: wiretype end group for non-group") |
|
2410 |
+ } |
|
2411 |
+ if fieldNum <= 0 { |
|
2412 |
+ return fmt.Errorf("proto: ViewSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2413 |
+ } |
|
2414 |
+ switch fieldNum { |
|
2415 |
+ case 1: |
|
2416 |
+ if wireType != 2 { |
|
2417 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) |
|
2418 |
+ } |
|
2419 |
+ var msglen int |
|
2420 |
+ for shift := uint(0); ; shift += 7 { |
|
2421 |
+ if shift >= 64 { |
|
2422 |
+ return ErrIntOverflowSnapshots |
|
2423 |
+ } |
|
2424 |
+ if iNdEx >= l { |
|
2425 |
+ return io.ErrUnexpectedEOF |
|
2426 |
+ } |
|
2427 |
+ b := dAtA[iNdEx] |
|
2428 |
+ iNdEx++ |
|
2429 |
+ msglen |= (int(b) & 0x7F) << shift |
|
2430 |
+ if b < 0x80 { |
|
2431 |
+ break |
|
2432 |
+ } |
|
2433 |
+ } |
|
2434 |
+ if msglen < 0 { |
|
2435 |
+ return ErrInvalidLengthSnapshots |
|
2436 |
+ } |
|
2437 |
+ postIndex := iNdEx + msglen |
|
2438 |
+ if postIndex > l { |
|
2439 |
+ return io.ErrUnexpectedEOF |
|
2440 |
+ } |
|
2441 |
+ m.Mounts = append(m.Mounts, &containerd_types.Mount{}) |
|
2442 |
+ if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
2443 |
+ return err |
|
2444 |
+ } |
|
2445 |
+ iNdEx = postIndex |
|
2446 |
+ default: |
|
2447 |
+ iNdEx = preIndex |
|
2448 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2449 |
+ if err != nil { |
|
2450 |
+ return err |
|
2451 |
+ } |
|
2452 |
+ if skippy < 0 { |
|
2453 |
+ return ErrInvalidLengthSnapshots |
|
2454 |
+ } |
|
2455 |
+ if (iNdEx + skippy) > l { |
|
2456 |
+ return io.ErrUnexpectedEOF |
|
2457 |
+ } |
|
2458 |
+ iNdEx += skippy |
|
2459 |
+ } |
|
2460 |
+ } |
|
2461 |
+ |
|
2462 |
+ if iNdEx > l { |
|
2463 |
+ return io.ErrUnexpectedEOF |
|
2464 |
+ } |
|
2465 |
+ return nil |
|
2466 |
+} |
|
2467 |
+func (m *MountsRequest) Unmarshal(dAtA []byte) error { |
|
2468 |
+ l := len(dAtA) |
|
2469 |
+ iNdEx := 0 |
|
2470 |
+ for iNdEx < l { |
|
2471 |
+ preIndex := iNdEx |
|
2472 |
+ var wire uint64 |
|
2473 |
+ for shift := uint(0); ; shift += 7 { |
|
2474 |
+ if shift >= 64 { |
|
2475 |
+ return ErrIntOverflowSnapshots |
|
2476 |
+ } |
|
2477 |
+ if iNdEx >= l { |
|
2478 |
+ return io.ErrUnexpectedEOF |
|
2479 |
+ } |
|
2480 |
+ b := dAtA[iNdEx] |
|
2481 |
+ iNdEx++ |
|
2482 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2483 |
+ if b < 0x80 { |
|
2484 |
+ break |
|
2485 |
+ } |
|
2486 |
+ } |
|
2487 |
+ fieldNum := int32(wire >> 3) |
|
2488 |
+ wireType := int(wire & 0x7) |
|
2489 |
+ if wireType == 4 { |
|
2490 |
+ return fmt.Errorf("proto: MountsRequest: wiretype end group for non-group") |
|
2491 |
+ } |
|
2492 |
+ if fieldNum <= 0 { |
|
2493 |
+ return fmt.Errorf("proto: MountsRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2494 |
+ } |
|
2495 |
+ switch fieldNum { |
|
2496 |
+ case 1: |
|
2497 |
+ if wireType != 2 { |
|
2498 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2499 |
+ } |
|
2500 |
+ var stringLen uint64 |
|
2501 |
+ for shift := uint(0); ; shift += 7 { |
|
2502 |
+ if shift >= 64 { |
|
2503 |
+ return ErrIntOverflowSnapshots |
|
2504 |
+ } |
|
2505 |
+ if iNdEx >= l { |
|
2506 |
+ return io.ErrUnexpectedEOF |
|
2507 |
+ } |
|
2508 |
+ b := dAtA[iNdEx] |
|
2509 |
+ iNdEx++ |
|
2510 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2511 |
+ if b < 0x80 { |
|
2512 |
+ break |
|
2513 |
+ } |
|
2514 |
+ } |
|
2515 |
+ intStringLen := int(stringLen) |
|
2516 |
+ if intStringLen < 0 { |
|
2517 |
+ return ErrInvalidLengthSnapshots |
|
2518 |
+ } |
|
2519 |
+ postIndex := iNdEx + intStringLen |
|
2520 |
+ if postIndex > l { |
|
2521 |
+ return io.ErrUnexpectedEOF |
|
2522 |
+ } |
|
2523 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2524 |
+ iNdEx = postIndex |
|
2525 |
+ case 2: |
|
2526 |
+ if wireType != 2 { |
|
2527 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2528 |
+ } |
|
2529 |
+ var stringLen uint64 |
|
2530 |
+ for shift := uint(0); ; shift += 7 { |
|
2531 |
+ if shift >= 64 { |
|
2532 |
+ return ErrIntOverflowSnapshots |
|
2533 |
+ } |
|
2534 |
+ if iNdEx >= l { |
|
2535 |
+ return io.ErrUnexpectedEOF |
|
2536 |
+ } |
|
2537 |
+ b := dAtA[iNdEx] |
|
2538 |
+ iNdEx++ |
|
2539 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2540 |
+ if b < 0x80 { |
|
2541 |
+ break |
|
2542 |
+ } |
|
2543 |
+ } |
|
2544 |
+ intStringLen := int(stringLen) |
|
2545 |
+ if intStringLen < 0 { |
|
2546 |
+ return ErrInvalidLengthSnapshots |
|
2547 |
+ } |
|
2548 |
+ postIndex := iNdEx + intStringLen |
|
2549 |
+ if postIndex > l { |
|
2550 |
+ return io.ErrUnexpectedEOF |
|
2551 |
+ } |
|
2552 |
+ m.Key = string(dAtA[iNdEx:postIndex]) |
|
2553 |
+ iNdEx = postIndex |
|
2554 |
+ default: |
|
2555 |
+ iNdEx = preIndex |
|
2556 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2557 |
+ if err != nil { |
|
2558 |
+ return err |
|
2559 |
+ } |
|
2560 |
+ if skippy < 0 { |
|
2561 |
+ return ErrInvalidLengthSnapshots |
|
2562 |
+ } |
|
2563 |
+ if (iNdEx + skippy) > l { |
|
2564 |
+ return io.ErrUnexpectedEOF |
|
2565 |
+ } |
|
2566 |
+ iNdEx += skippy |
|
2567 |
+ } |
|
2568 |
+ } |
|
2569 |
+ |
|
2570 |
+ if iNdEx > l { |
|
2571 |
+ return io.ErrUnexpectedEOF |
|
2572 |
+ } |
|
2573 |
+ return nil |
|
2574 |
+} |
|
2575 |
+func (m *MountsResponse) Unmarshal(dAtA []byte) error { |
|
2576 |
+ l := len(dAtA) |
|
2577 |
+ iNdEx := 0 |
|
2578 |
+ for iNdEx < l { |
|
2579 |
+ preIndex := iNdEx |
|
2580 |
+ var wire uint64 |
|
2581 |
+ for shift := uint(0); ; shift += 7 { |
|
2582 |
+ if shift >= 64 { |
|
2583 |
+ return ErrIntOverflowSnapshots |
|
2584 |
+ } |
|
2585 |
+ if iNdEx >= l { |
|
2586 |
+ return io.ErrUnexpectedEOF |
|
2587 |
+ } |
|
2588 |
+ b := dAtA[iNdEx] |
|
2589 |
+ iNdEx++ |
|
2590 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2591 |
+ if b < 0x80 { |
|
2592 |
+ break |
|
2593 |
+ } |
|
2594 |
+ } |
|
2595 |
+ fieldNum := int32(wire >> 3) |
|
2596 |
+ wireType := int(wire & 0x7) |
|
2597 |
+ if wireType == 4 { |
|
2598 |
+ return fmt.Errorf("proto: MountsResponse: wiretype end group for non-group") |
|
2599 |
+ } |
|
2600 |
+ if fieldNum <= 0 { |
|
2601 |
+ return fmt.Errorf("proto: MountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2602 |
+ } |
|
2603 |
+ switch fieldNum { |
|
2604 |
+ case 1: |
|
2605 |
+ if wireType != 2 { |
|
2606 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) |
|
2607 |
+ } |
|
2608 |
+ var msglen int |
|
2609 |
+ for shift := uint(0); ; shift += 7 { |
|
2610 |
+ if shift >= 64 { |
|
2611 |
+ return ErrIntOverflowSnapshots |
|
2612 |
+ } |
|
2613 |
+ if iNdEx >= l { |
|
2614 |
+ return io.ErrUnexpectedEOF |
|
2615 |
+ } |
|
2616 |
+ b := dAtA[iNdEx] |
|
2617 |
+ iNdEx++ |
|
2618 |
+ msglen |= (int(b) & 0x7F) << shift |
|
2619 |
+ if b < 0x80 { |
|
2620 |
+ break |
|
2621 |
+ } |
|
2622 |
+ } |
|
2623 |
+ if msglen < 0 { |
|
2624 |
+ return ErrInvalidLengthSnapshots |
|
2625 |
+ } |
|
2626 |
+ postIndex := iNdEx + msglen |
|
2627 |
+ if postIndex > l { |
|
2628 |
+ return io.ErrUnexpectedEOF |
|
2629 |
+ } |
|
2630 |
+ m.Mounts = append(m.Mounts, &containerd_types.Mount{}) |
|
2631 |
+ if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
2632 |
+ return err |
|
2633 |
+ } |
|
2634 |
+ iNdEx = postIndex |
|
2635 |
+ default: |
|
2636 |
+ iNdEx = preIndex |
|
2637 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2638 |
+ if err != nil { |
|
2639 |
+ return err |
|
2640 |
+ } |
|
2641 |
+ if skippy < 0 { |
|
2642 |
+ return ErrInvalidLengthSnapshots |
|
2643 |
+ } |
|
2644 |
+ if (iNdEx + skippy) > l { |
|
2645 |
+ return io.ErrUnexpectedEOF |
|
2646 |
+ } |
|
2647 |
+ iNdEx += skippy |
|
2648 |
+ } |
|
2649 |
+ } |
|
2650 |
+ |
|
2651 |
+ if iNdEx > l { |
|
2652 |
+ return io.ErrUnexpectedEOF |
|
2653 |
+ } |
|
2654 |
+ return nil |
|
2655 |
+} |
|
2656 |
+func (m *RemoveSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
2657 |
+ l := len(dAtA) |
|
2658 |
+ iNdEx := 0 |
|
2659 |
+ for iNdEx < l { |
|
2660 |
+ preIndex := iNdEx |
|
2661 |
+ var wire uint64 |
|
2662 |
+ for shift := uint(0); ; shift += 7 { |
|
2663 |
+ if shift >= 64 { |
|
2664 |
+ return ErrIntOverflowSnapshots |
|
2665 |
+ } |
|
2666 |
+ if iNdEx >= l { |
|
2667 |
+ return io.ErrUnexpectedEOF |
|
2668 |
+ } |
|
2669 |
+ b := dAtA[iNdEx] |
|
2670 |
+ iNdEx++ |
|
2671 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2672 |
+ if b < 0x80 { |
|
2673 |
+ break |
|
2674 |
+ } |
|
2675 |
+ } |
|
2676 |
+ fieldNum := int32(wire >> 3) |
|
2677 |
+ wireType := int(wire & 0x7) |
|
2678 |
+ if wireType == 4 { |
|
2679 |
+ return fmt.Errorf("proto: RemoveSnapshotRequest: wiretype end group for non-group") |
|
2680 |
+ } |
|
2681 |
+ if fieldNum <= 0 { |
|
2682 |
+ return fmt.Errorf("proto: RemoveSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2683 |
+ } |
|
2684 |
+ switch fieldNum { |
|
2685 |
+ case 1: |
|
2686 |
+ if wireType != 2 { |
|
2687 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2688 |
+ } |
|
2689 |
+ var stringLen uint64 |
|
2690 |
+ for shift := uint(0); ; shift += 7 { |
|
2691 |
+ if shift >= 64 { |
|
2692 |
+ return ErrIntOverflowSnapshots |
|
2693 |
+ } |
|
2694 |
+ if iNdEx >= l { |
|
2695 |
+ return io.ErrUnexpectedEOF |
|
2696 |
+ } |
|
2697 |
+ b := dAtA[iNdEx] |
|
2698 |
+ iNdEx++ |
|
2699 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2700 |
+ if b < 0x80 { |
|
2701 |
+ break |
|
2702 |
+ } |
|
2703 |
+ } |
|
2704 |
+ intStringLen := int(stringLen) |
|
2705 |
+ if intStringLen < 0 { |
|
2706 |
+ return ErrInvalidLengthSnapshots |
|
2707 |
+ } |
|
2708 |
+ postIndex := iNdEx + intStringLen |
|
2709 |
+ if postIndex > l { |
|
2710 |
+ return io.ErrUnexpectedEOF |
|
2711 |
+ } |
|
2712 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2713 |
+ iNdEx = postIndex |
|
2714 |
+ case 2: |
|
2715 |
+ if wireType != 2 { |
|
2716 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2717 |
+ } |
|
2718 |
+ var stringLen uint64 |
|
2719 |
+ for shift := uint(0); ; shift += 7 { |
|
2720 |
+ if shift >= 64 { |
|
2721 |
+ return ErrIntOverflowSnapshots |
|
2722 |
+ } |
|
2723 |
+ if iNdEx >= l { |
|
2724 |
+ return io.ErrUnexpectedEOF |
|
2725 |
+ } |
|
2726 |
+ b := dAtA[iNdEx] |
|
2727 |
+ iNdEx++ |
|
2728 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2729 |
+ if b < 0x80 { |
|
2730 |
+ break |
|
2731 |
+ } |
|
2732 |
+ } |
|
2733 |
+ intStringLen := int(stringLen) |
|
2734 |
+ if intStringLen < 0 { |
|
2735 |
+ return ErrInvalidLengthSnapshots |
|
2736 |
+ } |
|
2737 |
+ postIndex := iNdEx + intStringLen |
|
2738 |
+ if postIndex > l { |
|
2739 |
+ return io.ErrUnexpectedEOF |
|
2740 |
+ } |
|
2741 |
+ m.Key = string(dAtA[iNdEx:postIndex]) |
|
2742 |
+ iNdEx = postIndex |
|
2743 |
+ default: |
|
2744 |
+ iNdEx = preIndex |
|
2745 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2746 |
+ if err != nil { |
|
2747 |
+ return err |
|
2748 |
+ } |
|
2749 |
+ if skippy < 0 { |
|
2750 |
+ return ErrInvalidLengthSnapshots |
|
2751 |
+ } |
|
2752 |
+ if (iNdEx + skippy) > l { |
|
2753 |
+ return io.ErrUnexpectedEOF |
|
2754 |
+ } |
|
2755 |
+ iNdEx += skippy |
|
2756 |
+ } |
|
2757 |
+ } |
|
2758 |
+ |
|
2759 |
+ if iNdEx > l { |
|
2760 |
+ return io.ErrUnexpectedEOF |
|
2761 |
+ } |
|
2762 |
+ return nil |
|
2763 |
+} |
|
2764 |
+func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
2765 |
+ l := len(dAtA) |
|
2766 |
+ iNdEx := 0 |
|
2767 |
+ for iNdEx < l { |
|
2768 |
+ preIndex := iNdEx |
|
2769 |
+ var wire uint64 |
|
2770 |
+ for shift := uint(0); ; shift += 7 { |
|
2771 |
+ if shift >= 64 { |
|
2772 |
+ return ErrIntOverflowSnapshots |
|
2773 |
+ } |
|
2774 |
+ if iNdEx >= l { |
|
2775 |
+ return io.ErrUnexpectedEOF |
|
2776 |
+ } |
|
2777 |
+ b := dAtA[iNdEx] |
|
2778 |
+ iNdEx++ |
|
2779 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2780 |
+ if b < 0x80 { |
|
2781 |
+ break |
|
2782 |
+ } |
|
2783 |
+ } |
|
2784 |
+ fieldNum := int32(wire >> 3) |
|
2785 |
+ wireType := int(wire & 0x7) |
|
2786 |
+ if wireType == 4 { |
|
2787 |
+ return fmt.Errorf("proto: CommitSnapshotRequest: wiretype end group for non-group") |
|
2788 |
+ } |
|
2789 |
+ if fieldNum <= 0 { |
|
2790 |
+ return fmt.Errorf("proto: CommitSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
2791 |
+ } |
|
2792 |
+ switch fieldNum { |
|
2793 |
+ case 1: |
|
2794 |
+ if wireType != 2 { |
|
2795 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
2796 |
+ } |
|
2797 |
+ var stringLen uint64 |
|
2798 |
+ for shift := uint(0); ; shift += 7 { |
|
2799 |
+ if shift >= 64 { |
|
2800 |
+ return ErrIntOverflowSnapshots |
|
2801 |
+ } |
|
2802 |
+ if iNdEx >= l { |
|
2803 |
+ return io.ErrUnexpectedEOF |
|
2804 |
+ } |
|
2805 |
+ b := dAtA[iNdEx] |
|
2806 |
+ iNdEx++ |
|
2807 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2808 |
+ if b < 0x80 { |
|
2809 |
+ break |
|
2810 |
+ } |
|
2811 |
+ } |
|
2812 |
+ intStringLen := int(stringLen) |
|
2813 |
+ if intStringLen < 0 { |
|
2814 |
+ return ErrInvalidLengthSnapshots |
|
2815 |
+ } |
|
2816 |
+ postIndex := iNdEx + intStringLen |
|
2817 |
+ if postIndex > l { |
|
2818 |
+ return io.ErrUnexpectedEOF |
|
2819 |
+ } |
|
2820 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
2821 |
+ iNdEx = postIndex |
|
2822 |
+ case 2: |
|
2823 |
+ if wireType != 2 { |
|
2824 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
|
2825 |
+ } |
|
2826 |
+ var stringLen uint64 |
|
2827 |
+ for shift := uint(0); ; shift += 7 { |
|
2828 |
+ if shift >= 64 { |
|
2829 |
+ return ErrIntOverflowSnapshots |
|
2830 |
+ } |
|
2831 |
+ if iNdEx >= l { |
|
2832 |
+ return io.ErrUnexpectedEOF |
|
2833 |
+ } |
|
2834 |
+ b := dAtA[iNdEx] |
|
2835 |
+ iNdEx++ |
|
2836 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2837 |
+ if b < 0x80 { |
|
2838 |
+ break |
|
2839 |
+ } |
|
2840 |
+ } |
|
2841 |
+ intStringLen := int(stringLen) |
|
2842 |
+ if intStringLen < 0 { |
|
2843 |
+ return ErrInvalidLengthSnapshots |
|
2844 |
+ } |
|
2845 |
+ postIndex := iNdEx + intStringLen |
|
2846 |
+ if postIndex > l { |
|
2847 |
+ return io.ErrUnexpectedEOF |
|
2848 |
+ } |
|
2849 |
+ m.Name = string(dAtA[iNdEx:postIndex]) |
|
2850 |
+ iNdEx = postIndex |
|
2851 |
+ case 3: |
|
2852 |
+ if wireType != 2 { |
|
2853 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
2854 |
+ } |
|
2855 |
+ var stringLen uint64 |
|
2856 |
+ for shift := uint(0); ; shift += 7 { |
|
2857 |
+ if shift >= 64 { |
|
2858 |
+ return ErrIntOverflowSnapshots |
|
2859 |
+ } |
|
2860 |
+ if iNdEx >= l { |
|
2861 |
+ return io.ErrUnexpectedEOF |
|
2862 |
+ } |
|
2863 |
+ b := dAtA[iNdEx] |
|
2864 |
+ iNdEx++ |
|
2865 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
2866 |
+ if b < 0x80 { |
|
2867 |
+ break |
|
2868 |
+ } |
|
2869 |
+ } |
|
2870 |
+ intStringLen := int(stringLen) |
|
2871 |
+ if intStringLen < 0 { |
|
2872 |
+ return ErrInvalidLengthSnapshots |
|
2873 |
+ } |
|
2874 |
+ postIndex := iNdEx + intStringLen |
|
2875 |
+ if postIndex > l { |
|
2876 |
+ return io.ErrUnexpectedEOF |
|
2877 |
+ } |
|
2878 |
+ m.Key = string(dAtA[iNdEx:postIndex]) |
|
2879 |
+ iNdEx = postIndex |
|
2880 |
+ case 4: |
|
2881 |
+ if wireType != 2 { |
|
2882 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
2883 |
+ } |
|
2884 |
+ var msglen int |
|
2885 |
+ for shift := uint(0); ; shift += 7 { |
|
2886 |
+ if shift >= 64 { |
|
2887 |
+ return ErrIntOverflowSnapshots |
|
2888 |
+ } |
|
2889 |
+ if iNdEx >= l { |
|
2890 |
+ return io.ErrUnexpectedEOF |
|
2891 |
+ } |
|
2892 |
+ b := dAtA[iNdEx] |
|
2893 |
+ iNdEx++ |
|
2894 |
+ msglen |= (int(b) & 0x7F) << shift |
|
2895 |
+ if b < 0x80 { |
|
2896 |
+ break |
|
2897 |
+ } |
|
2898 |
+ } |
|
2899 |
+ if msglen < 0 { |
|
2900 |
+ return ErrInvalidLengthSnapshots |
|
2901 |
+ } |
|
2902 |
+ postIndex := iNdEx + msglen |
|
2903 |
+ if postIndex > l { |
|
2904 |
+ return io.ErrUnexpectedEOF |
|
2905 |
+ } |
|
2906 |
+ if m.Labels == nil { |
|
2907 |
+ m.Labels = make(map[string]string) |
|
2908 |
+ } |
|
2909 |
+ var mapkey string |
|
2910 |
+ var mapvalue string |
|
2911 |
+ for iNdEx < postIndex { |
|
2912 |
+ entryPreIndex := iNdEx |
|
2913 |
+ var wire uint64 |
|
2914 |
+ for shift := uint(0); ; shift += 7 { |
|
2915 |
+ if shift >= 64 { |
|
2916 |
+ return ErrIntOverflowSnapshots |
|
2917 |
+ } |
|
2918 |
+ if iNdEx >= l { |
|
2919 |
+ return io.ErrUnexpectedEOF |
|
2920 |
+ } |
|
2921 |
+ b := dAtA[iNdEx] |
|
2922 |
+ iNdEx++ |
|
2923 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
2924 |
+ if b < 0x80 { |
|
2925 |
+ break |
|
2926 |
+ } |
|
2927 |
+ } |
|
2928 |
+ fieldNum := int32(wire >> 3) |
|
2929 |
+ if fieldNum == 1 { |
|
2930 |
+ var stringLenmapkey uint64 |
|
2931 |
+ for shift := uint(0); ; shift += 7 { |
|
2932 |
+ if shift >= 64 { |
|
2933 |
+ return ErrIntOverflowSnapshots |
|
2934 |
+ } |
|
2935 |
+ if iNdEx >= l { |
|
2936 |
+ return io.ErrUnexpectedEOF |
|
2937 |
+ } |
|
2938 |
+ b := dAtA[iNdEx] |
|
2939 |
+ iNdEx++ |
|
2940 |
+ stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
2941 |
+ if b < 0x80 { |
|
2942 |
+ break |
|
2943 |
+ } |
|
2944 |
+ } |
|
2945 |
+ intStringLenmapkey := int(stringLenmapkey) |
|
2946 |
+ if intStringLenmapkey < 0 { |
|
2947 |
+ return ErrInvalidLengthSnapshots |
|
2948 |
+ } |
|
2949 |
+ postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
2950 |
+ if postStringIndexmapkey > l { |
|
2951 |
+ return io.ErrUnexpectedEOF |
|
2952 |
+ } |
|
2953 |
+ mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
2954 |
+ iNdEx = postStringIndexmapkey |
|
2955 |
+ } else if fieldNum == 2 { |
|
2956 |
+ var stringLenmapvalue uint64 |
|
2957 |
+ for shift := uint(0); ; shift += 7 { |
|
2958 |
+ if shift >= 64 { |
|
2959 |
+ return ErrIntOverflowSnapshots |
|
2960 |
+ } |
|
2961 |
+ if iNdEx >= l { |
|
2962 |
+ return io.ErrUnexpectedEOF |
|
2963 |
+ } |
|
2964 |
+ b := dAtA[iNdEx] |
|
2965 |
+ iNdEx++ |
|
2966 |
+ stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
2967 |
+ if b < 0x80 { |
|
2968 |
+ break |
|
2969 |
+ } |
|
2970 |
+ } |
|
2971 |
+ intStringLenmapvalue := int(stringLenmapvalue) |
|
2972 |
+ if intStringLenmapvalue < 0 { |
|
2973 |
+ return ErrInvalidLengthSnapshots |
|
2974 |
+ } |
|
2975 |
+ postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
2976 |
+ if postStringIndexmapvalue > l { |
|
2977 |
+ return io.ErrUnexpectedEOF |
|
2978 |
+ } |
|
2979 |
+ mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
2980 |
+ iNdEx = postStringIndexmapvalue |
|
2981 |
+ } else { |
|
2982 |
+ iNdEx = entryPreIndex |
|
2983 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
2984 |
+ if err != nil { |
|
2985 |
+ return err |
|
2986 |
+ } |
|
2987 |
+ if skippy < 0 { |
|
2988 |
+ return ErrInvalidLengthSnapshots |
|
2989 |
+ } |
|
2990 |
+ if (iNdEx + skippy) > postIndex { |
|
2991 |
+ return io.ErrUnexpectedEOF |
|
2992 |
+ } |
|
2993 |
+ iNdEx += skippy |
|
2994 |
+ } |
|
2995 |
+ } |
|
2996 |
+ m.Labels[mapkey] = mapvalue |
|
2997 |
+ iNdEx = postIndex |
|
2998 |
+ default: |
|
2999 |
+ iNdEx = preIndex |
|
3000 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3001 |
+ if err != nil { |
|
3002 |
+ return err |
|
3003 |
+ } |
|
3004 |
+ if skippy < 0 { |
|
3005 |
+ return ErrInvalidLengthSnapshots |
|
3006 |
+ } |
|
3007 |
+ if (iNdEx + skippy) > l { |
|
3008 |
+ return io.ErrUnexpectedEOF |
|
3009 |
+ } |
|
3010 |
+ iNdEx += skippy |
|
3011 |
+ } |
|
3012 |
+ } |
|
3013 |
+ |
|
3014 |
+ if iNdEx > l { |
|
3015 |
+ return io.ErrUnexpectedEOF |
|
3016 |
+ } |
|
3017 |
+ return nil |
|
3018 |
+} |
|
3019 |
+func (m *StatSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
3020 |
+ l := len(dAtA) |
|
3021 |
+ iNdEx := 0 |
|
3022 |
+ for iNdEx < l { |
|
3023 |
+ preIndex := iNdEx |
|
3024 |
+ var wire uint64 |
|
3025 |
+ for shift := uint(0); ; shift += 7 { |
|
3026 |
+ if shift >= 64 { |
|
3027 |
+ return ErrIntOverflowSnapshots |
|
3028 |
+ } |
|
3029 |
+ if iNdEx >= l { |
|
3030 |
+ return io.ErrUnexpectedEOF |
|
3031 |
+ } |
|
3032 |
+ b := dAtA[iNdEx] |
|
3033 |
+ iNdEx++ |
|
3034 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3035 |
+ if b < 0x80 { |
|
3036 |
+ break |
|
3037 |
+ } |
|
3038 |
+ } |
|
3039 |
+ fieldNum := int32(wire >> 3) |
|
3040 |
+ wireType := int(wire & 0x7) |
|
3041 |
+ if wireType == 4 { |
|
3042 |
+ return fmt.Errorf("proto: StatSnapshotRequest: wiretype end group for non-group") |
|
3043 |
+ } |
|
3044 |
+ if fieldNum <= 0 { |
|
3045 |
+ return fmt.Errorf("proto: StatSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3046 |
+ } |
|
3047 |
+ switch fieldNum { |
|
3048 |
+ case 1: |
|
3049 |
+ if wireType != 2 { |
|
3050 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3051 |
+ } |
|
3052 |
+ var stringLen uint64 |
|
3053 |
+ for shift := uint(0); ; shift += 7 { |
|
3054 |
+ if shift >= 64 { |
|
3055 |
+ return ErrIntOverflowSnapshots |
|
3056 |
+ } |
|
3057 |
+ if iNdEx >= l { |
|
3058 |
+ return io.ErrUnexpectedEOF |
|
3059 |
+ } |
|
3060 |
+ b := dAtA[iNdEx] |
|
3061 |
+ iNdEx++ |
|
3062 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3063 |
+ if b < 0x80 { |
|
3064 |
+ break |
|
3065 |
+ } |
|
3066 |
+ } |
|
3067 |
+ intStringLen := int(stringLen) |
|
3068 |
+ if intStringLen < 0 { |
|
3069 |
+ return ErrInvalidLengthSnapshots |
|
3070 |
+ } |
|
3071 |
+ postIndex := iNdEx + intStringLen |
|
3072 |
+ if postIndex > l { |
|
3073 |
+ return io.ErrUnexpectedEOF |
|
3074 |
+ } |
|
3075 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3076 |
+ iNdEx = postIndex |
|
3077 |
+ case 2: |
|
3078 |
+ if wireType != 2 { |
|
3079 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
3080 |
+ } |
|
3081 |
+ var stringLen uint64 |
|
3082 |
+ for shift := uint(0); ; shift += 7 { |
|
3083 |
+ if shift >= 64 { |
|
3084 |
+ return ErrIntOverflowSnapshots |
|
3085 |
+ } |
|
3086 |
+ if iNdEx >= l { |
|
3087 |
+ return io.ErrUnexpectedEOF |
|
3088 |
+ } |
|
3089 |
+ b := dAtA[iNdEx] |
|
3090 |
+ iNdEx++ |
|
3091 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3092 |
+ if b < 0x80 { |
|
3093 |
+ break |
|
3094 |
+ } |
|
3095 |
+ } |
|
3096 |
+ intStringLen := int(stringLen) |
|
3097 |
+ if intStringLen < 0 { |
|
3098 |
+ return ErrInvalidLengthSnapshots |
|
3099 |
+ } |
|
3100 |
+ postIndex := iNdEx + intStringLen |
|
3101 |
+ if postIndex > l { |
|
3102 |
+ return io.ErrUnexpectedEOF |
|
3103 |
+ } |
|
3104 |
+ m.Key = string(dAtA[iNdEx:postIndex]) |
|
3105 |
+ iNdEx = postIndex |
|
3106 |
+ default: |
|
3107 |
+ iNdEx = preIndex |
|
3108 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3109 |
+ if err != nil { |
|
3110 |
+ return err |
|
3111 |
+ } |
|
3112 |
+ if skippy < 0 { |
|
3113 |
+ return ErrInvalidLengthSnapshots |
|
3114 |
+ } |
|
3115 |
+ if (iNdEx + skippy) > l { |
|
3116 |
+ return io.ErrUnexpectedEOF |
|
3117 |
+ } |
|
3118 |
+ iNdEx += skippy |
|
3119 |
+ } |
|
3120 |
+ } |
|
3121 |
+ |
|
3122 |
+ if iNdEx > l { |
|
3123 |
+ return io.ErrUnexpectedEOF |
|
3124 |
+ } |
|
3125 |
+ return nil |
|
3126 |
+} |
|
3127 |
+func (m *Info) Unmarshal(dAtA []byte) error { |
|
3128 |
+ l := len(dAtA) |
|
3129 |
+ iNdEx := 0 |
|
3130 |
+ for iNdEx < l { |
|
3131 |
+ preIndex := iNdEx |
|
3132 |
+ var wire uint64 |
|
3133 |
+ for shift := uint(0); ; shift += 7 { |
|
3134 |
+ if shift >= 64 { |
|
3135 |
+ return ErrIntOverflowSnapshots |
|
3136 |
+ } |
|
3137 |
+ if iNdEx >= l { |
|
3138 |
+ return io.ErrUnexpectedEOF |
|
3139 |
+ } |
|
3140 |
+ b := dAtA[iNdEx] |
|
3141 |
+ iNdEx++ |
|
3142 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3143 |
+ if b < 0x80 { |
|
3144 |
+ break |
|
3145 |
+ } |
|
3146 |
+ } |
|
3147 |
+ fieldNum := int32(wire >> 3) |
|
3148 |
+ wireType := int(wire & 0x7) |
|
3149 |
+ if wireType == 4 { |
|
3150 |
+ return fmt.Errorf("proto: Info: wiretype end group for non-group") |
|
3151 |
+ } |
|
3152 |
+ if fieldNum <= 0 { |
|
3153 |
+ return fmt.Errorf("proto: Info: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3154 |
+ } |
|
3155 |
+ switch fieldNum { |
|
3156 |
+ case 1: |
|
3157 |
+ if wireType != 2 { |
|
3158 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
|
3159 |
+ } |
|
3160 |
+ var stringLen uint64 |
|
3161 |
+ for shift := uint(0); ; shift += 7 { |
|
3162 |
+ if shift >= 64 { |
|
3163 |
+ return ErrIntOverflowSnapshots |
|
3164 |
+ } |
|
3165 |
+ if iNdEx >= l { |
|
3166 |
+ return io.ErrUnexpectedEOF |
|
3167 |
+ } |
|
3168 |
+ b := dAtA[iNdEx] |
|
3169 |
+ iNdEx++ |
|
3170 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3171 |
+ if b < 0x80 { |
|
3172 |
+ break |
|
3173 |
+ } |
|
3174 |
+ } |
|
3175 |
+ intStringLen := int(stringLen) |
|
3176 |
+ if intStringLen < 0 { |
|
3177 |
+ return ErrInvalidLengthSnapshots |
|
3178 |
+ } |
|
3179 |
+ postIndex := iNdEx + intStringLen |
|
3180 |
+ if postIndex > l { |
|
3181 |
+ return io.ErrUnexpectedEOF |
|
3182 |
+ } |
|
3183 |
+ m.Name = string(dAtA[iNdEx:postIndex]) |
|
3184 |
+ iNdEx = postIndex |
|
3185 |
+ case 2: |
|
3186 |
+ if wireType != 2 { |
|
3187 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) |
|
3188 |
+ } |
|
3189 |
+ var stringLen uint64 |
|
3190 |
+ for shift := uint(0); ; shift += 7 { |
|
3191 |
+ if shift >= 64 { |
|
3192 |
+ return ErrIntOverflowSnapshots |
|
3193 |
+ } |
|
3194 |
+ if iNdEx >= l { |
|
3195 |
+ return io.ErrUnexpectedEOF |
|
3196 |
+ } |
|
3197 |
+ b := dAtA[iNdEx] |
|
3198 |
+ iNdEx++ |
|
3199 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3200 |
+ if b < 0x80 { |
|
3201 |
+ break |
|
3202 |
+ } |
|
3203 |
+ } |
|
3204 |
+ intStringLen := int(stringLen) |
|
3205 |
+ if intStringLen < 0 { |
|
3206 |
+ return ErrInvalidLengthSnapshots |
|
3207 |
+ } |
|
3208 |
+ postIndex := iNdEx + intStringLen |
|
3209 |
+ if postIndex > l { |
|
3210 |
+ return io.ErrUnexpectedEOF |
|
3211 |
+ } |
|
3212 |
+ m.Parent = string(dAtA[iNdEx:postIndex]) |
|
3213 |
+ iNdEx = postIndex |
|
3214 |
+ case 3: |
|
3215 |
+ if wireType != 0 { |
|
3216 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) |
|
3217 |
+ } |
|
3218 |
+ m.Kind = 0 |
|
3219 |
+ for shift := uint(0); ; shift += 7 { |
|
3220 |
+ if shift >= 64 { |
|
3221 |
+ return ErrIntOverflowSnapshots |
|
3222 |
+ } |
|
3223 |
+ if iNdEx >= l { |
|
3224 |
+ return io.ErrUnexpectedEOF |
|
3225 |
+ } |
|
3226 |
+ b := dAtA[iNdEx] |
|
3227 |
+ iNdEx++ |
|
3228 |
+ m.Kind |= (Kind(b) & 0x7F) << shift |
|
3229 |
+ if b < 0x80 { |
|
3230 |
+ break |
|
3231 |
+ } |
|
3232 |
+ } |
|
3233 |
+ case 4: |
|
3234 |
+ if wireType != 2 { |
|
3235 |
+ return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) |
|
3236 |
+ } |
|
3237 |
+ var msglen int |
|
3238 |
+ for shift := uint(0); ; shift += 7 { |
|
3239 |
+ if shift >= 64 { |
|
3240 |
+ return ErrIntOverflowSnapshots |
|
3241 |
+ } |
|
3242 |
+ if iNdEx >= l { |
|
3243 |
+ return io.ErrUnexpectedEOF |
|
3244 |
+ } |
|
3245 |
+ b := dAtA[iNdEx] |
|
3246 |
+ iNdEx++ |
|
3247 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3248 |
+ if b < 0x80 { |
|
3249 |
+ break |
|
3250 |
+ } |
|
3251 |
+ } |
|
3252 |
+ if msglen < 0 { |
|
3253 |
+ return ErrInvalidLengthSnapshots |
|
3254 |
+ } |
|
3255 |
+ postIndex := iNdEx + msglen |
|
3256 |
+ if postIndex > l { |
|
3257 |
+ return io.ErrUnexpectedEOF |
|
3258 |
+ } |
|
3259 |
+ if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { |
|
3260 |
+ return err |
|
3261 |
+ } |
|
3262 |
+ iNdEx = postIndex |
|
3263 |
+ case 5: |
|
3264 |
+ if wireType != 2 { |
|
3265 |
+ return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) |
|
3266 |
+ } |
|
3267 |
+ var msglen int |
|
3268 |
+ for shift := uint(0); ; shift += 7 { |
|
3269 |
+ if shift >= 64 { |
|
3270 |
+ return ErrIntOverflowSnapshots |
|
3271 |
+ } |
|
3272 |
+ if iNdEx >= l { |
|
3273 |
+ return io.ErrUnexpectedEOF |
|
3274 |
+ } |
|
3275 |
+ b := dAtA[iNdEx] |
|
3276 |
+ iNdEx++ |
|
3277 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3278 |
+ if b < 0x80 { |
|
3279 |
+ break |
|
3280 |
+ } |
|
3281 |
+ } |
|
3282 |
+ if msglen < 0 { |
|
3283 |
+ return ErrInvalidLengthSnapshots |
|
3284 |
+ } |
|
3285 |
+ postIndex := iNdEx + msglen |
|
3286 |
+ if postIndex > l { |
|
3287 |
+ return io.ErrUnexpectedEOF |
|
3288 |
+ } |
|
3289 |
+ if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil { |
|
3290 |
+ return err |
|
3291 |
+ } |
|
3292 |
+ iNdEx = postIndex |
|
3293 |
+ case 6: |
|
3294 |
+ if wireType != 2 { |
|
3295 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) |
|
3296 |
+ } |
|
3297 |
+ var msglen int |
|
3298 |
+ for shift := uint(0); ; shift += 7 { |
|
3299 |
+ if shift >= 64 { |
|
3300 |
+ return ErrIntOverflowSnapshots |
|
3301 |
+ } |
|
3302 |
+ if iNdEx >= l { |
|
3303 |
+ return io.ErrUnexpectedEOF |
|
3304 |
+ } |
|
3305 |
+ b := dAtA[iNdEx] |
|
3306 |
+ iNdEx++ |
|
3307 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3308 |
+ if b < 0x80 { |
|
3309 |
+ break |
|
3310 |
+ } |
|
3311 |
+ } |
|
3312 |
+ if msglen < 0 { |
|
3313 |
+ return ErrInvalidLengthSnapshots |
|
3314 |
+ } |
|
3315 |
+ postIndex := iNdEx + msglen |
|
3316 |
+ if postIndex > l { |
|
3317 |
+ return io.ErrUnexpectedEOF |
|
3318 |
+ } |
|
3319 |
+ if m.Labels == nil { |
|
3320 |
+ m.Labels = make(map[string]string) |
|
3321 |
+ } |
|
3322 |
+ var mapkey string |
|
3323 |
+ var mapvalue string |
|
3324 |
+ for iNdEx < postIndex { |
|
3325 |
+ entryPreIndex := iNdEx |
|
3326 |
+ var wire uint64 |
|
3327 |
+ for shift := uint(0); ; shift += 7 { |
|
3328 |
+ if shift >= 64 { |
|
3329 |
+ return ErrIntOverflowSnapshots |
|
3330 |
+ } |
|
3331 |
+ if iNdEx >= l { |
|
3332 |
+ return io.ErrUnexpectedEOF |
|
3333 |
+ } |
|
3334 |
+ b := dAtA[iNdEx] |
|
3335 |
+ iNdEx++ |
|
3336 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3337 |
+ if b < 0x80 { |
|
3338 |
+ break |
|
3339 |
+ } |
|
3340 |
+ } |
|
3341 |
+ fieldNum := int32(wire >> 3) |
|
3342 |
+ if fieldNum == 1 { |
|
3343 |
+ var stringLenmapkey uint64 |
|
3344 |
+ for shift := uint(0); ; shift += 7 { |
|
3345 |
+ if shift >= 64 { |
|
3346 |
+ return ErrIntOverflowSnapshots |
|
3347 |
+ } |
|
3348 |
+ if iNdEx >= l { |
|
3349 |
+ return io.ErrUnexpectedEOF |
|
3350 |
+ } |
|
3351 |
+ b := dAtA[iNdEx] |
|
3352 |
+ iNdEx++ |
|
3353 |
+ stringLenmapkey |= (uint64(b) & 0x7F) << shift |
|
3354 |
+ if b < 0x80 { |
|
3355 |
+ break |
|
3356 |
+ } |
|
3357 |
+ } |
|
3358 |
+ intStringLenmapkey := int(stringLenmapkey) |
|
3359 |
+ if intStringLenmapkey < 0 { |
|
3360 |
+ return ErrInvalidLengthSnapshots |
|
3361 |
+ } |
|
3362 |
+ postStringIndexmapkey := iNdEx + intStringLenmapkey |
|
3363 |
+ if postStringIndexmapkey > l { |
|
3364 |
+ return io.ErrUnexpectedEOF |
|
3365 |
+ } |
|
3366 |
+ mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
|
3367 |
+ iNdEx = postStringIndexmapkey |
|
3368 |
+ } else if fieldNum == 2 { |
|
3369 |
+ var stringLenmapvalue uint64 |
|
3370 |
+ for shift := uint(0); ; shift += 7 { |
|
3371 |
+ if shift >= 64 { |
|
3372 |
+ return ErrIntOverflowSnapshots |
|
3373 |
+ } |
|
3374 |
+ if iNdEx >= l { |
|
3375 |
+ return io.ErrUnexpectedEOF |
|
3376 |
+ } |
|
3377 |
+ b := dAtA[iNdEx] |
|
3378 |
+ iNdEx++ |
|
3379 |
+ stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
|
3380 |
+ if b < 0x80 { |
|
3381 |
+ break |
|
3382 |
+ } |
|
3383 |
+ } |
|
3384 |
+ intStringLenmapvalue := int(stringLenmapvalue) |
|
3385 |
+ if intStringLenmapvalue < 0 { |
|
3386 |
+ return ErrInvalidLengthSnapshots |
|
3387 |
+ } |
|
3388 |
+ postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
|
3389 |
+ if postStringIndexmapvalue > l { |
|
3390 |
+ return io.ErrUnexpectedEOF |
|
3391 |
+ } |
|
3392 |
+ mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
|
3393 |
+ iNdEx = postStringIndexmapvalue |
|
3394 |
+ } else { |
|
3395 |
+ iNdEx = entryPreIndex |
|
3396 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3397 |
+ if err != nil { |
|
3398 |
+ return err |
|
3399 |
+ } |
|
3400 |
+ if skippy < 0 { |
|
3401 |
+ return ErrInvalidLengthSnapshots |
|
3402 |
+ } |
|
3403 |
+ if (iNdEx + skippy) > postIndex { |
|
3404 |
+ return io.ErrUnexpectedEOF |
|
3405 |
+ } |
|
3406 |
+ iNdEx += skippy |
|
3407 |
+ } |
|
3408 |
+ } |
|
3409 |
+ m.Labels[mapkey] = mapvalue |
|
3410 |
+ iNdEx = postIndex |
|
3411 |
+ default: |
|
3412 |
+ iNdEx = preIndex |
|
3413 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3414 |
+ if err != nil { |
|
3415 |
+ return err |
|
3416 |
+ } |
|
3417 |
+ if skippy < 0 { |
|
3418 |
+ return ErrInvalidLengthSnapshots |
|
3419 |
+ } |
|
3420 |
+ if (iNdEx + skippy) > l { |
|
3421 |
+ return io.ErrUnexpectedEOF |
|
3422 |
+ } |
|
3423 |
+ iNdEx += skippy |
|
3424 |
+ } |
|
3425 |
+ } |
|
3426 |
+ |
|
3427 |
+ if iNdEx > l { |
|
3428 |
+ return io.ErrUnexpectedEOF |
|
3429 |
+ } |
|
3430 |
+ return nil |
|
3431 |
+} |
|
3432 |
+func (m *StatSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
3433 |
+ l := len(dAtA) |
|
3434 |
+ iNdEx := 0 |
|
3435 |
+ for iNdEx < l { |
|
3436 |
+ preIndex := iNdEx |
|
3437 |
+ var wire uint64 |
|
3438 |
+ for shift := uint(0); ; shift += 7 { |
|
3439 |
+ if shift >= 64 { |
|
3440 |
+ return ErrIntOverflowSnapshots |
|
3441 |
+ } |
|
3442 |
+ if iNdEx >= l { |
|
3443 |
+ return io.ErrUnexpectedEOF |
|
3444 |
+ } |
|
3445 |
+ b := dAtA[iNdEx] |
|
3446 |
+ iNdEx++ |
|
3447 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3448 |
+ if b < 0x80 { |
|
3449 |
+ break |
|
3450 |
+ } |
|
3451 |
+ } |
|
3452 |
+ fieldNum := int32(wire >> 3) |
|
3453 |
+ wireType := int(wire & 0x7) |
|
3454 |
+ if wireType == 4 { |
|
3455 |
+ return fmt.Errorf("proto: StatSnapshotResponse: wiretype end group for non-group") |
|
3456 |
+ } |
|
3457 |
+ if fieldNum <= 0 { |
|
3458 |
+ return fmt.Errorf("proto: StatSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3459 |
+ } |
|
3460 |
+ switch fieldNum { |
|
3461 |
+ case 1: |
|
3462 |
+ if wireType != 2 { |
|
3463 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3464 |
+ } |
|
3465 |
+ var msglen int |
|
3466 |
+ for shift := uint(0); ; shift += 7 { |
|
3467 |
+ if shift >= 64 { |
|
3468 |
+ return ErrIntOverflowSnapshots |
|
3469 |
+ } |
|
3470 |
+ if iNdEx >= l { |
|
3471 |
+ return io.ErrUnexpectedEOF |
|
3472 |
+ } |
|
3473 |
+ b := dAtA[iNdEx] |
|
3474 |
+ iNdEx++ |
|
3475 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3476 |
+ if b < 0x80 { |
|
3477 |
+ break |
|
3478 |
+ } |
|
3479 |
+ } |
|
3480 |
+ if msglen < 0 { |
|
3481 |
+ return ErrInvalidLengthSnapshots |
|
3482 |
+ } |
|
3483 |
+ postIndex := iNdEx + msglen |
|
3484 |
+ if postIndex > l { |
|
3485 |
+ return io.ErrUnexpectedEOF |
|
3486 |
+ } |
|
3487 |
+ if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3488 |
+ return err |
|
3489 |
+ } |
|
3490 |
+ iNdEx = postIndex |
|
3491 |
+ default: |
|
3492 |
+ iNdEx = preIndex |
|
3493 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3494 |
+ if err != nil { |
|
3495 |
+ return err |
|
3496 |
+ } |
|
3497 |
+ if skippy < 0 { |
|
3498 |
+ return ErrInvalidLengthSnapshots |
|
3499 |
+ } |
|
3500 |
+ if (iNdEx + skippy) > l { |
|
3501 |
+ return io.ErrUnexpectedEOF |
|
3502 |
+ } |
|
3503 |
+ iNdEx += skippy |
|
3504 |
+ } |
|
3505 |
+ } |
|
3506 |
+ |
|
3507 |
+ if iNdEx > l { |
|
3508 |
+ return io.ErrUnexpectedEOF |
|
3509 |
+ } |
|
3510 |
+ return nil |
|
3511 |
+} |
|
3512 |
+func (m *UpdateSnapshotRequest) Unmarshal(dAtA []byte) error { |
|
3513 |
+ l := len(dAtA) |
|
3514 |
+ iNdEx := 0 |
|
3515 |
+ for iNdEx < l { |
|
3516 |
+ preIndex := iNdEx |
|
3517 |
+ var wire uint64 |
|
3518 |
+ for shift := uint(0); ; shift += 7 { |
|
3519 |
+ if shift >= 64 { |
|
3520 |
+ return ErrIntOverflowSnapshots |
|
3521 |
+ } |
|
3522 |
+ if iNdEx >= l { |
|
3523 |
+ return io.ErrUnexpectedEOF |
|
3524 |
+ } |
|
3525 |
+ b := dAtA[iNdEx] |
|
3526 |
+ iNdEx++ |
|
3527 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3528 |
+ if b < 0x80 { |
|
3529 |
+ break |
|
3530 |
+ } |
|
3531 |
+ } |
|
3532 |
+ fieldNum := int32(wire >> 3) |
|
3533 |
+ wireType := int(wire & 0x7) |
|
3534 |
+ if wireType == 4 { |
|
3535 |
+ return fmt.Errorf("proto: UpdateSnapshotRequest: wiretype end group for non-group") |
|
3536 |
+ } |
|
3537 |
+ if fieldNum <= 0 { |
|
3538 |
+ return fmt.Errorf("proto: UpdateSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3539 |
+ } |
|
3540 |
+ switch fieldNum { |
|
3541 |
+ case 1: |
|
3542 |
+ if wireType != 2 { |
|
3543 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3544 |
+ } |
|
3545 |
+ var stringLen uint64 |
|
3546 |
+ for shift := uint(0); ; shift += 7 { |
|
3547 |
+ if shift >= 64 { |
|
3548 |
+ return ErrIntOverflowSnapshots |
|
3549 |
+ } |
|
3550 |
+ if iNdEx >= l { |
|
3551 |
+ return io.ErrUnexpectedEOF |
|
3552 |
+ } |
|
3553 |
+ b := dAtA[iNdEx] |
|
3554 |
+ iNdEx++ |
|
3555 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3556 |
+ if b < 0x80 { |
|
3557 |
+ break |
|
3558 |
+ } |
|
3559 |
+ } |
|
3560 |
+ intStringLen := int(stringLen) |
|
3561 |
+ if intStringLen < 0 { |
|
3562 |
+ return ErrInvalidLengthSnapshots |
|
3563 |
+ } |
|
3564 |
+ postIndex := iNdEx + intStringLen |
|
3565 |
+ if postIndex > l { |
|
3566 |
+ return io.ErrUnexpectedEOF |
|
3567 |
+ } |
|
3568 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3569 |
+ iNdEx = postIndex |
|
3570 |
+ case 2: |
|
3571 |
+ if wireType != 2 { |
|
3572 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3573 |
+ } |
|
3574 |
+ var msglen int |
|
3575 |
+ for shift := uint(0); ; shift += 7 { |
|
3576 |
+ if shift >= 64 { |
|
3577 |
+ return ErrIntOverflowSnapshots |
|
3578 |
+ } |
|
3579 |
+ if iNdEx >= l { |
|
3580 |
+ return io.ErrUnexpectedEOF |
|
3581 |
+ } |
|
3582 |
+ b := dAtA[iNdEx] |
|
3583 |
+ iNdEx++ |
|
3584 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3585 |
+ if b < 0x80 { |
|
3586 |
+ break |
|
3587 |
+ } |
|
3588 |
+ } |
|
3589 |
+ if msglen < 0 { |
|
3590 |
+ return ErrInvalidLengthSnapshots |
|
3591 |
+ } |
|
3592 |
+ postIndex := iNdEx + msglen |
|
3593 |
+ if postIndex > l { |
|
3594 |
+ return io.ErrUnexpectedEOF |
|
3595 |
+ } |
|
3596 |
+ if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3597 |
+ return err |
|
3598 |
+ } |
|
3599 |
+ iNdEx = postIndex |
|
3600 |
+ case 3: |
|
3601 |
+ if wireType != 2 { |
|
3602 |
+ return fmt.Errorf("proto: wrong wireType = %d for field UpdateMask", wireType) |
|
3603 |
+ } |
|
3604 |
+ var msglen int |
|
3605 |
+ for shift := uint(0); ; shift += 7 { |
|
3606 |
+ if shift >= 64 { |
|
3607 |
+ return ErrIntOverflowSnapshots |
|
3608 |
+ } |
|
3609 |
+ if iNdEx >= l { |
|
3610 |
+ return io.ErrUnexpectedEOF |
|
3611 |
+ } |
|
3612 |
+ b := dAtA[iNdEx] |
|
3613 |
+ iNdEx++ |
|
3614 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3615 |
+ if b < 0x80 { |
|
3616 |
+ break |
|
3617 |
+ } |
|
3618 |
+ } |
|
3619 |
+ if msglen < 0 { |
|
3620 |
+ return ErrInvalidLengthSnapshots |
|
3621 |
+ } |
|
3622 |
+ postIndex := iNdEx + msglen |
|
3623 |
+ if postIndex > l { |
|
3624 |
+ return io.ErrUnexpectedEOF |
|
3625 |
+ } |
|
3626 |
+ if m.UpdateMask == nil { |
|
3627 |
+ m.UpdateMask = &google_protobuf2.FieldMask{} |
|
3628 |
+ } |
|
3629 |
+ if err := m.UpdateMask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3630 |
+ return err |
|
3631 |
+ } |
|
3632 |
+ iNdEx = postIndex |
|
3633 |
+ default: |
|
3634 |
+ iNdEx = preIndex |
|
3635 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3636 |
+ if err != nil { |
|
3637 |
+ return err |
|
3638 |
+ } |
|
3639 |
+ if skippy < 0 { |
|
3640 |
+ return ErrInvalidLengthSnapshots |
|
3641 |
+ } |
|
3642 |
+ if (iNdEx + skippy) > l { |
|
3643 |
+ return io.ErrUnexpectedEOF |
|
3644 |
+ } |
|
3645 |
+ iNdEx += skippy |
|
3646 |
+ } |
|
3647 |
+ } |
|
3648 |
+ |
|
3649 |
+ if iNdEx > l { |
|
3650 |
+ return io.ErrUnexpectedEOF |
|
3651 |
+ } |
|
3652 |
+ return nil |
|
3653 |
+} |
|
3654 |
+func (m *UpdateSnapshotResponse) Unmarshal(dAtA []byte) error { |
|
3655 |
+ l := len(dAtA) |
|
3656 |
+ iNdEx := 0 |
|
3657 |
+ for iNdEx < l { |
|
3658 |
+ preIndex := iNdEx |
|
3659 |
+ var wire uint64 |
|
3660 |
+ for shift := uint(0); ; shift += 7 { |
|
3661 |
+ if shift >= 64 { |
|
3662 |
+ return ErrIntOverflowSnapshots |
|
3663 |
+ } |
|
3664 |
+ if iNdEx >= l { |
|
3665 |
+ return io.ErrUnexpectedEOF |
|
3666 |
+ } |
|
3667 |
+ b := dAtA[iNdEx] |
|
3668 |
+ iNdEx++ |
|
3669 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3670 |
+ if b < 0x80 { |
|
3671 |
+ break |
|
3672 |
+ } |
|
3673 |
+ } |
|
3674 |
+ fieldNum := int32(wire >> 3) |
|
3675 |
+ wireType := int(wire & 0x7) |
|
3676 |
+ if wireType == 4 { |
|
3677 |
+ return fmt.Errorf("proto: UpdateSnapshotResponse: wiretype end group for non-group") |
|
3678 |
+ } |
|
3679 |
+ if fieldNum <= 0 { |
|
3680 |
+ return fmt.Errorf("proto: UpdateSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3681 |
+ } |
|
3682 |
+ switch fieldNum { |
|
3683 |
+ case 1: |
|
3684 |
+ if wireType != 2 { |
|
3685 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3686 |
+ } |
|
3687 |
+ var msglen int |
|
3688 |
+ for shift := uint(0); ; shift += 7 { |
|
3689 |
+ if shift >= 64 { |
|
3690 |
+ return ErrIntOverflowSnapshots |
|
3691 |
+ } |
|
3692 |
+ if iNdEx >= l { |
|
3693 |
+ return io.ErrUnexpectedEOF |
|
3694 |
+ } |
|
3695 |
+ b := dAtA[iNdEx] |
|
3696 |
+ iNdEx++ |
|
3697 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3698 |
+ if b < 0x80 { |
|
3699 |
+ break |
|
3700 |
+ } |
|
3701 |
+ } |
|
3702 |
+ if msglen < 0 { |
|
3703 |
+ return ErrInvalidLengthSnapshots |
|
3704 |
+ } |
|
3705 |
+ postIndex := iNdEx + msglen |
|
3706 |
+ if postIndex > l { |
|
3707 |
+ return io.ErrUnexpectedEOF |
|
3708 |
+ } |
|
3709 |
+ if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3710 |
+ return err |
|
3711 |
+ } |
|
3712 |
+ iNdEx = postIndex |
|
3713 |
+ default: |
|
3714 |
+ iNdEx = preIndex |
|
3715 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3716 |
+ if err != nil { |
|
3717 |
+ return err |
|
3718 |
+ } |
|
3719 |
+ if skippy < 0 { |
|
3720 |
+ return ErrInvalidLengthSnapshots |
|
3721 |
+ } |
|
3722 |
+ if (iNdEx + skippy) > l { |
|
3723 |
+ return io.ErrUnexpectedEOF |
|
3724 |
+ } |
|
3725 |
+ iNdEx += skippy |
|
3726 |
+ } |
|
3727 |
+ } |
|
3728 |
+ |
|
3729 |
+ if iNdEx > l { |
|
3730 |
+ return io.ErrUnexpectedEOF |
|
3731 |
+ } |
|
3732 |
+ return nil |
|
3733 |
+} |
|
3734 |
+func (m *ListSnapshotsRequest) Unmarshal(dAtA []byte) error { |
|
3735 |
+ l := len(dAtA) |
|
3736 |
+ iNdEx := 0 |
|
3737 |
+ for iNdEx < l { |
|
3738 |
+ preIndex := iNdEx |
|
3739 |
+ var wire uint64 |
|
3740 |
+ for shift := uint(0); ; shift += 7 { |
|
3741 |
+ if shift >= 64 { |
|
3742 |
+ return ErrIntOverflowSnapshots |
|
3743 |
+ } |
|
3744 |
+ if iNdEx >= l { |
|
3745 |
+ return io.ErrUnexpectedEOF |
|
3746 |
+ } |
|
3747 |
+ b := dAtA[iNdEx] |
|
3748 |
+ iNdEx++ |
|
3749 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3750 |
+ if b < 0x80 { |
|
3751 |
+ break |
|
3752 |
+ } |
|
3753 |
+ } |
|
3754 |
+ fieldNum := int32(wire >> 3) |
|
3755 |
+ wireType := int(wire & 0x7) |
|
3756 |
+ if wireType == 4 { |
|
3757 |
+ return fmt.Errorf("proto: ListSnapshotsRequest: wiretype end group for non-group") |
|
3758 |
+ } |
|
3759 |
+ if fieldNum <= 0 { |
|
3760 |
+ return fmt.Errorf("proto: ListSnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3761 |
+ } |
|
3762 |
+ switch fieldNum { |
|
3763 |
+ case 1: |
|
3764 |
+ if wireType != 2 { |
|
3765 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3766 |
+ } |
|
3767 |
+ var stringLen uint64 |
|
3768 |
+ for shift := uint(0); ; shift += 7 { |
|
3769 |
+ if shift >= 64 { |
|
3770 |
+ return ErrIntOverflowSnapshots |
|
3771 |
+ } |
|
3772 |
+ if iNdEx >= l { |
|
3773 |
+ return io.ErrUnexpectedEOF |
|
3774 |
+ } |
|
3775 |
+ b := dAtA[iNdEx] |
|
3776 |
+ iNdEx++ |
|
3777 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3778 |
+ if b < 0x80 { |
|
3779 |
+ break |
|
3780 |
+ } |
|
3781 |
+ } |
|
3782 |
+ intStringLen := int(stringLen) |
|
3783 |
+ if intStringLen < 0 { |
|
3784 |
+ return ErrInvalidLengthSnapshots |
|
3785 |
+ } |
|
3786 |
+ postIndex := iNdEx + intStringLen |
|
3787 |
+ if postIndex > l { |
|
3788 |
+ return io.ErrUnexpectedEOF |
|
3789 |
+ } |
|
3790 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3791 |
+ iNdEx = postIndex |
|
3792 |
+ default: |
|
3793 |
+ iNdEx = preIndex |
|
3794 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3795 |
+ if err != nil { |
|
3796 |
+ return err |
|
3797 |
+ } |
|
3798 |
+ if skippy < 0 { |
|
3799 |
+ return ErrInvalidLengthSnapshots |
|
3800 |
+ } |
|
3801 |
+ if (iNdEx + skippy) > l { |
|
3802 |
+ return io.ErrUnexpectedEOF |
|
3803 |
+ } |
|
3804 |
+ iNdEx += skippy |
|
3805 |
+ } |
|
3806 |
+ } |
|
3807 |
+ |
|
3808 |
+ if iNdEx > l { |
|
3809 |
+ return io.ErrUnexpectedEOF |
|
3810 |
+ } |
|
3811 |
+ return nil |
|
3812 |
+} |
|
3813 |
+func (m *ListSnapshotsResponse) Unmarshal(dAtA []byte) error { |
|
3814 |
+ l := len(dAtA) |
|
3815 |
+ iNdEx := 0 |
|
3816 |
+ for iNdEx < l { |
|
3817 |
+ preIndex := iNdEx |
|
3818 |
+ var wire uint64 |
|
3819 |
+ for shift := uint(0); ; shift += 7 { |
|
3820 |
+ if shift >= 64 { |
|
3821 |
+ return ErrIntOverflowSnapshots |
|
3822 |
+ } |
|
3823 |
+ if iNdEx >= l { |
|
3824 |
+ return io.ErrUnexpectedEOF |
|
3825 |
+ } |
|
3826 |
+ b := dAtA[iNdEx] |
|
3827 |
+ iNdEx++ |
|
3828 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3829 |
+ if b < 0x80 { |
|
3830 |
+ break |
|
3831 |
+ } |
|
3832 |
+ } |
|
3833 |
+ fieldNum := int32(wire >> 3) |
|
3834 |
+ wireType := int(wire & 0x7) |
|
3835 |
+ if wireType == 4 { |
|
3836 |
+ return fmt.Errorf("proto: ListSnapshotsResponse: wiretype end group for non-group") |
|
3837 |
+ } |
|
3838 |
+ if fieldNum <= 0 { |
|
3839 |
+ return fmt.Errorf("proto: ListSnapshotsResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3840 |
+ } |
|
3841 |
+ switch fieldNum { |
|
3842 |
+ case 1: |
|
3843 |
+ if wireType != 2 { |
|
3844 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) |
|
3845 |
+ } |
|
3846 |
+ var msglen int |
|
3847 |
+ for shift := uint(0); ; shift += 7 { |
|
3848 |
+ if shift >= 64 { |
|
3849 |
+ return ErrIntOverflowSnapshots |
|
3850 |
+ } |
|
3851 |
+ if iNdEx >= l { |
|
3852 |
+ return io.ErrUnexpectedEOF |
|
3853 |
+ } |
|
3854 |
+ b := dAtA[iNdEx] |
|
3855 |
+ iNdEx++ |
|
3856 |
+ msglen |= (int(b) & 0x7F) << shift |
|
3857 |
+ if b < 0x80 { |
|
3858 |
+ break |
|
3859 |
+ } |
|
3860 |
+ } |
|
3861 |
+ if msglen < 0 { |
|
3862 |
+ return ErrInvalidLengthSnapshots |
|
3863 |
+ } |
|
3864 |
+ postIndex := iNdEx + msglen |
|
3865 |
+ if postIndex > l { |
|
3866 |
+ return io.ErrUnexpectedEOF |
|
3867 |
+ } |
|
3868 |
+ m.Info = append(m.Info, Info{}) |
|
3869 |
+ if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
|
3870 |
+ return err |
|
3871 |
+ } |
|
3872 |
+ iNdEx = postIndex |
|
3873 |
+ default: |
|
3874 |
+ iNdEx = preIndex |
|
3875 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3876 |
+ if err != nil { |
|
3877 |
+ return err |
|
3878 |
+ } |
|
3879 |
+ if skippy < 0 { |
|
3880 |
+ return ErrInvalidLengthSnapshots |
|
3881 |
+ } |
|
3882 |
+ if (iNdEx + skippy) > l { |
|
3883 |
+ return io.ErrUnexpectedEOF |
|
3884 |
+ } |
|
3885 |
+ iNdEx += skippy |
|
3886 |
+ } |
|
3887 |
+ } |
|
3888 |
+ |
|
3889 |
+ if iNdEx > l { |
|
3890 |
+ return io.ErrUnexpectedEOF |
|
3891 |
+ } |
|
3892 |
+ return nil |
|
3893 |
+} |
|
3894 |
+func (m *UsageRequest) Unmarshal(dAtA []byte) error { |
|
3895 |
+ l := len(dAtA) |
|
3896 |
+ iNdEx := 0 |
|
3897 |
+ for iNdEx < l { |
|
3898 |
+ preIndex := iNdEx |
|
3899 |
+ var wire uint64 |
|
3900 |
+ for shift := uint(0); ; shift += 7 { |
|
3901 |
+ if shift >= 64 { |
|
3902 |
+ return ErrIntOverflowSnapshots |
|
3903 |
+ } |
|
3904 |
+ if iNdEx >= l { |
|
3905 |
+ return io.ErrUnexpectedEOF |
|
3906 |
+ } |
|
3907 |
+ b := dAtA[iNdEx] |
|
3908 |
+ iNdEx++ |
|
3909 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
3910 |
+ if b < 0x80 { |
|
3911 |
+ break |
|
3912 |
+ } |
|
3913 |
+ } |
|
3914 |
+ fieldNum := int32(wire >> 3) |
|
3915 |
+ wireType := int(wire & 0x7) |
|
3916 |
+ if wireType == 4 { |
|
3917 |
+ return fmt.Errorf("proto: UsageRequest: wiretype end group for non-group") |
|
3918 |
+ } |
|
3919 |
+ if fieldNum <= 0 { |
|
3920 |
+ return fmt.Errorf("proto: UsageRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
|
3921 |
+ } |
|
3922 |
+ switch fieldNum { |
|
3923 |
+ case 1: |
|
3924 |
+ if wireType != 2 { |
|
3925 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType) |
|
3926 |
+ } |
|
3927 |
+ var stringLen uint64 |
|
3928 |
+ for shift := uint(0); ; shift += 7 { |
|
3929 |
+ if shift >= 64 { |
|
3930 |
+ return ErrIntOverflowSnapshots |
|
3931 |
+ } |
|
3932 |
+ if iNdEx >= l { |
|
3933 |
+ return io.ErrUnexpectedEOF |
|
3934 |
+ } |
|
3935 |
+ b := dAtA[iNdEx] |
|
3936 |
+ iNdEx++ |
|
3937 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3938 |
+ if b < 0x80 { |
|
3939 |
+ break |
|
3940 |
+ } |
|
3941 |
+ } |
|
3942 |
+ intStringLen := int(stringLen) |
|
3943 |
+ if intStringLen < 0 { |
|
3944 |
+ return ErrInvalidLengthSnapshots |
|
3945 |
+ } |
|
3946 |
+ postIndex := iNdEx + intStringLen |
|
3947 |
+ if postIndex > l { |
|
3948 |
+ return io.ErrUnexpectedEOF |
|
3949 |
+ } |
|
3950 |
+ m.Snapshotter = string(dAtA[iNdEx:postIndex]) |
|
3951 |
+ iNdEx = postIndex |
|
3952 |
+ case 2: |
|
3953 |
+ if wireType != 2 { |
|
3954 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
|
3955 |
+ } |
|
3956 |
+ var stringLen uint64 |
|
3957 |
+ for shift := uint(0); ; shift += 7 { |
|
3958 |
+ if shift >= 64 { |
|
3959 |
+ return ErrIntOverflowSnapshots |
|
3960 |
+ } |
|
3961 |
+ if iNdEx >= l { |
|
3962 |
+ return io.ErrUnexpectedEOF |
|
3963 |
+ } |
|
3964 |
+ b := dAtA[iNdEx] |
|
3965 |
+ iNdEx++ |
|
3966 |
+ stringLen |= (uint64(b) & 0x7F) << shift |
|
3967 |
+ if b < 0x80 { |
|
3968 |
+ break |
|
3969 |
+ } |
|
3970 |
+ } |
|
3971 |
+ intStringLen := int(stringLen) |
|
3972 |
+ if intStringLen < 0 { |
|
3973 |
+ return ErrInvalidLengthSnapshots |
|
3974 |
+ } |
|
3975 |
+ postIndex := iNdEx + intStringLen |
|
3976 |
+ if postIndex > l { |
|
3977 |
+ return io.ErrUnexpectedEOF |
|
3978 |
+ } |
|
3979 |
+ m.Key = string(dAtA[iNdEx:postIndex]) |
|
3980 |
+ iNdEx = postIndex |
|
3981 |
+ default: |
|
3982 |
+ iNdEx = preIndex |
|
3983 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
3984 |
+ if err != nil { |
|
3985 |
+ return err |
|
3986 |
+ } |
|
3987 |
+ if skippy < 0 { |
|
3988 |
+ return ErrInvalidLengthSnapshots |
|
3989 |
+ } |
|
3990 |
+ if (iNdEx + skippy) > l { |
|
3991 |
+ return io.ErrUnexpectedEOF |
|
3992 |
+ } |
|
3993 |
+ iNdEx += skippy |
|
3994 |
+ } |
|
3995 |
+ } |
|
3996 |
+ |
|
3997 |
+ if iNdEx > l { |
|
3998 |
+ return io.ErrUnexpectedEOF |
|
3999 |
+ } |
|
4000 |
+ return nil |
|
4001 |
+} |
|
4002 |
+func (m *UsageResponse) Unmarshal(dAtA []byte) error { |
|
4003 |
+ l := len(dAtA) |
|
4004 |
+ iNdEx := 0 |
|
4005 |
+ for iNdEx < l { |
|
4006 |
+ preIndex := iNdEx |
|
4007 |
+ var wire uint64 |
|
4008 |
+ for shift := uint(0); ; shift += 7 { |
|
4009 |
+ if shift >= 64 { |
|
4010 |
+ return ErrIntOverflowSnapshots |
|
4011 |
+ } |
|
4012 |
+ if iNdEx >= l { |
|
4013 |
+ return io.ErrUnexpectedEOF |
|
4014 |
+ } |
|
4015 |
+ b := dAtA[iNdEx] |
|
4016 |
+ iNdEx++ |
|
4017 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
4018 |
+ if b < 0x80 { |
|
4019 |
+ break |
|
4020 |
+ } |
|
4021 |
+ } |
|
4022 |
+ fieldNum := int32(wire >> 3) |
|
4023 |
+ wireType := int(wire & 0x7) |
|
4024 |
+ if wireType == 4 { |
|
4025 |
+ return fmt.Errorf("proto: UsageResponse: wiretype end group for non-group") |
|
4026 |
+ } |
|
4027 |
+ if fieldNum <= 0 { |
|
4028 |
+ return fmt.Errorf("proto: UsageResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
|
4029 |
+ } |
|
4030 |
+ switch fieldNum { |
|
4031 |
+ case 1: |
|
4032 |
+ if wireType != 0 { |
|
4033 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) |
|
4034 |
+ } |
|
4035 |
+ m.Size_ = 0 |
|
4036 |
+ for shift := uint(0); ; shift += 7 { |
|
4037 |
+ if shift >= 64 { |
|
4038 |
+ return ErrIntOverflowSnapshots |
|
4039 |
+ } |
|
4040 |
+ if iNdEx >= l { |
|
4041 |
+ return io.ErrUnexpectedEOF |
|
4042 |
+ } |
|
4043 |
+ b := dAtA[iNdEx] |
|
4044 |
+ iNdEx++ |
|
4045 |
+ m.Size_ |= (int64(b) & 0x7F) << shift |
|
4046 |
+ if b < 0x80 { |
|
4047 |
+ break |
|
4048 |
+ } |
|
4049 |
+ } |
|
4050 |
+ case 2: |
|
4051 |
+ if wireType != 0 { |
|
4052 |
+ return fmt.Errorf("proto: wrong wireType = %d for field Inodes", wireType) |
|
4053 |
+ } |
|
4054 |
+ m.Inodes = 0 |
|
4055 |
+ for shift := uint(0); ; shift += 7 { |
|
4056 |
+ if shift >= 64 { |
|
4057 |
+ return ErrIntOverflowSnapshots |
|
4058 |
+ } |
|
4059 |
+ if iNdEx >= l { |
|
4060 |
+ return io.ErrUnexpectedEOF |
|
4061 |
+ } |
|
4062 |
+ b := dAtA[iNdEx] |
|
4063 |
+ iNdEx++ |
|
4064 |
+ m.Inodes |= (int64(b) & 0x7F) << shift |
|
4065 |
+ if b < 0x80 { |
|
4066 |
+ break |
|
4067 |
+ } |
|
4068 |
+ } |
|
4069 |
+ default: |
|
4070 |
+ iNdEx = preIndex |
|
4071 |
+ skippy, err := skipSnapshots(dAtA[iNdEx:]) |
|
4072 |
+ if err != nil { |
|
4073 |
+ return err |
|
4074 |
+ } |
|
4075 |
+ if skippy < 0 { |
|
4076 |
+ return ErrInvalidLengthSnapshots |
|
4077 |
+ } |
|
4078 |
+ if (iNdEx + skippy) > l { |
|
4079 |
+ return io.ErrUnexpectedEOF |
|
4080 |
+ } |
|
4081 |
+ iNdEx += skippy |
|
4082 |
+ } |
|
4083 |
+ } |
|
4084 |
+ |
|
4085 |
+ if iNdEx > l { |
|
4086 |
+ return io.ErrUnexpectedEOF |
|
4087 |
+ } |
|
4088 |
+ return nil |
|
4089 |
+} |
|
4090 |
+func skipSnapshots(dAtA []byte) (n int, err error) { |
|
4091 |
+ l := len(dAtA) |
|
4092 |
+ iNdEx := 0 |
|
4093 |
+ for iNdEx < l { |
|
4094 |
+ var wire uint64 |
|
4095 |
+ for shift := uint(0); ; shift += 7 { |
|
4096 |
+ if shift >= 64 { |
|
4097 |
+ return 0, ErrIntOverflowSnapshots |
|
4098 |
+ } |
|
4099 |
+ if iNdEx >= l { |
|
4100 |
+ return 0, io.ErrUnexpectedEOF |
|
4101 |
+ } |
|
4102 |
+ b := dAtA[iNdEx] |
|
4103 |
+ iNdEx++ |
|
4104 |
+ wire |= (uint64(b) & 0x7F) << shift |
|
4105 |
+ if b < 0x80 { |
|
4106 |
+ break |
|
4107 |
+ } |
|
4108 |
+ } |
|
4109 |
+ wireType := int(wire & 0x7) |
|
4110 |
+ switch wireType { |
|
4111 |
+ case 0: |
|
4112 |
+ for shift := uint(0); ; shift += 7 { |
|
4113 |
+ if shift >= 64 { |
|
4114 |
+ return 0, ErrIntOverflowSnapshots |
|
4115 |
+ } |
|
4116 |
+ if iNdEx >= l { |
|
4117 |
+ return 0, io.ErrUnexpectedEOF |
|
4118 |
+ } |
|
4119 |
+ iNdEx++ |
|
4120 |
+ if dAtA[iNdEx-1] < 0x80 { |
|
4121 |
+ break |
|
4122 |
+ } |
|
4123 |
+ } |
|
4124 |
+ return iNdEx, nil |
|
4125 |
+ case 1: |
|
4126 |
+ iNdEx += 8 |
|
4127 |
+ return iNdEx, nil |
|
4128 |
+ case 2: |
|
4129 |
+ var length int |
|
4130 |
+ for shift := uint(0); ; shift += 7 { |
|
4131 |
+ if shift >= 64 { |
|
4132 |
+ return 0, ErrIntOverflowSnapshots |
|
4133 |
+ } |
|
4134 |
+ if iNdEx >= l { |
|
4135 |
+ return 0, io.ErrUnexpectedEOF |
|
4136 |
+ } |
|
4137 |
+ b := dAtA[iNdEx] |
|
4138 |
+ iNdEx++ |
|
4139 |
+ length |= (int(b) & 0x7F) << shift |
|
4140 |
+ if b < 0x80 { |
|
4141 |
+ break |
|
4142 |
+ } |
|
4143 |
+ } |
|
4144 |
+ iNdEx += length |
|
4145 |
+ if length < 0 { |
|
4146 |
+ return 0, ErrInvalidLengthSnapshots |
|
4147 |
+ } |
|
4148 |
+ return iNdEx, nil |
|
4149 |
+ case 3: |
|
4150 |
+ for { |
|
4151 |
+ var innerWire uint64 |
|
4152 |
+ var start int = iNdEx |
|
4153 |
+ for shift := uint(0); ; shift += 7 { |
|
4154 |
+ if shift >= 64 { |
|
4155 |
+ return 0, ErrIntOverflowSnapshots |
|
4156 |
+ } |
|
4157 |
+ if iNdEx >= l { |
|
4158 |
+ return 0, io.ErrUnexpectedEOF |
|
4159 |
+ } |
|
4160 |
+ b := dAtA[iNdEx] |
|
4161 |
+ iNdEx++ |
|
4162 |
+ innerWire |= (uint64(b) & 0x7F) << shift |
|
4163 |
+ if b < 0x80 { |
|
4164 |
+ break |
|
4165 |
+ } |
|
4166 |
+ } |
|
4167 |
+ innerWireType := int(innerWire & 0x7) |
|
4168 |
+ if innerWireType == 4 { |
|
4169 |
+ break |
|
4170 |
+ } |
|
4171 |
+ next, err := skipSnapshots(dAtA[start:]) |
|
4172 |
+ if err != nil { |
|
4173 |
+ return 0, err |
|
4174 |
+ } |
|
4175 |
+ iNdEx = start + next |
|
4176 |
+ } |
|
4177 |
+ return iNdEx, nil |
|
4178 |
+ case 4: |
|
4179 |
+ return iNdEx, nil |
|
4180 |
+ case 5: |
|
4181 |
+ iNdEx += 4 |
|
4182 |
+ return iNdEx, nil |
|
4183 |
+ default: |
|
4184 |
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
|
4185 |
+ } |
|
4186 |
+ } |
|
4187 |
+ panic("unreachable") |
|
4188 |
+} |
|
4189 |
+ |
|
4190 |
+var ( |
|
4191 |
+ ErrInvalidLengthSnapshots = fmt.Errorf("proto: negative length found during unmarshaling") |
|
4192 |
+ ErrIntOverflowSnapshots = fmt.Errorf("proto: integer overflow") |
|
4193 |
+) |
|
4194 |
+ |
|
4195 |
+func init() { |
|
4196 |
+ proto.RegisterFile("github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto", fileDescriptorSnapshots) |
|
4197 |
+} |
|
4198 |
+ |
|
4199 |
+var fileDescriptorSnapshots = []byte{ |
|
4200 |
+ // 1007 bytes of a gzipped FileDescriptorProto |
|
4201 |
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1a, 0x47, |
|
4202 |
+ 0x14, 0x67, 0x60, 0x8d, 0xe3, 0x87, 0xed, 0xd2, 0x09, 0x26, 0x68, 0x5b, 0xe1, 0x15, 0x87, 0xca, |
|
4203 |
+ 0xea, 0x61, 0x37, 0xa1, 0x6a, 0xe2, 0xc4, 0x97, 0x62, 0x4c, 0x2b, 0xec, 0xd8, 0xa9, 0x36, 0xb6, |
|
4204 |
+ 0x13, 0xa7, 0x55, 0xa3, 0x35, 0x8c, 0xf1, 0x0a, 0x76, 0x97, 0x32, 0x03, 0x11, 0xad, 0x54, 0xf5, |
|
4205 |
+ 0x18, 0xf9, 0xd4, 0x2f, 0xe0, 0x53, 0xfb, 0x21, 0xaa, 0x7e, 0x02, 0x1f, 0x7b, 0xec, 0xa9, 0x6d, |
|
4206 |
+ 0xfc, 0x25, 0x7a, 0xea, 0x1f, 0xcd, 0xec, 0x2c, 0x60, 0x4c, 0xc5, 0x82, 0xc9, 0x6d, 0x66, 0x67, |
|
4207 |
+ 0x7e, 0xef, 0xfd, 0xe6, 0xf7, 0xe6, 0xbd, 0x37, 0x0b, 0xdb, 0x35, 0x9b, 0x9d, 0xb6, 0x8f, 0xf5, |
|
4208 |
+ 0x8a, 0xe7, 0x18, 0x15, 0xcf, 0x65, 0x96, 0xed, 0x92, 0x56, 0x75, 0x70, 0x68, 0x35, 0x6d, 0x83, |
|
4209 |
+ 0x92, 0x56, 0xc7, 0xae, 0x10, 0x6a, 0x50, 0xd7, 0x6a, 0xd2, 0x53, 0x8f, 0x51, 0xa3, 0x73, 0xaf, |
|
4210 |
+ 0x3f, 0xd1, 0x9b, 0x2d, 0x8f, 0x79, 0x58, 0xeb, 0xa3, 0xf4, 0x00, 0xa1, 0xf7, 0x37, 0x75, 0xee, |
|
4211 |
+ 0xa9, 0xa9, 0x9a, 0x57, 0xf3, 0xc4, 0x66, 0x83, 0x8f, 0x7c, 0x9c, 0xfa, 0x5e, 0xcd, 0xf3, 0x6a, |
|
4212 |
+ 0x0d, 0x62, 0x88, 0xd9, 0x71, 0xfb, 0xc4, 0x20, 0x4e, 0x93, 0x75, 0xe5, 0xa2, 0x36, 0xbc, 0x78, |
|
4213 |
+ 0x62, 0x93, 0x46, 0xf5, 0xa5, 0x63, 0xd1, 0xba, 0xdc, 0xb1, 0x3a, 0xbc, 0x83, 0xd9, 0x0e, 0xa1, |
|
4214 |
+ 0xcc, 0x72, 0x9a, 0x72, 0xc3, 0xfd, 0x50, 0x67, 0x64, 0xdd, 0x26, 0xa1, 0x86, 0xe3, 0xb5, 0x5d, |
|
4215 |
+ 0xe6, 0xe3, 0x72, 0x7f, 0x23, 0x48, 0x7f, 0xde, 0x22, 0x4d, 0xab, 0x45, 0x9e, 0xca, 0x53, 0x98, |
|
4216 |
+ 0xe4, 0xeb, 0x36, 0xa1, 0x0c, 0x6b, 0x90, 0x08, 0x0e, 0xc6, 0x48, 0x2b, 0x83, 0x34, 0xb4, 0xb6, |
|
4217 |
+ 0x60, 0x0e, 0x7e, 0xc2, 0x49, 0x88, 0xd5, 0x49, 0x37, 0x13, 0x15, 0x2b, 0x7c, 0x88, 0xd3, 0x10, |
|
4218 |
+ 0xe7, 0xa6, 0x5c, 0x96, 0x89, 0x89, 0x8f, 0x72, 0x86, 0xbf, 0x84, 0x78, 0xc3, 0x3a, 0x26, 0x0d, |
|
4219 |
+ 0x9a, 0x51, 0xb4, 0xd8, 0x5a, 0x22, 0xbf, 0xa5, 0x8f, 0xd3, 0x51, 0x1f, 0xcd, 0x4a, 0x7f, 0x2c, |
|
4220 |
+ 0xcc, 0x94, 0x5c, 0xd6, 0xea, 0x9a, 0xd2, 0xa6, 0xfa, 0x10, 0x12, 0x03, 0x9f, 0x03, 0x5a, 0xa8, |
|
4221 |
+ 0x4f, 0x2b, 0x05, 0x73, 0x1d, 0xab, 0xd1, 0x26, 0x92, 0xaa, 0x3f, 0x79, 0x14, 0x5d, 0x47, 0xb9, |
|
4222 |
+ 0x6d, 0xb8, 0x73, 0xcd, 0x11, 0x6d, 0x7a, 0x2e, 0x25, 0xd8, 0x80, 0xb8, 0x50, 0x8a, 0x66, 0x90, |
|
4223 |
+ 0xe0, 0x7c, 0x67, 0x90, 0xb3, 0x50, 0x52, 0xdf, 0xe5, 0xeb, 0xa6, 0xdc, 0x96, 0xfb, 0x0b, 0xc1, |
|
4224 |
+ 0xed, 0x43, 0x9b, 0xbc, 0x7a, 0x9b, 0x42, 0x1e, 0x0d, 0x09, 0x59, 0x18, 0x2f, 0xe4, 0x08, 0x4a, |
|
4225 |
+ 0xb3, 0x56, 0xf1, 0x33, 0x48, 0x5d, 0xf5, 0x32, 0xad, 0x84, 0x45, 0x58, 0x12, 0x1f, 0xe8, 0x0d, |
|
4226 |
+ 0xb4, 0xcb, 0x15, 0x60, 0x39, 0x30, 0x32, 0x2d, 0x8f, 0x1d, 0x58, 0x31, 0x89, 0xe3, 0x75, 0x66, |
|
4227 |
+ 0x91, 0x14, 0xfc, 0x5e, 0xac, 0x14, 0x3d, 0xc7, 0xb1, 0xd9, 0xe4, 0xd6, 0x30, 0x28, 0xae, 0xe5, |
|
4228 |
+ 0x04, 0x92, 0x8b, 0x71, 0xe0, 0x21, 0xd6, 0x8f, 0xcc, 0x17, 0x43, 0xb7, 0xa2, 0x38, 0xfe, 0x56, |
|
4229 |
+ 0x8c, 0x24, 0x34, 0xeb, 0x7b, 0x51, 0x86, 0xdb, 0x4f, 0x99, 0xc5, 0x66, 0x21, 0xe2, 0xbf, 0x51, |
|
4230 |
+ 0x50, 0xca, 0xee, 0x89, 0xd7, 0x53, 0x04, 0x0d, 0x28, 0xd2, 0xcf, 0x96, 0xe8, 0x95, 0x6c, 0x79, |
|
4231 |
+ 0x04, 0x4a, 0xdd, 0x76, 0xab, 0x42, 0xaa, 0xe5, 0xfc, 0x07, 0xe3, 0x55, 0xd9, 0xb1, 0xdd, 0xaa, |
|
4232 |
+ 0x29, 0x30, 0xb8, 0x08, 0x50, 0x69, 0x11, 0x8b, 0x91, 0xea, 0x4b, 0x8b, 0x65, 0x14, 0x0d, 0xad, |
|
4233 |
+ 0x25, 0xf2, 0xaa, 0xee, 0xd7, 0x61, 0x3d, 0xa8, 0xc3, 0xfa, 0x7e, 0x50, 0x87, 0x37, 0x6f, 0x5d, |
|
4234 |
+ 0xfc, 0xbe, 0x1a, 0xf9, 0xe1, 0x8f, 0x55, 0x64, 0x2e, 0x48, 0x5c, 0x81, 0x71, 0x23, 0xed, 0x66, |
|
4235 |
+ 0x35, 0x30, 0x32, 0x37, 0x89, 0x11, 0x89, 0x2b, 0x30, 0xbc, 0xdd, 0x8b, 0x6e, 0x5c, 0x44, 0x37, |
|
4236 |
+ 0x3f, 0xfe, 0x1c, 0x5c, 0xa9, 0x59, 0x07, 0xf3, 0x39, 0xa4, 0xae, 0x06, 0x53, 0x26, 0xd7, 0x27, |
|
4237 |
+ 0xa0, 0xd8, 0xee, 0x89, 0x27, 0x8c, 0x24, 0xc2, 0x88, 0xcc, 0xc9, 0x6d, 0x2a, 0xfc, 0xa4, 0xa6, |
|
4238 |
+ 0x40, 0xe6, 0x7e, 0x46, 0xb0, 0x72, 0x20, 0x8e, 0x3b, 0xf9, 0x4d, 0x09, 0xbc, 0x47, 0xa7, 0xf5, |
|
4239 |
+ 0x8e, 0x37, 0x20, 0xe1, 0x6b, 0x2d, 0x1a, 0xae, 0xb8, 0x2b, 0xa3, 0x82, 0xf4, 0x29, 0xef, 0xc9, |
|
4240 |
+ 0xbb, 0x16, 0xad, 0x9b, 0x32, 0xa4, 0x7c, 0x9c, 0x7b, 0x01, 0xe9, 0x61, 0xe6, 0x33, 0x93, 0x65, |
|
4241 |
+ 0x1d, 0x52, 0x8f, 0x6d, 0xda, 0x13, 0x3c, 0x7c, 0x4d, 0xcc, 0x1d, 0xc1, 0xca, 0x10, 0xf2, 0x1a, |
|
4242 |
+ 0xa9, 0xd8, 0x94, 0xa4, 0x36, 0x61, 0xf1, 0x80, 0x5a, 0x35, 0x72, 0x93, 0x5c, 0xde, 0x80, 0x25, |
|
4243 |
+ 0x69, 0x43, 0xd2, 0xc2, 0xa0, 0x50, 0xfb, 0x1b, 0x3f, 0xa7, 0x63, 0xa6, 0x18, 0xf3, 0x9c, 0xb6, |
|
4244 |
+ 0x5d, 0xaf, 0x4a, 0xa8, 0x40, 0xc6, 0x4c, 0x39, 0xfb, 0xf0, 0x35, 0x02, 0x85, 0xa7, 0x29, 0x7e, |
|
4245 |
+ 0x1f, 0xe6, 0x0f, 0xf6, 0x76, 0xf6, 0x9e, 0x3c, 0xdb, 0x4b, 0x46, 0xd4, 0x77, 0xce, 0xce, 0xb5, |
|
4246 |
+ 0x04, 0xff, 0x7c, 0xe0, 0xd6, 0x5d, 0xef, 0x95, 0x8b, 0xd3, 0xa0, 0x1c, 0x96, 0x4b, 0xcf, 0x92, |
|
4247 |
+ 0x48, 0x5d, 0x3c, 0x3b, 0xd7, 0x6e, 0xf1, 0x25, 0xde, 0xa2, 0xb0, 0x0a, 0xf1, 0x42, 0x71, 0xbf, |
|
4248 |
+ 0x7c, 0x58, 0x4a, 0x46, 0xd5, 0xe5, 0xb3, 0x73, 0x0d, 0xf8, 0x4a, 0xa1, 0xc2, 0xec, 0x0e, 0xc1, |
|
4249 |
+ 0x1a, 0x2c, 0x14, 0x9f, 0xec, 0xee, 0x96, 0xf7, 0xf7, 0x4b, 0x5b, 0xc9, 0x98, 0xfa, 0xee, 0xd9, |
|
4250 |
+ 0xb9, 0xb6, 0xc4, 0x97, 0xfd, 0x5a, 0xc9, 0x48, 0x55, 0x5d, 0x7c, 0xfd, 0x63, 0x36, 0xf2, 0xcb, |
|
4251 |
+ 0x4f, 0x59, 0xc1, 0x20, 0xff, 0xcf, 0x3c, 0x2c, 0xf4, 0x34, 0xc6, 0xdf, 0xc1, 0xbc, 0x7c, 0x4a, |
|
4252 |
+ 0xe0, 0xf5, 0x69, 0x9f, 0x37, 0xea, 0xc3, 0x29, 0x90, 0x52, 0xc4, 0x36, 0x28, 0xe2, 0x84, 0x1f, |
|
4253 |
+ 0x4f, 0xf5, 0x24, 0x50, 0xef, 0x4f, 0x0a, 0x93, 0x6e, 0xeb, 0x10, 0xf7, 0xbb, 0x2d, 0x36, 0xc6, |
|
4254 |
+ 0x5b, 0xb8, 0xd2, 0xdc, 0xd5, 0xbb, 0xe1, 0x01, 0xd2, 0xd9, 0x11, 0xc4, 0xfd, 0x60, 0xe0, 0x07, |
|
4255 |
+ 0x53, 0xb6, 0x38, 0x35, 0x7d, 0x2d, 0xb3, 0x4b, 0xfc, 0x29, 0xce, 0x4d, 0xfb, 0x2d, 0x3f, 0x8c, |
|
4256 |
+ 0xe9, 0x91, 0x8f, 0x83, 0xff, 0x35, 0xdd, 0x06, 0x85, 0x57, 0xce, 0x30, 0x91, 0x19, 0xd1, 0x2e, |
|
4257 |
+ 0xc3, 0x44, 0x66, 0x64, 0x61, 0xfe, 0x16, 0xe2, 0x7e, 0x6d, 0x0a, 0x73, 0xa2, 0x91, 0xf5, 0x57, |
|
4258 |
+ 0x5d, 0x9f, 0x1c, 0x28, 0x9d, 0x77, 0x41, 0xe1, 0x25, 0x08, 0x87, 0x20, 0x3f, 0xaa, 0xc8, 0xa9, |
|
4259 |
+ 0x0f, 0x26, 0xc6, 0xf9, 0x8e, 0xef, 0x22, 0x7c, 0x0a, 0x73, 0xa2, 0xbc, 0x60, 0x3d, 0x04, 0xfb, |
|
4260 |
+ 0x81, 0x5a, 0xa6, 0x1a, 0xa1, 0xf7, 0xfb, 0xbe, 0x36, 0xbf, 0xba, 0x78, 0x93, 0x8d, 0xfc, 0xf6, |
|
4261 |
+ 0x26, 0x1b, 0xf9, 0xfe, 0x32, 0x8b, 0x2e, 0x2e, 0xb3, 0xe8, 0xd7, 0xcb, 0x2c, 0xfa, 0xf3, 0x32, |
|
4262 |
+ 0x8b, 0x5e, 0x6c, 0x4d, 0xff, 0xcf, 0xb9, 0xd1, 0x9b, 0x3c, 0x8f, 0x1c, 0xc7, 0xc5, 0x55, 0xfa, |
|
4263 |
+ 0xe8, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8e, 0xa0, 0xb2, 0xda, 0xc4, 0x0e, 0x00, 0x00, |
|
4264 |
+} |
0 | 4265 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,150 @@ |
0 |
+syntax = "proto3"; |
|
1 |
+ |
|
2 |
+package containerd.services.snapshots.v1; |
|
3 |
+ |
|
4 |
+import weak "gogoproto/gogo.proto"; |
|
5 |
+import "google/protobuf/empty.proto"; |
|
6 |
+import "google/protobuf/field_mask.proto"; |
|
7 |
+import "google/protobuf/timestamp.proto"; |
|
8 |
+import "github.com/containerd/containerd/api/types/mount.proto"; |
|
9 |
+ |
|
10 |
+option go_package = "github.com/containerd/containerd/api/services/snapshots/v1;snapshots"; |
|
11 |
+ |
|
12 |
+// Snapshot service manages snapshots |
|
13 |
+service Snapshots { |
|
14 |
+ rpc Prepare(PrepareSnapshotRequest) returns (PrepareSnapshotResponse); |
|
15 |
+ rpc View(ViewSnapshotRequest) returns (ViewSnapshotResponse); |
|
16 |
+ rpc Mounts(MountsRequest) returns (MountsResponse); |
|
17 |
+ rpc Commit(CommitSnapshotRequest) returns (google.protobuf.Empty); |
|
18 |
+ rpc Remove(RemoveSnapshotRequest) returns (google.protobuf.Empty); |
|
19 |
+ rpc Stat(StatSnapshotRequest) returns (StatSnapshotResponse); |
|
20 |
+ rpc Update(UpdateSnapshotRequest) returns (UpdateSnapshotResponse); |
|
21 |
+ rpc List(ListSnapshotsRequest) returns (stream ListSnapshotsResponse); |
|
22 |
+ rpc Usage(UsageRequest) returns (UsageResponse); |
|
23 |
+} |
|
24 |
+ |
|
25 |
+message PrepareSnapshotRequest { |
|
26 |
+ string snapshotter = 1; |
|
27 |
+ string key = 2; |
|
28 |
+ string parent = 3; |
|
29 |
+ |
|
30 |
+ // Labels are arbitrary data on snapshots. |
|
31 |
+ // |
|
32 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
33 |
+ map<string, string> labels = 4; |
|
34 |
+} |
|
35 |
+ |
|
36 |
+message PrepareSnapshotResponse { |
|
37 |
+ repeated containerd.types.Mount mounts = 1; |
|
38 |
+} |
|
39 |
+ |
|
40 |
+message ViewSnapshotRequest { |
|
41 |
+ string snapshotter = 1; |
|
42 |
+ string key = 2; |
|
43 |
+ string parent = 3; |
|
44 |
+ |
|
45 |
+ // Labels are arbitrary data on snapshots. |
|
46 |
+ // |
|
47 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
48 |
+ map<string, string> labels = 4; |
|
49 |
+} |
|
50 |
+ |
|
51 |
+message ViewSnapshotResponse { |
|
52 |
+ repeated containerd.types.Mount mounts = 1; |
|
53 |
+} |
|
54 |
+ |
|
55 |
+message MountsRequest { |
|
56 |
+ string snapshotter = 1; |
|
57 |
+ string key = 2; |
|
58 |
+} |
|
59 |
+ |
|
60 |
+message MountsResponse { |
|
61 |
+ repeated containerd.types.Mount mounts = 1; |
|
62 |
+} |
|
63 |
+ |
|
64 |
+message RemoveSnapshotRequest { |
|
65 |
+ string snapshotter = 1; |
|
66 |
+ string key = 2; |
|
67 |
+} |
|
68 |
+ |
|
69 |
+message CommitSnapshotRequest { |
|
70 |
+ string snapshotter = 1; |
|
71 |
+ string name = 2; |
|
72 |
+ string key = 3; |
|
73 |
+ |
|
74 |
+ // Labels are arbitrary data on snapshots. |
|
75 |
+ // |
|
76 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
77 |
+ map<string, string> labels = 4; |
|
78 |
+} |
|
79 |
+ |
|
80 |
+message StatSnapshotRequest { |
|
81 |
+ string snapshotter = 1; |
|
82 |
+ string key = 2; |
|
83 |
+} |
|
84 |
+ |
|
85 |
+enum Kind { |
|
86 |
+ option (gogoproto.goproto_enum_prefix) = false; |
|
87 |
+ option (gogoproto.enum_customname) = "Kind"; |
|
88 |
+ |
|
89 |
+ UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "KindUnknown"]; |
|
90 |
+ VIEW = 1 [(gogoproto.enumvalue_customname) = "KindView"]; |
|
91 |
+ ACTIVE = 2 [(gogoproto.enumvalue_customname) = "KindActive"]; |
|
92 |
+ COMMITTED = 3 [(gogoproto.enumvalue_customname) = "KindCommitted"]; |
|
93 |
+} |
|
94 |
+ |
|
95 |
+message Info { |
|
96 |
+ string name = 1; |
|
97 |
+ string parent = 2; |
|
98 |
+ Kind kind = 3; |
|
99 |
+ |
|
100 |
+ // CreatedAt provides the time at which the snapshot was created. |
|
101 |
+ google.protobuf.Timestamp created_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; |
|
102 |
+ |
|
103 |
+ // UpdatedAt provides the time the info was last updated. |
|
104 |
+ google.protobuf.Timestamp updated_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; |
|
105 |
+ |
|
106 |
+ // Labels are arbitrary data on snapshots. |
|
107 |
+ // |
|
108 |
+ // The combined size of a key/value pair cannot exceed 4096 bytes. |
|
109 |
+ map<string, string> labels = 6; |
|
110 |
+} |
|
111 |
+ |
|
112 |
+message StatSnapshotResponse { |
|
113 |
+ Info info = 1 [(gogoproto.nullable) = false]; |
|
114 |
+} |
|
115 |
+ |
|
116 |
+message UpdateSnapshotRequest { |
|
117 |
+ string snapshotter = 1; |
|
118 |
+ Info info = 2 [(gogoproto.nullable) = false]; |
|
119 |
+ |
|
120 |
+ // UpdateMask specifies which fields to perform the update on. If empty, |
|
121 |
+ // the operation applies to all fields. |
|
122 |
+ // |
|
123 |
+ // In info, Name, Parent, Kind, Created are immutable, |
|
124 |
+ // other field may be updated using this mask. |
|
125 |
+ // If no mask is provided, all mutable field are updated. |
|
126 |
+ google.protobuf.FieldMask update_mask = 3; |
|
127 |
+} |
|
128 |
+ |
|
129 |
+message UpdateSnapshotResponse { |
|
130 |
+ Info info = 1 [(gogoproto.nullable) = false]; |
|
131 |
+} |
|
132 |
+ |
|
133 |
+message ListSnapshotsRequest{ |
|
134 |
+ string snapshotter = 1; |
|
135 |
+} |
|
136 |
+ |
|
137 |
+message ListSnapshotsResponse { |
|
138 |
+ repeated Info info = 1 [(gogoproto.nullable) = false]; |
|
139 |
+} |
|
140 |
+ |
|
141 |
+message UsageRequest { |
|
142 |
+ string snapshotter = 1; |
|
143 |
+ string key = 2; |
|
144 |
+} |
|
145 |
+ |
|
146 |
+message UsageResponse { |
|
147 |
+ int64 size = 1; |
|
148 |
+ int64 inodes = 2; |
|
149 |
+} |
... | ... |
@@ -17,7 +17,7 @@ import ( |
17 | 17 |
imagesapi "github.com/containerd/containerd/api/services/images/v1" |
18 | 18 |
introspectionapi "github.com/containerd/containerd/api/services/introspection/v1" |
19 | 19 |
namespacesapi "github.com/containerd/containerd/api/services/namespaces/v1" |
20 |
- snapshotapi "github.com/containerd/containerd/api/services/snapshot/v1" |
|
20 |
+ snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" |
|
21 | 21 |
"github.com/containerd/containerd/api/services/tasks/v1" |
22 | 22 |
versionservice "github.com/containerd/containerd/api/services/version/v1" |
23 | 23 |
"github.com/containerd/containerd/containers" |
... | ... |
@@ -33,7 +33,7 @@ import ( |
33 | 33 |
"github.com/containerd/containerd/remotes" |
34 | 34 |
"github.com/containerd/containerd/remotes/docker" |
35 | 35 |
"github.com/containerd/containerd/remotes/docker/schema1" |
36 |
- "github.com/containerd/containerd/snapshot" |
|
36 |
+ "github.com/containerd/containerd/snapshots" |
|
37 | 37 |
"github.com/containerd/typeurl" |
38 | 38 |
ptypes "github.com/gogo/protobuf/types" |
39 | 39 |
ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
... | ... |
@@ -435,8 +435,8 @@ func (c *Client) ContentStore() content.Store { |
435 | 435 |
} |
436 | 436 |
|
437 | 437 |
// SnapshotService returns the underlying snapshotter for the provided snapshotter name |
438 |
-func (c *Client) SnapshotService(snapshotterName string) snapshot.Snapshotter { |
|
439 |
- return NewSnapshotterFromClient(snapshotapi.NewSnapshotsClient(c.conn), snapshotterName) |
|
438 |
+func (c *Client) SnapshotService(snapshotterName string) snapshots.Snapshotter { |
|
439 |
+ return NewSnapshotterFromClient(snapshotsapi.NewSnapshotsClient(c.conn), snapshotterName) |
|
440 | 440 |
} |
441 | 441 |
|
442 | 442 |
// TaskService returns the underlying TasksClient |
... | ... |
@@ -9,7 +9,7 @@ import ( |
9 | 9 |
"github.com/containerd/containerd/images" |
10 | 10 |
"github.com/containerd/containerd/platforms" |
11 | 11 |
"github.com/containerd/containerd/rootfs" |
12 |
- "github.com/containerd/containerd/snapshot" |
|
12 |
+ "github.com/containerd/containerd/snapshots" |
|
13 | 13 |
digest "github.com/opencontainers/go-digest" |
14 | 14 |
"github.com/opencontainers/image-spec/identity" |
15 | 15 |
ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
... | ... |
@@ -112,7 +112,7 @@ func (i *image) Unpack(ctx context.Context, snapshotterName string) error { |
112 | 112 |
"containerd.io/uncompressed": layer.Diff.Digest.String(), |
113 | 113 |
} |
114 | 114 |
|
115 |
- unpacked, err = rootfs.ApplyLayer(ctx, layer, chain, sn, a, snapshot.WithLabels(labels)) |
|
115 |
+ unpacked, err = rootfs.ApplyLayer(ctx, layer, chain, sn, a, snapshots.WithLabels(labels)) |
|
116 | 116 |
if err != nil { |
117 | 117 |
return err |
118 | 118 |
} |
... | ... |
@@ -11,7 +11,7 @@ import ( |
11 | 11 |
"github.com/containerd/containerd/content" |
12 | 12 |
"github.com/containerd/containerd/gc" |
13 | 13 |
"github.com/containerd/containerd/log" |
14 |
- "github.com/containerd/containerd/snapshot" |
|
14 |
+ "github.com/containerd/containerd/snapshots" |
|
15 | 15 |
"github.com/pkg/errors" |
16 | 16 |
) |
17 | 17 |
|
... | ... |
@@ -60,7 +60,7 @@ type DB struct { |
60 | 60 |
|
61 | 61 |
// NewDB creates a new metadata database using the provided |
62 | 62 |
// bolt database, content store, and snapshotters. |
63 |
-func NewDB(db *bolt.DB, cs content.Store, ss map[string]snapshot.Snapshotter) *DB { |
|
63 |
+func NewDB(db *bolt.DB, cs content.Store, ss map[string]snapshots.Snapshotter) *DB { |
|
64 | 64 |
m := &DB{ |
65 | 65 |
db: db, |
66 | 66 |
ss: make(map[string]*snapshotter, len(ss)), |
... | ... |
@@ -171,7 +171,7 @@ func (m *DB) ContentStore() content.Store { |
171 | 171 |
|
172 | 172 |
// Snapshotter returns a namespaced content store for |
173 | 173 |
// the requested snapshotter name proxied to a snapshotter. |
174 |
-func (m *DB) Snapshotter(name string) snapshot.Snapshotter { |
|
174 |
+func (m *DB) Snapshotter(name string) snapshots.Snapshotter { |
|
175 | 175 |
sn, ok := m.ss[name] |
176 | 176 |
if !ok { |
177 | 177 |
return nil |
... | ... |
@@ -14,12 +14,12 @@ import ( |
14 | 14 |
"github.com/containerd/containerd/metadata/boltutil" |
15 | 15 |
"github.com/containerd/containerd/mount" |
16 | 16 |
"github.com/containerd/containerd/namespaces" |
17 |
- "github.com/containerd/containerd/snapshot" |
|
17 |
+ "github.com/containerd/containerd/snapshots" |
|
18 | 18 |
"github.com/pkg/errors" |
19 | 19 |
) |
20 | 20 |
|
21 | 21 |
type snapshotter struct { |
22 |
- snapshot.Snapshotter |
|
22 |
+ snapshots.Snapshotter |
|
23 | 23 |
name string |
24 | 24 |
db *DB |
25 | 25 |
l sync.RWMutex |
... | ... |
@@ -27,7 +27,7 @@ type snapshotter struct { |
27 | 27 |
|
28 | 28 |
// newSnapshotter returns a new Snapshotter which namespaces the given snapshot |
29 | 29 |
// using the provided name and database. |
30 |
-func newSnapshotter(db *DB, name string, sn snapshot.Snapshotter) *snapshotter { |
|
30 |
+func newSnapshotter(db *DB, name string, sn snapshots.Snapshotter) *snapshotter { |
|
31 | 31 |
return &snapshotter{ |
32 | 32 |
Snapshotter: sn, |
33 | 33 |
name: name, |
... | ... |
@@ -75,15 +75,15 @@ func (s *snapshotter) resolveKey(ctx context.Context, key string) (string, error |
75 | 75 |
return id, nil |
76 | 76 |
} |
77 | 77 |
|
78 |
-func (s *snapshotter) Stat(ctx context.Context, key string) (snapshot.Info, error) { |
|
78 |
+func (s *snapshotter) Stat(ctx context.Context, key string) (snapshots.Info, error) { |
|
79 | 79 |
ns, err := namespaces.NamespaceRequired(ctx) |
80 | 80 |
if err != nil { |
81 |
- return snapshot.Info{}, err |
|
81 |
+ return snapshots.Info{}, err |
|
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
var ( |
85 | 85 |
bkey string |
86 |
- local = snapshot.Info{ |
|
86 |
+ local = snapshots.Info{ |
|
87 | 87 |
Name: key, |
88 | 88 |
} |
89 | 89 |
) |
... | ... |
@@ -108,33 +108,33 @@ func (s *snapshotter) Stat(ctx context.Context, key string) (snapshot.Info, erro |
108 | 108 |
|
109 | 109 |
return nil |
110 | 110 |
}); err != nil { |
111 |
- return snapshot.Info{}, err |
|
111 |
+ return snapshots.Info{}, err |
|
112 | 112 |
} |
113 | 113 |
|
114 | 114 |
info, err := s.Snapshotter.Stat(ctx, bkey) |
115 | 115 |
if err != nil { |
116 |
- return snapshot.Info{}, err |
|
116 |
+ return snapshots.Info{}, err |
|
117 | 117 |
} |
118 | 118 |
|
119 | 119 |
return overlayInfo(info, local), nil |
120 | 120 |
} |
121 | 121 |
|
122 |
-func (s *snapshotter) Update(ctx context.Context, info snapshot.Info, fieldpaths ...string) (snapshot.Info, error) { |
|
122 |
+func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error) { |
|
123 | 123 |
s.l.RLock() |
124 | 124 |
defer s.l.RUnlock() |
125 | 125 |
|
126 | 126 |
ns, err := namespaces.NamespaceRequired(ctx) |
127 | 127 |
if err != nil { |
128 |
- return snapshot.Info{}, err |
|
128 |
+ return snapshots.Info{}, err |
|
129 | 129 |
} |
130 | 130 |
|
131 | 131 |
if info.Name == "" { |
132 |
- return snapshot.Info{}, errors.Wrap(errdefs.ErrInvalidArgument, "") |
|
132 |
+ return snapshots.Info{}, errors.Wrap(errdefs.ErrInvalidArgument, "") |
|
133 | 133 |
} |
134 | 134 |
|
135 | 135 |
var ( |
136 | 136 |
bkey string |
137 |
- local = snapshot.Info{ |
|
137 |
+ local = snapshots.Info{ |
|
138 | 138 |
Name: info.Name, |
139 | 139 |
} |
140 | 140 |
) |
... | ... |
@@ -195,18 +195,18 @@ func (s *snapshotter) Update(ctx context.Context, info snapshot.Info, fieldpaths |
195 | 195 |
|
196 | 196 |
return nil |
197 | 197 |
}); err != nil { |
198 |
- return snapshot.Info{}, err |
|
198 |
+ return snapshots.Info{}, err |
|
199 | 199 |
} |
200 | 200 |
|
201 | 201 |
info, err = s.Snapshotter.Stat(ctx, bkey) |
202 | 202 |
if err != nil { |
203 |
- return snapshot.Info{}, err |
|
203 |
+ return snapshots.Info{}, err |
|
204 | 204 |
} |
205 | 205 |
|
206 | 206 |
return overlayInfo(info, local), nil |
207 | 207 |
} |
208 | 208 |
|
209 |
-func overlayInfo(info, overlay snapshot.Info) snapshot.Info { |
|
209 |
+func overlayInfo(info, overlay snapshots.Info) snapshots.Info { |
|
210 | 210 |
// Merge info |
211 | 211 |
info.Name = overlay.Name |
212 | 212 |
info.Created = overlay.Created |
... | ... |
@@ -222,10 +222,10 @@ func overlayInfo(info, overlay snapshot.Info) snapshot.Info { |
222 | 222 |
return info |
223 | 223 |
} |
224 | 224 |
|
225 |
-func (s *snapshotter) Usage(ctx context.Context, key string) (snapshot.Usage, error) { |
|
225 |
+func (s *snapshotter) Usage(ctx context.Context, key string) (snapshots.Usage, error) { |
|
226 | 226 |
bkey, err := s.resolveKey(ctx, key) |
227 | 227 |
if err != nil { |
228 |
- return snapshot.Usage{}, err |
|
228 |
+ return snapshots.Usage{}, err |
|
229 | 229 |
} |
230 | 230 |
return s.Snapshotter.Usage(ctx, bkey) |
231 | 231 |
} |
... | ... |
@@ -238,15 +238,15 @@ func (s *snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, er |
238 | 238 |
return s.Snapshotter.Mounts(ctx, bkey) |
239 | 239 |
} |
240 | 240 |
|
241 |
-func (s *snapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshot.Opt) ([]mount.Mount, error) { |
|
241 |
+func (s *snapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { |
|
242 | 242 |
return s.createSnapshot(ctx, key, parent, false, opts) |
243 | 243 |
} |
244 | 244 |
|
245 |
-func (s *snapshotter) View(ctx context.Context, key, parent string, opts ...snapshot.Opt) ([]mount.Mount, error) { |
|
245 |
+func (s *snapshotter) View(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { |
|
246 | 246 |
return s.createSnapshot(ctx, key, parent, true, opts) |
247 | 247 |
} |
248 | 248 |
|
249 |
-func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, readonly bool, opts []snapshot.Opt) ([]mount.Mount, error) { |
|
249 |
+func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, readonly bool, opts []snapshots.Opt) ([]mount.Mount, error) { |
|
250 | 250 |
s.l.RLock() |
251 | 251 |
defer s.l.RUnlock() |
252 | 252 |
|
... | ... |
@@ -255,7 +255,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re |
255 | 255 |
return nil, err |
256 | 256 |
} |
257 | 257 |
|
258 |
- var base snapshot.Info |
|
258 |
+ var base snapshots.Info |
|
259 | 259 |
for _, opt := range opts { |
260 | 260 |
if err := opt(&base); err != nil { |
261 | 261 |
return nil, err |
... | ... |
@@ -336,7 +336,7 @@ func (s *snapshotter) createSnapshot(ctx context.Context, key, parent string, re |
336 | 336 |
return m, nil |
337 | 337 |
} |
338 | 338 |
|
339 |
-func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snapshot.Opt) error { |
|
339 |
+func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) error { |
|
340 | 340 |
s.l.RLock() |
341 | 341 |
defer s.l.RUnlock() |
342 | 342 |
|
... | ... |
@@ -345,7 +345,7 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap |
345 | 345 |
return err |
346 | 346 |
} |
347 | 347 |
|
348 |
- var base snapshot.Info |
|
348 |
+ var base snapshots.Info |
|
349 | 349 |
for _, opt := range opts { |
350 | 350 |
if err := opt(&base); err != nil { |
351 | 351 |
return err |
... | ... |
@@ -493,10 +493,10 @@ func (s *snapshotter) Remove(ctx context.Context, key string) error { |
493 | 493 |
|
494 | 494 |
type infoPair struct { |
495 | 495 |
bkey string |
496 |
- info snapshot.Info |
|
496 |
+ info snapshots.Info |
|
497 | 497 |
} |
498 | 498 |
|
499 |
-func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapshot.Info) error) error { |
|
499 |
+func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapshots.Info) error) error { |
|
500 | 500 |
ns, err := namespaces.NamespaceRequired(ctx) |
501 | 501 |
if err != nil { |
502 | 502 |
return err |
... | ... |
@@ -533,7 +533,7 @@ func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapsho |
533 | 533 |
|
534 | 534 |
pair := infoPair{ |
535 | 535 |
bkey: string(sbkt.Get(bucketKeyName)), |
536 |
- info: snapshot.Info{ |
|
536 |
+ info: snapshots.Info{ |
|
537 | 537 |
Name: string(k), |
538 | 538 |
Parent: string(sbkt.Get(bucketKeyParent)), |
539 | 539 |
}, |
... | ... |
@@ -586,7 +586,7 @@ func (s *snapshotter) Walk(ctx context.Context, fn func(context.Context, snapsho |
586 | 586 |
return nil |
587 | 587 |
} |
588 | 588 |
|
589 |
-func validateSnapshot(info *snapshot.Info) error { |
|
589 |
+func validateSnapshot(info *snapshots.Info) error { |
|
590 | 590 |
for k, v := range info.Labels { |
591 | 591 |
if err := labels.Validate(k, v); err != nil { |
592 | 592 |
return errors.Wrapf(err, "info.Labels") |
... | ... |
@@ -670,7 +670,7 @@ func (s *snapshotter) garbageCollect(ctx context.Context) (d time.Duration, err |
670 | 670 |
} |
671 | 671 |
|
672 | 672 |
type treeNode struct { |
673 |
- info snapshot.Info |
|
673 |
+ info snapshots.Info |
|
674 | 674 |
remove bool |
675 | 675 |
children []*treeNode |
676 | 676 |
} |
... | ... |
@@ -679,7 +679,7 @@ func (s *snapshotter) walkTree(ctx context.Context, seen map[string]struct{}) ([ |
679 | 679 |
roots := []*treeNode{} |
680 | 680 |
nodes := map[string]*treeNode{} |
681 | 681 |
|
682 |
- if err := s.Snapshotter.Walk(ctx, func(ctx context.Context, info snapshot.Info) error { |
|
682 |
+ if err := s.Snapshotter.Walk(ctx, func(ctx context.Context, info snapshots.Info) error { |
|
683 | 683 |
_, isSeen := seen[info.Name] |
684 | 684 |
node, ok := nodes[info.Name] |
685 | 685 |
if !ok { |
... | ... |
@@ -4,13 +4,13 @@ import ( |
4 | 4 |
"context" |
5 | 5 |
|
6 | 6 |
"github.com/containerd/containerd/content" |
7 |
- "github.com/containerd/containerd/snapshot" |
|
7 |
+ "github.com/containerd/containerd/snapshots" |
|
8 | 8 |
ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
9 | 9 |
) |
10 | 10 |
|
11 | 11 |
// Client interface used by SpecOpt |
12 | 12 |
type Client interface { |
13 |
- SnapshotService(snapshotterName string) snapshot.Snapshotter |
|
13 |
+ SnapshotService(snapshotterName string) snapshots.Snapshotter |
|
14 | 14 |
} |
15 | 15 |
|
16 | 16 |
// Image interface used by some SpecOpt to query image configuration |
... | ... |
@@ -9,7 +9,7 @@ import ( |
9 | 9 |
"github.com/containerd/containerd/diff" |
10 | 10 |
"github.com/containerd/containerd/errdefs" |
11 | 11 |
"github.com/containerd/containerd/log" |
12 |
- "github.com/containerd/containerd/snapshot" |
|
12 |
+ "github.com/containerd/containerd/snapshots" |
|
13 | 13 |
"github.com/opencontainers/go-digest" |
14 | 14 |
"github.com/opencontainers/image-spec/identity" |
15 | 15 |
ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
... | ... |
@@ -30,7 +30,7 @@ type Layer struct { |
30 | 30 |
// The returned result is a chain id digest representing all the applied layers. |
31 | 31 |
// Layers are applied in order they are given, making the first layer the |
32 | 32 |
// bottom-most layer in the layer chain. |
33 |
-func ApplyLayers(ctx context.Context, layers []Layer, sn snapshot.Snapshotter, a diff.Differ) (digest.Digest, error) { |
|
33 |
+func ApplyLayers(ctx context.Context, layers []Layer, sn snapshots.Snapshotter, a diff.Differ) (digest.Digest, error) { |
|
34 | 34 |
var chain []digest.Digest |
35 | 35 |
for _, layer := range layers { |
36 | 36 |
if _, err := ApplyLayer(ctx, layer, chain, sn, a); err != nil { |
... | ... |
@@ -46,7 +46,7 @@ func ApplyLayers(ctx context.Context, layers []Layer, sn snapshot.Snapshotter, a |
46 | 46 |
// ApplyLayer applies a single layer on top of the given provided layer chain, |
47 | 47 |
// using the provided snapshotter and applier. If the layer was unpacked true |
48 | 48 |
// is returned, if the layer already exists false is returned. |
49 |
-func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshot.Snapshotter, a diff.Differ, opts ...snapshot.Opt) (bool, error) { |
|
49 |
+func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Differ, opts ...snapshots.Opt) (bool, error) { |
|
50 | 50 |
var ( |
51 | 51 |
parent = identity.ChainID(chain) |
52 | 52 |
chainID = identity.ChainID(append(chain, layer.Diff.Digest)) |
... | ... |
@@ -5,7 +5,7 @@ import ( |
5 | 5 |
|
6 | 6 |
"github.com/containerd/containerd/diff" |
7 | 7 |
"github.com/containerd/containerd/mount" |
8 |
- "github.com/containerd/containerd/snapshot" |
|
8 |
+ "github.com/containerd/containerd/snapshots" |
|
9 | 9 |
ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
10 | 10 |
"golang.org/x/net/context" |
11 | 11 |
) |
... | ... |
@@ -14,7 +14,7 @@ import ( |
14 | 14 |
// of the snapshot. A content ref is provided to track the progress of the |
15 | 15 |
// content creation and the provided snapshotter and mount differ are used |
16 | 16 |
// for calculating the diff. The descriptor for the layer diff is returned. |
17 |
-func Diff(ctx context.Context, snapshotID string, sn snapshot.Snapshotter, d diff.Differ, opts ...diff.Opt) (ocispec.Descriptor, error) { |
|
17 |
+func Diff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter, d diff.Differ, opts ...diff.Opt) (ocispec.Descriptor, error) { |
|
18 | 18 |
info, err := sn.Stat(ctx, snapshotID) |
19 | 19 |
if err != nil { |
20 | 20 |
return ocispec.Descriptor{}, err |
... | ... |
@@ -28,7 +28,7 @@ func Diff(ctx context.Context, snapshotID string, sn snapshot.Snapshotter, d dif |
28 | 28 |
defer sn.Remove(ctx, lowerKey) |
29 | 29 |
|
30 | 30 |
var upper []mount.Mount |
31 |
- if info.Kind == snapshot.KindActive { |
|
31 |
+ if info.Kind == snapshots.KindActive { |
|
32 | 32 |
upper, err = sn.Mounts(ctx, snapshotID) |
33 | 33 |
if err != nil { |
34 | 34 |
return ocispec.Descriptor{}, err |
... | ... |
@@ -8,7 +8,7 @@ import ( |
8 | 8 |
|
9 | 9 |
"github.com/containerd/containerd/log" |
10 | 10 |
"github.com/containerd/containerd/mount" |
11 |
- "github.com/containerd/containerd/snapshot" |
|
11 |
+ "github.com/containerd/containerd/snapshots" |
|
12 | 12 |
digest "github.com/opencontainers/go-digest" |
13 | 13 |
"github.com/pkg/errors" |
14 | 14 |
) |
... | ... |
@@ -26,7 +26,7 @@ type Mounter interface { |
26 | 26 |
} |
27 | 27 |
|
28 | 28 |
// InitRootFS initializes the snapshot for use as a rootfs |
29 |
-func InitRootFS(ctx context.Context, name string, parent digest.Digest, readonly bool, snapshotter snapshot.Snapshotter, mounter Mounter) ([]mount.Mount, error) { |
|
29 |
+func InitRootFS(ctx context.Context, name string, parent digest.Digest, readonly bool, snapshotter snapshots.Snapshotter, mounter Mounter) ([]mount.Mount, error) { |
|
30 | 30 |
_, err := snapshotter.Stat(ctx, name) |
31 | 31 |
if err == nil { |
32 | 32 |
return nil, errors.Errorf("rootfs already exists") |
... | ... |
@@ -51,7 +51,7 @@ func InitRootFS(ctx context.Context, name string, parent digest.Digest, readonly |
51 | 51 |
return snapshotter.Prepare(ctx, name, parentS) |
52 | 52 |
} |
53 | 53 |
|
54 |
-func createInitLayer(ctx context.Context, parent, initName string, initFn func(string) error, snapshotter snapshot.Snapshotter, mounter Mounter) (string, error) { |
|
54 |
+func createInitLayer(ctx context.Context, parent, initName string, initFn func(string) error, snapshotter snapshots.Snapshotter, mounter Mounter) (string, error) { |
|
55 | 55 |
initS := fmt.Sprintf("%s %s", parent, initName) |
56 | 56 |
if _, err := snapshotter.Stat(ctx, initS); err == nil { |
57 | 57 |
return initS, nil |
... | ... |
@@ -18,7 +18,7 @@ import ( |
18 | 18 |
introspection "github.com/containerd/containerd/api/services/introspection/v1" |
19 | 19 |
leasesapi "github.com/containerd/containerd/api/services/leases/v1" |
20 | 20 |
namespaces "github.com/containerd/containerd/api/services/namespaces/v1" |
21 |
- snapshotapi "github.com/containerd/containerd/api/services/snapshot/v1" |
|
21 |
+ snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" |
|
22 | 22 |
tasks "github.com/containerd/containerd/api/services/tasks/v1" |
23 | 23 |
version "github.com/containerd/containerd/api/services/version/v1" |
24 | 24 |
"github.com/containerd/containerd/content" |
... | ... |
@@ -27,7 +27,7 @@ import ( |
27 | 27 |
"github.com/containerd/containerd/log" |
28 | 28 |
"github.com/containerd/containerd/metadata" |
29 | 29 |
"github.com/containerd/containerd/plugin" |
30 |
- "github.com/containerd/containerd/snapshot" |
|
30 |
+ "github.com/containerd/containerd/snapshots" |
|
31 | 31 |
metrics "github.com/docker/go-metrics" |
32 | 32 |
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" |
33 | 33 |
"github.com/pkg/errors" |
... | ... |
@@ -199,7 +199,7 @@ func loadPlugins(config *Config) ([]*plugin.Registration, error) { |
199 | 199 |
return nil, err |
200 | 200 |
} |
201 | 201 |
|
202 |
- snapshotters := make(map[string]snapshot.Snapshotter) |
|
202 |
+ snapshotters := make(map[string]snapshots.Snapshotter) |
|
203 | 203 |
for name, sn := range snapshottersRaw { |
204 | 204 |
sn, err := sn.Instance() |
205 | 205 |
if err != nil { |
... | ... |
@@ -207,7 +207,7 @@ func loadPlugins(config *Config) ([]*plugin.Registration, error) { |
207 | 207 |
Warnf("could not use snapshotter %v in metadata plugin", name) |
208 | 208 |
continue |
209 | 209 |
} |
210 |
- snapshotters[name] = sn.(snapshot.Snapshotter) |
|
210 |
+ snapshotters[name] = sn.(snapshots.Snapshotter) |
|
211 | 211 |
} |
212 | 212 |
|
213 | 213 |
path := filepath.Join(ic.Root, "meta.db") |
... | ... |
@@ -249,7 +249,7 @@ func interceptor( |
249 | 249 |
// No need to change the context |
250 | 250 |
case version.VersionServer: |
251 | 251 |
ctx = log.WithModule(ctx, "version") |
252 |
- case snapshotapi.SnapshotsServer: |
|
252 |
+ case snapshotsapi.SnapshotsServer: |
|
253 | 253 |
ctx = log.WithModule(ctx, "snapshot") |
254 | 254 |
case diff.DiffServer: |
255 | 255 |
ctx = log.WithModule(ctx, "diff") |
... | ... |
@@ -4,17 +4,17 @@ import ( |
4 | 4 |
"context" |
5 | 5 |
"io" |
6 | 6 |
|
7 |
- snapshotapi "github.com/containerd/containerd/api/services/snapshot/v1" |
|
7 |
+ snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" |
|
8 | 8 |
"github.com/containerd/containerd/api/types" |
9 | 9 |
"github.com/containerd/containerd/errdefs" |
10 | 10 |
"github.com/containerd/containerd/mount" |
11 |
- "github.com/containerd/containerd/snapshot" |
|
11 |
+ "github.com/containerd/containerd/snapshots" |
|
12 | 12 |
protobuftypes "github.com/gogo/protobuf/types" |
13 | 13 |
) |
14 | 14 |
|
15 | 15 |
// NewSnapshotterFromClient returns a new Snapshotter which communicates |
16 | 16 |
// over a GRPC connection. |
17 |
-func NewSnapshotterFromClient(client snapshotapi.SnapshotsClient, snapshotterName string) snapshot.Snapshotter { |
|
17 |
+func NewSnapshotterFromClient(client snapshotsapi.SnapshotsClient, snapshotterName string) snapshots.Snapshotter { |
|
18 | 18 |
return &remoteSnapshotter{ |
19 | 19 |
client: client, |
20 | 20 |
snapshotterName: snapshotterName, |
... | ... |
@@ -22,25 +22,25 @@ func NewSnapshotterFromClient(client snapshotapi.SnapshotsClient, snapshotterNam |
22 | 22 |
} |
23 | 23 |
|
24 | 24 |
type remoteSnapshotter struct { |
25 |
- client snapshotapi.SnapshotsClient |
|
25 |
+ client snapshotsapi.SnapshotsClient |
|
26 | 26 |
snapshotterName string |
27 | 27 |
} |
28 | 28 |
|
29 |
-func (r *remoteSnapshotter) Stat(ctx context.Context, key string) (snapshot.Info, error) { |
|
29 |
+func (r *remoteSnapshotter) Stat(ctx context.Context, key string) (snapshots.Info, error) { |
|
30 | 30 |
resp, err := r.client.Stat(ctx, |
31 |
- &snapshotapi.StatSnapshotRequest{ |
|
31 |
+ &snapshotsapi.StatSnapshotRequest{ |
|
32 | 32 |
Snapshotter: r.snapshotterName, |
33 | 33 |
Key: key, |
34 | 34 |
}) |
35 | 35 |
if err != nil { |
36 |
- return snapshot.Info{}, errdefs.FromGRPC(err) |
|
36 |
+ return snapshots.Info{}, errdefs.FromGRPC(err) |
|
37 | 37 |
} |
38 | 38 |
return toInfo(resp.Info), nil |
39 | 39 |
} |
40 | 40 |
|
41 |
-func (r *remoteSnapshotter) Update(ctx context.Context, info snapshot.Info, fieldpaths ...string) (snapshot.Info, error) { |
|
41 |
+func (r *remoteSnapshotter) Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error) { |
|
42 | 42 |
resp, err := r.client.Update(ctx, |
43 |
- &snapshotapi.UpdateSnapshotRequest{ |
|
43 |
+ &snapshotsapi.UpdateSnapshotRequest{ |
|
44 | 44 |
Snapshotter: r.snapshotterName, |
45 | 45 |
Info: fromInfo(info), |
46 | 46 |
UpdateMask: &protobuftypes.FieldMask{ |
... | ... |
@@ -48,24 +48,24 @@ func (r *remoteSnapshotter) Update(ctx context.Context, info snapshot.Info, fiel |
48 | 48 |
}, |
49 | 49 |
}) |
50 | 50 |
if err != nil { |
51 |
- return snapshot.Info{}, errdefs.FromGRPC(err) |
|
51 |
+ return snapshots.Info{}, errdefs.FromGRPC(err) |
|
52 | 52 |
} |
53 | 53 |
return toInfo(resp.Info), nil |
54 | 54 |
} |
55 | 55 |
|
56 |
-func (r *remoteSnapshotter) Usage(ctx context.Context, key string) (snapshot.Usage, error) { |
|
57 |
- resp, err := r.client.Usage(ctx, &snapshotapi.UsageRequest{ |
|
56 |
+func (r *remoteSnapshotter) Usage(ctx context.Context, key string) (snapshots.Usage, error) { |
|
57 |
+ resp, err := r.client.Usage(ctx, &snapshotsapi.UsageRequest{ |
|
58 | 58 |
Snapshotter: r.snapshotterName, |
59 | 59 |
Key: key, |
60 | 60 |
}) |
61 | 61 |
if err != nil { |
62 |
- return snapshot.Usage{}, errdefs.FromGRPC(err) |
|
62 |
+ return snapshots.Usage{}, errdefs.FromGRPC(err) |
|
63 | 63 |
} |
64 | 64 |
return toUsage(resp), nil |
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
func (r *remoteSnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, error) { |
68 |
- resp, err := r.client.Mounts(ctx, &snapshotapi.MountsRequest{ |
|
68 |
+ resp, err := r.client.Mounts(ctx, &snapshotsapi.MountsRequest{ |
|
69 | 69 |
Snapshotter: r.snapshotterName, |
70 | 70 |
Key: key, |
71 | 71 |
}) |
... | ... |
@@ -75,14 +75,14 @@ func (r *remoteSnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mou |
75 | 75 |
return toMounts(resp.Mounts), nil |
76 | 76 |
} |
77 | 77 |
|
78 |
-func (r *remoteSnapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshot.Opt) ([]mount.Mount, error) { |
|
79 |
- var local snapshot.Info |
|
78 |
+func (r *remoteSnapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { |
|
79 |
+ var local snapshots.Info |
|
80 | 80 |
for _, opt := range opts { |
81 | 81 |
if err := opt(&local); err != nil { |
82 | 82 |
return nil, err |
83 | 83 |
} |
84 | 84 |
} |
85 |
- resp, err := r.client.Prepare(ctx, &snapshotapi.PrepareSnapshotRequest{ |
|
85 |
+ resp, err := r.client.Prepare(ctx, &snapshotsapi.PrepareSnapshotRequest{ |
|
86 | 86 |
Snapshotter: r.snapshotterName, |
87 | 87 |
Key: key, |
88 | 88 |
Parent: parent, |
... | ... |
@@ -94,14 +94,14 @@ func (r *remoteSnapshotter) Prepare(ctx context.Context, key, parent string, opt |
94 | 94 |
return toMounts(resp.Mounts), nil |
95 | 95 |
} |
96 | 96 |
|
97 |
-func (r *remoteSnapshotter) View(ctx context.Context, key, parent string, opts ...snapshot.Opt) ([]mount.Mount, error) { |
|
98 |
- var local snapshot.Info |
|
97 |
+func (r *remoteSnapshotter) View(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) { |
|
98 |
+ var local snapshots.Info |
|
99 | 99 |
for _, opt := range opts { |
100 | 100 |
if err := opt(&local); err != nil { |
101 | 101 |
return nil, err |
102 | 102 |
} |
103 | 103 |
} |
104 |
- resp, err := r.client.View(ctx, &snapshotapi.ViewSnapshotRequest{ |
|
104 |
+ resp, err := r.client.View(ctx, &snapshotsapi.ViewSnapshotRequest{ |
|
105 | 105 |
Snapshotter: r.snapshotterName, |
106 | 106 |
Key: key, |
107 | 107 |
Parent: parent, |
... | ... |
@@ -113,14 +113,14 @@ func (r *remoteSnapshotter) View(ctx context.Context, key, parent string, opts . |
113 | 113 |
return toMounts(resp.Mounts), nil |
114 | 114 |
} |
115 | 115 |
|
116 |
-func (r *remoteSnapshotter) Commit(ctx context.Context, name, key string, opts ...snapshot.Opt) error { |
|
117 |
- var local snapshot.Info |
|
116 |
+func (r *remoteSnapshotter) Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) error { |
|
117 |
+ var local snapshots.Info |
|
118 | 118 |
for _, opt := range opts { |
119 | 119 |
if err := opt(&local); err != nil { |
120 | 120 |
return err |
121 | 121 |
} |
122 | 122 |
} |
123 |
- _, err := r.client.Commit(ctx, &snapshotapi.CommitSnapshotRequest{ |
|
123 |
+ _, err := r.client.Commit(ctx, &snapshotsapi.CommitSnapshotRequest{ |
|
124 | 124 |
Snapshotter: r.snapshotterName, |
125 | 125 |
Name: name, |
126 | 126 |
Key: key, |
... | ... |
@@ -130,15 +130,15 @@ func (r *remoteSnapshotter) Commit(ctx context.Context, name, key string, opts . |
130 | 130 |
} |
131 | 131 |
|
132 | 132 |
func (r *remoteSnapshotter) Remove(ctx context.Context, key string) error { |
133 |
- _, err := r.client.Remove(ctx, &snapshotapi.RemoveSnapshotRequest{ |
|
133 |
+ _, err := r.client.Remove(ctx, &snapshotsapi.RemoveSnapshotRequest{ |
|
134 | 134 |
Snapshotter: r.snapshotterName, |
135 | 135 |
Key: key, |
136 | 136 |
}) |
137 | 137 |
return errdefs.FromGRPC(err) |
138 | 138 |
} |
139 | 139 |
|
140 |
-func (r *remoteSnapshotter) Walk(ctx context.Context, fn func(context.Context, snapshot.Info) error) error { |
|
141 |
- sc, err := r.client.List(ctx, &snapshotapi.ListSnapshotsRequest{ |
|
140 |
+func (r *remoteSnapshotter) Walk(ctx context.Context, fn func(context.Context, snapshots.Info) error) error { |
|
141 |
+ sc, err := r.client.List(ctx, &snapshotsapi.ListSnapshotsRequest{ |
|
142 | 142 |
Snapshotter: r.snapshotterName, |
143 | 143 |
}) |
144 | 144 |
if err != nil { |
... | ... |
@@ -167,18 +167,18 @@ func (r *remoteSnapshotter) Close() error { |
167 | 167 |
return nil |
168 | 168 |
} |
169 | 169 |
|
170 |
-func toKind(kind snapshotapi.Kind) snapshot.Kind { |
|
171 |
- if kind == snapshotapi.KindActive { |
|
172 |
- return snapshot.KindActive |
|
170 |
+func toKind(kind snapshotsapi.Kind) snapshots.Kind { |
|
171 |
+ if kind == snapshotsapi.KindActive { |
|
172 |
+ return snapshots.KindActive |
|
173 | 173 |
} |
174 |
- if kind == snapshotapi.KindView { |
|
175 |
- return snapshot.KindView |
|
174 |
+ if kind == snapshotsapi.KindView { |
|
175 |
+ return snapshots.KindView |
|
176 | 176 |
} |
177 |
- return snapshot.KindCommitted |
|
177 |
+ return snapshots.KindCommitted |
|
178 | 178 |
} |
179 | 179 |
|
180 |
-func toInfo(info snapshotapi.Info) snapshot.Info { |
|
181 |
- return snapshot.Info{ |
|
180 |
+func toInfo(info snapshotsapi.Info) snapshots.Info { |
|
181 |
+ return snapshots.Info{ |
|
182 | 182 |
Name: info.Name, |
183 | 183 |
Parent: info.Parent, |
184 | 184 |
Kind: toKind(info.Kind), |
... | ... |
@@ -188,8 +188,8 @@ func toInfo(info snapshotapi.Info) snapshot.Info { |
188 | 188 |
} |
189 | 189 |
} |
190 | 190 |
|
191 |
-func toUsage(resp *snapshotapi.UsageResponse) snapshot.Usage { |
|
192 |
- return snapshot.Usage{ |
|
191 |
+func toUsage(resp *snapshotsapi.UsageResponse) snapshots.Usage { |
|
192 |
+ return snapshots.Usage{ |
|
193 | 193 |
Inodes: resp.Inodes, |
194 | 194 |
Size: resp.Size_, |
195 | 195 |
} |
... | ... |
@@ -207,18 +207,18 @@ func toMounts(mm []*types.Mount) []mount.Mount { |
207 | 207 |
return mounts |
208 | 208 |
} |
209 | 209 |
|
210 |
-func fromKind(kind snapshot.Kind) snapshotapi.Kind { |
|
211 |
- if kind == snapshot.KindActive { |
|
212 |
- return snapshotapi.KindActive |
|
210 |
+func fromKind(kind snapshots.Kind) snapshotsapi.Kind { |
|
211 |
+ if kind == snapshots.KindActive { |
|
212 |
+ return snapshotsapi.KindActive |
|
213 | 213 |
} |
214 |
- if kind == snapshot.KindView { |
|
215 |
- return snapshotapi.KindView |
|
214 |
+ if kind == snapshots.KindView { |
|
215 |
+ return snapshotsapi.KindView |
|
216 | 216 |
} |
217 |
- return snapshotapi.KindCommitted |
|
217 |
+ return snapshotsapi.KindCommitted |
|
218 | 218 |
} |
219 | 219 |
|
220 |
-func fromInfo(info snapshot.Info) snapshotapi.Info { |
|
221 |
- return snapshotapi.Info{ |
|
220 |
+func fromInfo(info snapshots.Info) snapshotsapi.Info { |
|
221 |
+ return snapshotsapi.Info{ |
|
222 | 222 |
Name: info.Name, |
223 | 223 |
Parent: info.Parent, |
224 | 224 |
Kind: fromKind(info.Kind), |
225 | 225 |
deleted file mode 100644 |
... | ... |
@@ -1,316 +0,0 @@ |
1 |
-package snapshot |
|
2 |
- |
|
3 |
-import ( |
|
4 |
- "context" |
|
5 |
- "encoding/json" |
|
6 |
- "strings" |
|
7 |
- "time" |
|
8 |
- |
|
9 |
- "github.com/containerd/containerd/mount" |
|
10 |
-) |
|
11 |
- |
|
12 |
-// Kind identifies the kind of snapshot. |
|
13 |
-type Kind uint8 |
|
14 |
- |
|
15 |
-// definitions of snapshot kinds |
|
16 |
-const ( |
|
17 |
- KindUnknown Kind = iota |
|
18 |
- KindView |
|
19 |
- KindActive |
|
20 |
- KindCommitted |
|
21 |
-) |
|
22 |
- |
|
23 |
-// ParseKind parses the provided string into a Kind |
|
24 |
-// |
|
25 |
-// If the string cannot be parsed KindUnknown is returned |
|
26 |
-func ParseKind(s string) Kind { |
|
27 |
- s = strings.ToLower(s) |
|
28 |
- switch s { |
|
29 |
- case "view": |
|
30 |
- return KindView |
|
31 |
- case "active": |
|
32 |
- return KindActive |
|
33 |
- case "committed": |
|
34 |
- return KindCommitted |
|
35 |
- } |
|
36 |
- |
|
37 |
- return KindUnknown |
|
38 |
-} |
|
39 |
- |
|
40 |
-// String returns the string representation of the Kind |
|
41 |
-func (k Kind) String() string { |
|
42 |
- switch k { |
|
43 |
- case KindView: |
|
44 |
- return "View" |
|
45 |
- case KindActive: |
|
46 |
- return "Active" |
|
47 |
- case KindCommitted: |
|
48 |
- return "Committed" |
|
49 |
- } |
|
50 |
- |
|
51 |
- return "Unknown" |
|
52 |
-} |
|
53 |
- |
|
54 |
-// MarshalJSON the Kind to JSON |
|
55 |
-func (k Kind) MarshalJSON() ([]byte, error) { |
|
56 |
- return json.Marshal(k.String()) |
|
57 |
-} |
|
58 |
- |
|
59 |
-// UnmarshalJSON the Kind from JSON |
|
60 |
-func (k *Kind) UnmarshalJSON(b []byte) error { |
|
61 |
- var s string |
|
62 |
- if err := json.Unmarshal(b, &s); err != nil { |
|
63 |
- return err |
|
64 |
- } |
|
65 |
- |
|
66 |
- *k = ParseKind(s) |
|
67 |
- return nil |
|
68 |
-} |
|
69 |
- |
|
70 |
-// Info provides information about a particular snapshot. |
|
71 |
-// JSON marshallability is supported for interactive with tools like ctr, |
|
72 |
-type Info struct { |
|
73 |
- Kind Kind // active or committed snapshot |
|
74 |
- Name string // name or key of snapshot |
|
75 |
- Parent string `json:",omitempty"` // name of parent snapshot |
|
76 |
- Labels map[string]string `json:",omitempty"` // Labels for snapshot |
|
77 |
- Created time.Time `json:",omitempty"` // Created time |
|
78 |
- Updated time.Time `json:",omitempty"` // Last update time |
|
79 |
-} |
|
80 |
- |
|
81 |
-// Usage defines statistics for disk resources consumed by the snapshot. |
|
82 |
-// |
|
83 |
-// These resources only include the resources consumed by the snapshot itself |
|
84 |
-// and does not include resources usage by the parent. |
|
85 |
-type Usage struct { |
|
86 |
- Inodes int64 // number of inodes in use. |
|
87 |
- Size int64 // provides usage, in bytes, of snapshot |
|
88 |
-} |
|
89 |
- |
|
90 |
-// Add the provided usage to the current usage |
|
91 |
-func (u *Usage) Add(other Usage) { |
|
92 |
- u.Size += other.Size |
|
93 |
- |
|
94 |
- // TODO(stevvooe): assumes independent inodes, but provides and upper |
|
95 |
- // bound. This should be pretty close, assuming the inodes for a |
|
96 |
- // snapshot are roughly unique to it. Don't trust this assumption. |
|
97 |
- u.Inodes += other.Inodes |
|
98 |
-} |
|
99 |
- |
|
100 |
-// Snapshotter defines the methods required to implement a snapshot snapshotter for |
|
101 |
-// allocating, snapshotting and mounting filesystem changesets. The model works |
|
102 |
-// by building up sets of changes with parent-child relationships. |
|
103 |
-// |
|
104 |
-// A snapshot represents a filesystem state. Every snapshot has a parent, where |
|
105 |
-// the empty parent is represented by the empty string. A diff can be taken |
|
106 |
-// between a parent and its snapshot to generate a classic layer. |
|
107 |
-// |
|
108 |
-// An active snapshot is created by calling `Prepare`. After mounting, changes |
|
109 |
-// can be made to the snapshot. The act of committing creates a committed |
|
110 |
-// snapshot. The committed snapshot will get the parent of active snapshot. The |
|
111 |
-// committed snapshot can then be used as a parent. Active snapshots can never |
|
112 |
-// act as a parent. |
|
113 |
-// |
|
114 |
-// Snapshots are best understood by their lifecycle. Active snapshots are |
|
115 |
-// always created with Prepare or View. Committed snapshots are always created |
|
116 |
-// with Commit. Active snapshots never become committed snapshots and vice |
|
117 |
-// versa. All snapshots may be removed. |
|
118 |
-// |
|
119 |
-// For consistency, we define the following terms to be used throughout this |
|
120 |
-// interface for snapshotter implementations: |
|
121 |
-// |
|
122 |
-// `ctx` - refers to a context.Context |
|
123 |
-// `key` - refers to an active snapshot |
|
124 |
-// `name` - refers to a committed snapshot |
|
125 |
-// `parent` - refers to the parent in relation |
|
126 |
-// |
|
127 |
-// Most methods take various combinations of these identifiers. Typically, |
|
128 |
-// `name` and `parent` will be used in cases where a method *only* takes |
|
129 |
-// committed snapshots. `key` will be used to refer to active snapshots in most |
|
130 |
-// cases, except where noted. All variables used to access snapshots use the |
|
131 |
-// same key space. For example, an active snapshot may not share the same key |
|
132 |
-// with a committed snapshot. |
|
133 |
-// |
|
134 |
-// We cover several examples below to demonstrate the utility of a snapshot |
|
135 |
-// snapshotter. |
|
136 |
-// |
|
137 |
-// Importing a Layer |
|
138 |
-// |
|
139 |
-// To import a layer, we simply have the Snapshotter provide a list of |
|
140 |
-// mounts to be applied such that our dst will capture a changeset. We start |
|
141 |
-// out by getting a path to the layer tar file and creating a temp location to |
|
142 |
-// unpack it to: |
|
143 |
-// |
|
144 |
-// layerPath, tmpDir := getLayerPath(), mkTmpDir() // just a path to layer tar file. |
|
145 |
-// |
|
146 |
-// We start by using a Snapshotter to Prepare a new snapshot transaction, using a |
|
147 |
-// key and descending from the empty parent "": |
|
148 |
-// |
|
149 |
-// mounts, err := snapshotter.Prepare(ctx, key, "") |
|
150 |
-// if err != nil { ... } |
|
151 |
-// |
|
152 |
-// We get back a list of mounts from Snapshotter.Prepare, with the key identifying |
|
153 |
-// the active snapshot. Mount this to the temporary location with the |
|
154 |
-// following: |
|
155 |
-// |
|
156 |
-// if err := mount.All(mounts, tmpDir); err != nil { ... } |
|
157 |
-// |
|
158 |
-// Once the mounts are performed, our temporary location is ready to capture |
|
159 |
-// a diff. In practice, this works similar to a filesystem transaction. The |
|
160 |
-// next step is to unpack the layer. We have a special function unpackLayer |
|
161 |
-// that applies the contents of the layer to target location and calculates the |
|
162 |
-// DiffID of the unpacked layer (this is a requirement for docker |
|
163 |
-// implementation): |
|
164 |
-// |
|
165 |
-// layer, err := os.Open(layerPath) |
|
166 |
-// if err != nil { ... } |
|
167 |
-// digest, err := unpackLayer(tmpLocation, layer) // unpack into layer location |
|
168 |
-// if err != nil { ... } |
|
169 |
-// |
|
170 |
-// When the above completes, we should have a filesystem the represents the |
|
171 |
-// contents of the layer. Careful implementations should verify that digest |
|
172 |
-// matches the expected DiffID. When completed, we unmount the mounts: |
|
173 |
-// |
|
174 |
-// unmount(mounts) // optional, for now |
|
175 |
-// |
|
176 |
-// Now that we've verified and unpacked our layer, we commit the active |
|
177 |
-// snapshot to a name. For this example, we are just going to use the layer |
|
178 |
-// digest, but in practice, this will probably be the ChainID: |
|
179 |
-// |
|
180 |
-// if err := snapshotter.Commit(ctx, digest.String(), key); err != nil { ... } |
|
181 |
-// |
|
182 |
-// Now, we have a layer in the Snapshotter that can be accessed with the digest |
|
183 |
-// provided during commit. Once you have committed the snapshot, the active |
|
184 |
-// snapshot can be removed with the following: |
|
185 |
-// |
|
186 |
-// snapshotter.Remove(ctx, key) |
|
187 |
-// |
|
188 |
-// Importing the Next Layer |
|
189 |
-// |
|
190 |
-// Making a layer depend on the above is identical to the process described |
|
191 |
-// above except that the parent is provided as parent when calling |
|
192 |
-// Manager.Prepare, assuming a clean, unique key identifier: |
|
193 |
-// |
|
194 |
-// mounts, err := snapshotter.Prepare(ctx, key, parentDigest) |
|
195 |
-// |
|
196 |
-// We then mount, apply and commit, as we did above. The new snapshot will be |
|
197 |
-// based on the content of the previous one. |
|
198 |
-// |
|
199 |
-// Running a Container |
|
200 |
-// |
|
201 |
-// To run a container, we simply provide Snapshotter.Prepare the committed image |
|
202 |
-// snapshot as the parent. After mounting, the prepared path can |
|
203 |
-// be used directly as the container's filesystem: |
|
204 |
-// |
|
205 |
-// mounts, err := snapshotter.Prepare(ctx, containerKey, imageRootFSChainID) |
|
206 |
-// |
|
207 |
-// The returned mounts can then be passed directly to the container runtime. If |
|
208 |
-// one would like to create a new image from the filesystem, Manager.Commit is |
|
209 |
-// called: |
|
210 |
-// |
|
211 |
-// if err := snapshotter.Commit(ctx, newImageSnapshot, containerKey); err != nil { ... } |
|
212 |
-// |
|
213 |
-// Alternatively, for most container runs, Snapshotter.Remove will be called to |
|
214 |
-// signal the Snapshotter to abandon the changes. |
|
215 |
-type Snapshotter interface { |
|
216 |
- // Stat returns the info for an active or committed snapshot by name or |
|
217 |
- // key. |
|
218 |
- // |
|
219 |
- // Should be used for parent resolution, existence checks and to discern |
|
220 |
- // the kind of snapshot. |
|
221 |
- Stat(ctx context.Context, key string) (Info, error) |
|
222 |
- |
|
223 |
- // Update updates the info for a snapshot. |
|
224 |
- // |
|
225 |
- // Only mutable properties of a snapshot may be updated. |
|
226 |
- Update(ctx context.Context, info Info, fieldpaths ...string) (Info, error) |
|
227 |
- |
|
228 |
- // Usage returns the resource usage of an active or committed snapshot |
|
229 |
- // excluding the usage of parent snapshots. |
|
230 |
- // |
|
231 |
- // The running time of this call for active snapshots is dependent on |
|
232 |
- // implementation, but may be proportional to the size of the resource. |
|
233 |
- // Callers should take this into consideration. Implementations should |
|
234 |
- // attempt to honer context cancellation and avoid taking locks when making |
|
235 |
- // the calculation. |
|
236 |
- Usage(ctx context.Context, key string) (Usage, error) |
|
237 |
- |
|
238 |
- // Mounts returns the mounts for the active snapshot transaction identified |
|
239 |
- // by key. Can be called on an read-write or readonly transaction. This is |
|
240 |
- // available only for active snapshots. |
|
241 |
- // |
|
242 |
- // This can be used to recover mounts after calling View or Prepare. |
|
243 |
- Mounts(ctx context.Context, key string) ([]mount.Mount, error) |
|
244 |
- |
|
245 |
- // Prepare creates an active snapshot identified by key descending from the |
|
246 |
- // provided parent. The returned mounts can be used to mount the snapshot |
|
247 |
- // to capture changes. |
|
248 |
- // |
|
249 |
- // If a parent is provided, after performing the mounts, the destination |
|
250 |
- // will start with the content of the parent. The parent must be a |
|
251 |
- // committed snapshot. Changes to the mounted destination will be captured |
|
252 |
- // in relation to the parent. The default parent, "", is an empty |
|
253 |
- // directory. |
|
254 |
- // |
|
255 |
- // The changes may be saved to a committed snapshot by calling Commit. When |
|
256 |
- // one is done with the transaction, Remove should be called on the key. |
|
257 |
- // |
|
258 |
- // Multiple calls to Prepare or View with the same key should fail. |
|
259 |
- Prepare(ctx context.Context, key, parent string, opts ...Opt) ([]mount.Mount, error) |
|
260 |
- |
|
261 |
- // View behaves identically to Prepare except the result may not be |
|
262 |
- // committed back to the snapshot snapshotter. View returns a readonly view on |
|
263 |
- // the parent, with the active snapshot being tracked by the given key. |
|
264 |
- // |
|
265 |
- // This method operates identically to Prepare, except that Mounts returned |
|
266 |
- // may have the readonly flag set. Any modifications to the underlying |
|
267 |
- // filesystem will be ignored. Implementations may perform this in a more |
|
268 |
- // efficient manner that differs from what would be attempted with |
|
269 |
- // `Prepare`. |
|
270 |
- // |
|
271 |
- // Commit may not be called on the provided key and will return an error. |
|
272 |
- // To collect the resources associated with key, Remove must be called with |
|
273 |
- // key as the argument. |
|
274 |
- View(ctx context.Context, key, parent string, opts ...Opt) ([]mount.Mount, error) |
|
275 |
- |
|
276 |
- // Commit captures the changes between key and its parent into a snapshot |
|
277 |
- // identified by name. The name can then be used with the snapshotter's other |
|
278 |
- // methods to create subsequent snapshots. |
|
279 |
- // |
|
280 |
- // A committed snapshot will be created under name with the parent of the |
|
281 |
- // active snapshot. |
|
282 |
- // |
|
283 |
- // After commit, the snapshot identified by key is removed. |
|
284 |
- Commit(ctx context.Context, name, key string, opts ...Opt) error |
|
285 |
- |
|
286 |
- // Remove the committed or active snapshot by the provided key. |
|
287 |
- // |
|
288 |
- // All resources associated with the key will be removed. |
|
289 |
- // |
|
290 |
- // If the snapshot is a parent of another snapshot, its children must be |
|
291 |
- // removed before proceeding. |
|
292 |
- Remove(ctx context.Context, key string) error |
|
293 |
- |
|
294 |
- // Walk all snapshots in the snapshotter. For each snapshot in the |
|
295 |
- // snapshotter, the function will be called. |
|
296 |
- Walk(ctx context.Context, fn func(context.Context, Info) error) error |
|
297 |
- |
|
298 |
- // Close releases the internal resources. |
|
299 |
- // |
|
300 |
- // Close is expected to be called on the end of the lifecycle of the snapshotter, |
|
301 |
- // but not mandatory. |
|
302 |
- // |
|
303 |
- // Close returns nil when it is already closed. |
|
304 |
- Close() error |
|
305 |
-} |
|
306 |
- |
|
307 |
-// Opt allows setting mutable snapshot properties on creation |
|
308 |
-type Opt func(info *Info) error |
|
309 |
- |
|
310 |
-// WithLabels adds labels to a created snapshot |
|
311 |
-func WithLabels(labels map[string]string) Opt { |
|
312 |
- return func(info *Info) error { |
|
313 |
- info.Labels = labels |
|
314 |
- return nil |
|
315 |
- } |
|
316 |
-} |
317 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,316 @@ |
0 |
+package snapshots |
|
1 |
+ |
|
2 |
+import ( |
|
3 |
+ "context" |
|
4 |
+ "encoding/json" |
|
5 |
+ "strings" |
|
6 |
+ "time" |
|
7 |
+ |
|
8 |
+ "github.com/containerd/containerd/mount" |
|
9 |
+) |
|
10 |
+ |
|
11 |
+// Kind identifies the kind of snapshot. |
|
12 |
+type Kind uint8 |
|
13 |
+ |
|
14 |
+// definitions of snapshot kinds |
|
15 |
+const ( |
|
16 |
+ KindUnknown Kind = iota |
|
17 |
+ KindView |
|
18 |
+ KindActive |
|
19 |
+ KindCommitted |
|
20 |
+) |
|
21 |
+ |
|
22 |
+// ParseKind parses the provided string into a Kind |
|
23 |
+// |
|
24 |
+// If the string cannot be parsed KindUnknown is returned |
|
25 |
+func ParseKind(s string) Kind { |
|
26 |
+ s = strings.ToLower(s) |
|
27 |
+ switch s { |
|
28 |
+ case "view": |
|
29 |
+ return KindView |
|
30 |
+ case "active": |
|
31 |
+ return KindActive |
|
32 |
+ case "committed": |
|
33 |
+ return KindCommitted |
|
34 |
+ } |
|
35 |
+ |
|
36 |
+ return KindUnknown |
|
37 |
+} |
|
38 |
+ |
|
39 |
+// String returns the string representation of the Kind |
|
40 |
+func (k Kind) String() string { |
|
41 |
+ switch k { |
|
42 |
+ case KindView: |
|
43 |
+ return "View" |
|
44 |
+ case KindActive: |
|
45 |
+ return "Active" |
|
46 |
+ case KindCommitted: |
|
47 |
+ return "Committed" |
|
48 |
+ } |
|
49 |
+ |
|
50 |
+ return "Unknown" |
|
51 |
+} |
|
52 |
+ |
|
53 |
+// MarshalJSON the Kind to JSON |
|
54 |
+func (k Kind) MarshalJSON() ([]byte, error) { |
|
55 |
+ return json.Marshal(k.String()) |
|
56 |
+} |
|
57 |
+ |
|
58 |
+// UnmarshalJSON the Kind from JSON |
|
59 |
+func (k *Kind) UnmarshalJSON(b []byte) error { |
|
60 |
+ var s string |
|
61 |
+ if err := json.Unmarshal(b, &s); err != nil { |
|
62 |
+ return err |
|
63 |
+ } |
|
64 |
+ |
|
65 |
+ *k = ParseKind(s) |
|
66 |
+ return nil |
|
67 |
+} |
|
68 |
+ |
|
69 |
+// Info provides information about a particular snapshot. |
|
70 |
+// JSON marshallability is supported for interactive with tools like ctr, |
|
71 |
+type Info struct { |
|
72 |
+ Kind Kind // active or committed snapshot |
|
73 |
+ Name string // name or key of snapshot |
|
74 |
+ Parent string `json:",omitempty"` // name of parent snapshot |
|
75 |
+ Labels map[string]string `json:",omitempty"` // Labels for snapshot |
|
76 |
+ Created time.Time `json:",omitempty"` // Created time |
|
77 |
+ Updated time.Time `json:",omitempty"` // Last update time |
|
78 |
+} |
|
79 |
+ |
|
80 |
+// Usage defines statistics for disk resources consumed by the snapshot. |
|
81 |
+// |
|
82 |
+// These resources only include the resources consumed by the snapshot itself |
|
83 |
+// and does not include resources usage by the parent. |
|
84 |
+type Usage struct { |
|
85 |
+ Inodes int64 // number of inodes in use. |
|
86 |
+ Size int64 // provides usage, in bytes, of snapshot |
|
87 |
+} |
|
88 |
+ |
|
89 |
+// Add the provided usage to the current usage |
|
90 |
+func (u *Usage) Add(other Usage) { |
|
91 |
+ u.Size += other.Size |
|
92 |
+ |
|
93 |
+ // TODO(stevvooe): assumes independent inodes, but provides and upper |
|
94 |
+ // bound. This should be pretty close, assuming the inodes for a |
|
95 |
+ // snapshot are roughly unique to it. Don't trust this assumption. |
|
96 |
+ u.Inodes += other.Inodes |
|
97 |
+} |
|
98 |
+ |
|
99 |
+// Snapshotter defines the methods required to implement a snapshot snapshotter for |
|
100 |
+// allocating, snapshotting and mounting filesystem changesets. The model works |
|
101 |
+// by building up sets of changes with parent-child relationships. |
|
102 |
+// |
|
103 |
+// A snapshot represents a filesystem state. Every snapshot has a parent, where |
|
104 |
+// the empty parent is represented by the empty string. A diff can be taken |
|
105 |
+// between a parent and its snapshot to generate a classic layer. |
|
106 |
+// |
|
107 |
+// An active snapshot is created by calling `Prepare`. After mounting, changes |
|
108 |
+// can be made to the snapshot. The act of committing creates a committed |
|
109 |
+// snapshot. The committed snapshot will get the parent of active snapshot. The |
|
110 |
+// committed snapshot can then be used as a parent. Active snapshots can never |
|
111 |
+// act as a parent. |
|
112 |
+// |
|
113 |
+// Snapshots are best understood by their lifecycle. Active snapshots are |
|
114 |
+// always created with Prepare or View. Committed snapshots are always created |
|
115 |
+// with Commit. Active snapshots never become committed snapshots and vice |
|
116 |
+// versa. All snapshots may be removed. |
|
117 |
+// |
|
118 |
+// For consistency, we define the following terms to be used throughout this |
|
119 |
+// interface for snapshotter implementations: |
|
120 |
+// |
|
121 |
+// `ctx` - refers to a context.Context |
|
122 |
+// `key` - refers to an active snapshot |
|
123 |
+// `name` - refers to a committed snapshot |
|
124 |
+// `parent` - refers to the parent in relation |
|
125 |
+// |
|
126 |
+// Most methods take various combinations of these identifiers. Typically, |
|
127 |
+// `name` and `parent` will be used in cases where a method *only* takes |
|
128 |
+// committed snapshots. `key` will be used to refer to active snapshots in most |
|
129 |
+// cases, except where noted. All variables used to access snapshots use the |
|
130 |
+// same key space. For example, an active snapshot may not share the same key |
|
131 |
+// with a committed snapshot. |
|
132 |
+// |
|
133 |
+// We cover several examples below to demonstrate the utility of a snapshot |
|
134 |
+// snapshotter. |
|
135 |
+// |
|
136 |
+// Importing a Layer |
|
137 |
+// |
|
138 |
+// To import a layer, we simply have the Snapshotter provide a list of |
|
139 |
+// mounts to be applied such that our dst will capture a changeset. We start |
|
140 |
+// out by getting a path to the layer tar file and creating a temp location to |
|
141 |
+// unpack it to: |
|
142 |
+// |
|
143 |
+// layerPath, tmpDir := getLayerPath(), mkTmpDir() // just a path to layer tar file. |
|
144 |
+// |
|
145 |
+// We start by using a Snapshotter to Prepare a new snapshot transaction, using a |
|
146 |
+// key and descending from the empty parent "": |
|
147 |
+// |
|
148 |
+// mounts, err := snapshotter.Prepare(ctx, key, "") |
|
149 |
+// if err != nil { ... } |
|
150 |
+// |
|
151 |
+// We get back a list of mounts from Snapshotter.Prepare, with the key identifying |
|
152 |
+// the active snapshot. Mount this to the temporary location with the |
|
153 |
+// following: |
|
154 |
+// |
|
155 |
+// if err := mount.All(mounts, tmpDir); err != nil { ... } |
|
156 |
+// |
|
157 |
+// Once the mounts are performed, our temporary location is ready to capture |
|
158 |
+// a diff. In practice, this works similar to a filesystem transaction. The |
|
159 |
+// next step is to unpack the layer. We have a special function unpackLayer |
|
160 |
+// that applies the contents of the layer to target location and calculates the |
|
161 |
+// DiffID of the unpacked layer (this is a requirement for docker |
|
162 |
+// implementation): |
|
163 |
+// |
|
164 |
+// layer, err := os.Open(layerPath) |
|
165 |
+// if err != nil { ... } |
|
166 |
+// digest, err := unpackLayer(tmpLocation, layer) // unpack into layer location |
|
167 |
+// if err != nil { ... } |
|
168 |
+// |
|
169 |
+// When the above completes, we should have a filesystem the represents the |
|
170 |
+// contents of the layer. Careful implementations should verify that digest |
|
171 |
+// matches the expected DiffID. When completed, we unmount the mounts: |
|
172 |
+// |
|
173 |
+// unmount(mounts) // optional, for now |
|
174 |
+// |
|
175 |
+// Now that we've verified and unpacked our layer, we commit the active |
|
176 |
+// snapshot to a name. For this example, we are just going to use the layer |
|
177 |
+// digest, but in practice, this will probably be the ChainID: |
|
178 |
+// |
|
179 |
+// if err := snapshotter.Commit(ctx, digest.String(), key); err != nil { ... } |
|
180 |
+// |
|
181 |
+// Now, we have a layer in the Snapshotter that can be accessed with the digest |
|
182 |
+// provided during commit. Once you have committed the snapshot, the active |
|
183 |
+// snapshot can be removed with the following: |
|
184 |
+// |
|
185 |
+// snapshotter.Remove(ctx, key) |
|
186 |
+// |
|
187 |
+// Importing the Next Layer |
|
188 |
+// |
|
189 |
+// Making a layer depend on the above is identical to the process described |
|
190 |
+// above except that the parent is provided as parent when calling |
|
191 |
+// Manager.Prepare, assuming a clean, unique key identifier: |
|
192 |
+// |
|
193 |
+// mounts, err := snapshotter.Prepare(ctx, key, parentDigest) |
|
194 |
+// |
|
195 |
+// We then mount, apply and commit, as we did above. The new snapshot will be |
|
196 |
+// based on the content of the previous one. |
|
197 |
+// |
|
198 |
+// Running a Container |
|
199 |
+// |
|
200 |
+// To run a container, we simply provide Snapshotter.Prepare the committed image |
|
201 |
+// snapshot as the parent. After mounting, the prepared path can |
|
202 |
+// be used directly as the container's filesystem: |
|
203 |
+// |
|
204 |
+// mounts, err := snapshotter.Prepare(ctx, containerKey, imageRootFSChainID) |
|
205 |
+// |
|
206 |
+// The returned mounts can then be passed directly to the container runtime. If |
|
207 |
+// one would like to create a new image from the filesystem, Manager.Commit is |
|
208 |
+// called: |
|
209 |
+// |
|
210 |
+// if err := snapshotter.Commit(ctx, newImageSnapshot, containerKey); err != nil { ... } |
|
211 |
+// |
|
212 |
+// Alternatively, for most container runs, Snapshotter.Remove will be called to |
|
213 |
+// signal the Snapshotter to abandon the changes. |
|
214 |
+type Snapshotter interface { |
|
215 |
+ // Stat returns the info for an active or committed snapshot by name or |
|
216 |
+ // key. |
|
217 |
+ // |
|
218 |
+ // Should be used for parent resolution, existence checks and to discern |
|
219 |
+ // the kind of snapshot. |
|
220 |
+ Stat(ctx context.Context, key string) (Info, error) |
|
221 |
+ |
|
222 |
+ // Update updates the info for a snapshot. |
|
223 |
+ // |
|
224 |
+ // Only mutable properties of a snapshot may be updated. |
|
225 |
+ Update(ctx context.Context, info Info, fieldpaths ...string) (Info, error) |
|
226 |
+ |
|
227 |
+ // Usage returns the resource usage of an active or committed snapshot |
|
228 |
+ // excluding the usage of parent snapshots. |
|
229 |
+ // |
|
230 |
+ // The running time of this call for active snapshots is dependent on |
|
231 |
+ // implementation, but may be proportional to the size of the resource. |
|
232 |
+ // Callers should take this into consideration. Implementations should |
|
233 |
+ // attempt to honer context cancellation and avoid taking locks when making |
|
234 |
+ // the calculation. |
|
235 |
+ Usage(ctx context.Context, key string) (Usage, error) |
|
236 |
+ |
|
237 |
+ // Mounts returns the mounts for the active snapshot transaction identified |
|
238 |
+ // by key. Can be called on an read-write or readonly transaction. This is |
|
239 |
+ // available only for active snapshots. |
|
240 |
+ // |
|
241 |
+ // This can be used to recover mounts after calling View or Prepare. |
|
242 |
+ Mounts(ctx context.Context, key string) ([]mount.Mount, error) |
|
243 |
+ |
|
244 |
+ // Prepare creates an active snapshot identified by key descending from the |
|
245 |
+ // provided parent. The returned mounts can be used to mount the snapshot |
|
246 |
+ // to capture changes. |
|
247 |
+ // |
|
248 |
+ // If a parent is provided, after performing the mounts, the destination |
|
249 |
+ // will start with the content of the parent. The parent must be a |
|
250 |
+ // committed snapshot. Changes to the mounted destination will be captured |
|
251 |
+ // in relation to the parent. The default parent, "", is an empty |
|
252 |
+ // directory. |
|
253 |
+ // |
|
254 |
+ // The changes may be saved to a committed snapshot by calling Commit. When |
|
255 |
+ // one is done with the transaction, Remove should be called on the key. |
|
256 |
+ // |
|
257 |
+ // Multiple calls to Prepare or View with the same key should fail. |
|
258 |
+ Prepare(ctx context.Context, key, parent string, opts ...Opt) ([]mount.Mount, error) |
|
259 |
+ |
|
260 |
+ // View behaves identically to Prepare except the result may not be |
|
261 |
+ // committed back to the snapshot snapshotter. View returns a readonly view on |
|
262 |
+ // the parent, with the active snapshot being tracked by the given key. |
|
263 |
+ // |
|
264 |
+ // This method operates identically to Prepare, except that Mounts returned |
|
265 |
+ // may have the readonly flag set. Any modifications to the underlying |
|
266 |
+ // filesystem will be ignored. Implementations may perform this in a more |
|
267 |
+ // efficient manner that differs from what would be attempted with |
|
268 |
+ // `Prepare`. |
|
269 |
+ // |
|
270 |
+ // Commit may not be called on the provided key and will return an error. |
|
271 |
+ // To collect the resources associated with key, Remove must be called with |
|
272 |
+ // key as the argument. |
|
273 |
+ View(ctx context.Context, key, parent string, opts ...Opt) ([]mount.Mount, error) |
|
274 |
+ |
|
275 |
+ // Commit captures the changes between key and its parent into a snapshot |
|
276 |
+ // identified by name. The name can then be used with the snapshotter's other |
|
277 |
+ // methods to create subsequent snapshots. |
|
278 |
+ // |
|
279 |
+ // A committed snapshot will be created under name with the parent of the |
|
280 |
+ // active snapshot. |
|
281 |
+ // |
|
282 |
+ // After commit, the snapshot identified by key is removed. |
|
283 |
+ Commit(ctx context.Context, name, key string, opts ...Opt) error |
|
284 |
+ |
|
285 |
+ // Remove the committed or active snapshot by the provided key. |
|
286 |
+ // |
|
287 |
+ // All resources associated with the key will be removed. |
|
288 |
+ // |
|
289 |
+ // If the snapshot is a parent of another snapshot, its children must be |
|
290 |
+ // removed before proceeding. |
|
291 |
+ Remove(ctx context.Context, key string) error |
|
292 |
+ |
|
293 |
+ // Walk all snapshots in the snapshotter. For each snapshot in the |
|
294 |
+ // snapshotter, the function will be called. |
|
295 |
+ Walk(ctx context.Context, fn func(context.Context, Info) error) error |
|
296 |
+ |
|
297 |
+ // Close releases the internal resources. |
|
298 |
+ // |
|
299 |
+ // Close is expected to be called on the end of the lifecycle of the snapshotter, |
|
300 |
+ // but not mandatory. |
|
301 |
+ // |
|
302 |
+ // Close returns nil when it is already closed. |
|
303 |
+ Close() error |
|
304 |
+} |
|
305 |
+ |
|
306 |
+// Opt allows setting mutable snapshot properties on creation |
|
307 |
+type Opt func(info *Info) error |
|
308 |
+ |
|
309 |
+// WithLabels adds labels to a created snapshot |
|
310 |
+func WithLabels(labels map[string]string) Opt { |
|
311 |
+ return func(info *Info) error { |
|
312 |
+ info.Labels = labels |
|
313 |
+ return nil |
|
314 |
+ } |
|
315 |
+} |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6 |
2 | 2 |
github.com/containerd/go-runc ed1cbe1fc31f5fb2359d3a54b6330d1a097858b7 |
3 | 3 |
github.com/containerd/console 84eeaae905fa414d03e07bcd6c8d3f19e7cf180e |
4 |
-github.com/containerd/cgroups f7dd103d3e4e696aa67152f6b4ddd1779a3455a9 |
|
4 |
+github.com/containerd/cgroups 29da22c6171a4316169f9205ab6c49f59b5b852f |
|
5 | 5 |
github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788 |
6 | 6 |
github.com/docker/go-metrics 8fd5772bf1584597834c6f7961a530f06cbfbb87 |
7 | 7 |
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9 |
... | ... |
@@ -41,4 +41,4 @@ github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd |
41 | 41 |
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944 |
42 | 42 |
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4 |
43 | 43 |
github.com/dmcgowan/go-tar go1.10 |
44 |
-github.com/stevvooe/ttrpc bdb2ab7a8169e485e39421e666e15a505e575fd2 |
|
44 |
+github.com/stevvooe/ttrpc 8c92e22ce0c492875ccaac3ab06143a77d8ed0c1 |
... | ... |
@@ -5,13 +5,16 @@ import ( |
5 | 5 |
"context" |
6 | 6 |
"encoding/binary" |
7 | 7 |
"io" |
8 |
+ "sync" |
|
8 | 9 |
|
9 | 10 |
"github.com/pkg/errors" |
11 |
+ "google.golang.org/grpc/codes" |
|
12 |
+ "google.golang.org/grpc/status" |
|
10 | 13 |
) |
11 | 14 |
|
12 | 15 |
const ( |
13 | 16 |
messageHeaderLength = 10 |
14 |
- messageLengthMax = 8 << 10 |
|
17 |
+ messageLengthMax = 4 << 20 |
|
15 | 18 |
) |
16 | 19 |
|
17 | 20 |
type messageType uint8 |
... | ... |
@@ -54,6 +57,8 @@ func writeMessageHeader(w io.Writer, p []byte, mh messageHeader) error { |
54 | 54 |
return err |
55 | 55 |
} |
56 | 56 |
|
57 |
+var buffers sync.Pool |
|
58 |
+ |
|
57 | 59 |
type channel struct { |
58 | 60 |
bw *bufio.Writer |
59 | 61 |
br *bufio.Reader |
... | ... |
@@ -68,21 +73,32 @@ func newChannel(w io.Writer, r io.Reader) *channel { |
68 | 68 |
} |
69 | 69 |
} |
70 | 70 |
|
71 |
-func (ch *channel) recv(ctx context.Context, p []byte) (messageHeader, error) { |
|
71 |
+// recv a message from the channel. The returned buffer contains the message. |
|
72 |
+// |
|
73 |
+// If a valid grpc status is returned, the message header |
|
74 |
+// returned will be valid and caller should send that along to |
|
75 |
+// the correct consumer. The bytes on the underlying channel |
|
76 |
+// will be discarded. |
|
77 |
+func (ch *channel) recv(ctx context.Context) (messageHeader, []byte, error) { |
|
72 | 78 |
mh, err := readMessageHeader(ch.hrbuf[:], ch.br) |
73 | 79 |
if err != nil { |
74 |
- return messageHeader{}, err |
|
80 |
+ return messageHeader{}, nil, err |
|
75 | 81 |
} |
76 | 82 |
|
77 |
- if mh.Length > uint32(len(p)) { |
|
78 |
- return messageHeader{}, errors.Wrapf(io.ErrShortBuffer, "message length %v over buffer size %v", mh.Length, len(p)) |
|
83 |
+ if mh.Length > uint32(messageLengthMax) { |
|
84 |
+ if _, err := ch.br.Discard(int(mh.Length)); err != nil { |
|
85 |
+ return mh, nil, errors.Wrapf(err, "failed to discard after receiving oversized message") |
|
86 |
+ } |
|
87 |
+ |
|
88 |
+ return mh, nil, status.Errorf(codes.ResourceExhausted, "message length %v exceed maximum message size of %v", mh.Length, messageLengthMax) |
|
79 | 89 |
} |
80 | 90 |
|
81 |
- if _, err := io.ReadFull(ch.br, p[:mh.Length]); err != nil { |
|
82 |
- return messageHeader{}, errors.Wrapf(err, "failed reading message") |
|
91 |
+ p := ch.getmbuf(int(mh.Length)) |
|
92 |
+ if _, err := io.ReadFull(ch.br, p); err != nil { |
|
93 |
+ return messageHeader{}, nil, errors.Wrapf(err, "failed reading message") |
|
83 | 94 |
} |
84 | 95 |
|
85 |
- return mh, nil |
|
96 |
+ return mh, p, nil |
|
86 | 97 |
} |
87 | 98 |
|
88 | 99 |
func (ch *channel) send(ctx context.Context, streamID uint32, t messageType, p []byte) error { |
... | ... |
@@ -97,3 +113,23 @@ func (ch *channel) send(ctx context.Context, streamID uint32, t messageType, p [ |
97 | 97 |
|
98 | 98 |
return ch.bw.Flush() |
99 | 99 |
} |
100 |
+ |
|
101 |
+func (ch *channel) getmbuf(size int) []byte { |
|
102 |
+ // we can't use the standard New method on pool because we want to allocate |
|
103 |
+ // based on size. |
|
104 |
+ b, ok := buffers.Get().(*[]byte) |
|
105 |
+ if !ok || cap(*b) < size { |
|
106 |
+ // TODO(stevvooe): It may be better to allocate these in fixed length |
|
107 |
+ // buckets to reduce fragmentation but its not clear that would help |
|
108 |
+ // with performance. An ilogb approach or similar would work well. |
|
109 |
+ bb := make([]byte, size) |
|
110 |
+ b = &bb |
|
111 |
+ } else { |
|
112 |
+ *b = (*b)[:size] |
|
113 |
+ } |
|
114 |
+ return *b |
|
115 |
+} |
|
116 |
+ |
|
117 |
+func (ch *channel) putmbuf(p []byte) { |
|
118 |
+ buffers.Put(&p) |
|
119 |
+} |
... | ... |
@@ -4,19 +4,18 @@ import ( |
4 | 4 |
"context" |
5 | 5 |
"net" |
6 | 6 |
"sync" |
7 |
- "sync/atomic" |
|
8 | 7 |
|
8 |
+ "github.com/containerd/containerd/log" |
|
9 | 9 |
"github.com/gogo/protobuf/proto" |
10 | 10 |
"github.com/pkg/errors" |
11 | 11 |
"google.golang.org/grpc/status" |
12 | 12 |
) |
13 | 13 |
|
14 | 14 |
type Client struct { |
15 |
- codec codec |
|
16 |
- channel *channel |
|
17 |
- requestID uint32 |
|
18 |
- sendRequests chan sendRequest |
|
19 |
- recvRequests chan recvRequest |
|
15 |
+ codec codec |
|
16 |
+ conn net.Conn |
|
17 |
+ channel *channel |
|
18 |
+ calls chan *callRequest |
|
20 | 19 |
|
21 | 20 |
closed chan struct{} |
22 | 21 |
closeOnce sync.Once |
... | ... |
@@ -26,78 +25,66 @@ type Client struct { |
26 | 26 |
|
27 | 27 |
func NewClient(conn net.Conn) *Client { |
28 | 28 |
c := &Client{ |
29 |
- codec: codec{}, |
|
30 |
- requestID: 1, |
|
31 |
- channel: newChannel(conn, conn), |
|
32 |
- sendRequests: make(chan sendRequest), |
|
33 |
- recvRequests: make(chan recvRequest), |
|
34 |
- closed: make(chan struct{}), |
|
35 |
- done: make(chan struct{}), |
|
29 |
+ codec: codec{}, |
|
30 |
+ conn: conn, |
|
31 |
+ channel: newChannel(conn, conn), |
|
32 |
+ calls: make(chan *callRequest), |
|
33 |
+ closed: make(chan struct{}), |
|
34 |
+ done: make(chan struct{}), |
|
36 | 35 |
} |
37 | 36 |
|
38 | 37 |
go c.run() |
39 | 38 |
return c |
40 | 39 |
} |
41 | 40 |
|
41 |
+type callRequest struct { |
|
42 |
+ ctx context.Context |
|
43 |
+ req *Request |
|
44 |
+ resp *Response // response will be written back here |
|
45 |
+ errs chan error // error written here on completion |
|
46 |
+} |
|
47 |
+ |
|
42 | 48 |
func (c *Client) Call(ctx context.Context, service, method string, req, resp interface{}) error { |
43 | 49 |
payload, err := c.codec.Marshal(req) |
44 | 50 |
if err != nil { |
45 | 51 |
return err |
46 | 52 |
} |
47 | 53 |
|
48 |
- requestID := atomic.AddUint32(&c.requestID, 2) |
|
49 |
- request := Request{ |
|
50 |
- Service: service, |
|
51 |
- Method: method, |
|
52 |
- Payload: payload, |
|
53 |
- } |
|
54 |
+ var ( |
|
55 |
+ creq = &Request{ |
|
56 |
+ Service: service, |
|
57 |
+ Method: method, |
|
58 |
+ Payload: payload, |
|
59 |
+ } |
|
54 | 60 |
|
55 |
- if err := c.send(ctx, requestID, &request); err != nil { |
|
56 |
- return err |
|
57 |
- } |
|
61 |
+ cresp = &Response{} |
|
62 |
+ ) |
|
58 | 63 |
|
59 |
- var response Response |
|
60 |
- if err := c.recv(ctx, requestID, &response); err != nil { |
|
64 |
+ if err := c.dispatch(ctx, creq, cresp); err != nil { |
|
61 | 65 |
return err |
62 | 66 |
} |
63 | 67 |
|
64 |
- if err := c.codec.Unmarshal(response.Payload, resp); err != nil { |
|
68 |
+ if err := c.codec.Unmarshal(cresp.Payload, resp); err != nil { |
|
65 | 69 |
return err |
66 | 70 |
} |
67 | 71 |
|
68 |
- if response.Status == nil { |
|
72 |
+ if cresp.Status == nil { |
|
69 | 73 |
return errors.New("no status provided on response") |
70 | 74 |
} |
71 | 75 |
|
72 |
- return status.ErrorProto(response.Status) |
|
73 |
-} |
|
74 |
- |
|
75 |
-func (c *Client) Close() error { |
|
76 |
- c.closeOnce.Do(func() { |
|
77 |
- close(c.closed) |
|
78 |
- }) |
|
79 |
- |
|
80 |
- return nil |
|
81 |
-} |
|
82 |
- |
|
83 |
-type sendRequest struct { |
|
84 |
- ctx context.Context |
|
85 |
- id uint32 |
|
86 |
- msg interface{} |
|
87 |
- err chan error |
|
76 |
+ return status.ErrorProto(cresp.Status) |
|
88 | 77 |
} |
89 | 78 |
|
90 |
-func (c *Client) send(ctx context.Context, id uint32, msg interface{}) error { |
|
79 |
+func (c *Client) dispatch(ctx context.Context, req *Request, resp *Response) error { |
|
91 | 80 |
errs := make(chan error, 1) |
81 |
+ call := &callRequest{ |
|
82 |
+ req: req, |
|
83 |
+ resp: resp, |
|
84 |
+ errs: errs, |
|
85 |
+ } |
|
86 |
+ |
|
92 | 87 |
select { |
93 |
- case c.sendRequests <- sendRequest{ |
|
94 |
- ctx: ctx, |
|
95 |
- id: id, |
|
96 |
- msg: msg, |
|
97 |
- err: errs, |
|
98 |
- }: |
|
99 |
- case <-ctx.Done(): |
|
100 |
- return ctx.Err() |
|
88 |
+ case c.calls <- call: |
|
101 | 89 |
case <-c.done: |
102 | 90 |
return c.err |
103 | 91 |
} |
... | ... |
@@ -105,67 +92,55 @@ func (c *Client) send(ctx context.Context, id uint32, msg interface{}) error { |
105 | 105 |
select { |
106 | 106 |
case err := <-errs: |
107 | 107 |
return err |
108 |
- case <-ctx.Done(): |
|
109 |
- return ctx.Err() |
|
110 | 108 |
case <-c.done: |
111 | 109 |
return c.err |
112 | 110 |
} |
113 | 111 |
} |
114 | 112 |
|
115 |
-type recvRequest struct { |
|
116 |
- id uint32 |
|
117 |
- msg interface{} |
|
118 |
- err chan error |
|
119 |
-} |
|
120 |
- |
|
121 |
-func (c *Client) recv(ctx context.Context, id uint32, msg interface{}) error { |
|
122 |
- errs := make(chan error, 1) |
|
123 |
- select { |
|
124 |
- case c.recvRequests <- recvRequest{ |
|
125 |
- id: id, |
|
126 |
- msg: msg, |
|
127 |
- err: errs, |
|
128 |
- }: |
|
129 |
- case <-c.done: |
|
130 |
- return c.err |
|
131 |
- case <-ctx.Done(): |
|
132 |
- return ctx.Err() |
|
133 |
- } |
|
113 |
+func (c *Client) Close() error { |
|
114 |
+ c.closeOnce.Do(func() { |
|
115 |
+ close(c.closed) |
|
116 |
+ }) |
|
134 | 117 |
|
135 |
- select { |
|
136 |
- case err := <-errs: |
|
137 |
- return err |
|
138 |
- case <-c.done: |
|
139 |
- return c.err |
|
140 |
- case <-ctx.Done(): |
|
141 |
- return ctx.Err() |
|
142 |
- } |
|
118 |
+ return nil |
|
143 | 119 |
} |
144 | 120 |
|
145 |
-type received struct { |
|
146 |
- mh messageHeader |
|
121 |
+type message struct { |
|
122 |
+ messageHeader |
|
147 | 123 |
p []byte |
148 | 124 |
err error |
149 | 125 |
} |
150 | 126 |
|
151 | 127 |
func (c *Client) run() { |
152 |
- defer close(c.done) |
|
153 | 128 |
var ( |
154 |
- waiters = map[uint32]recvRequest{} |
|
155 |
- queued = map[uint32]received{} // messages unmatched by waiter |
|
156 |
- incoming = make(chan received) |
|
129 |
+ streamID uint32 = 1 |
|
130 |
+ waiters = make(map[uint32]*callRequest) |
|
131 |
+ calls = c.calls |
|
132 |
+ incoming = make(chan *message) |
|
133 |
+ shutdown = make(chan struct{}) |
|
134 |
+ shutdownErr error |
|
157 | 135 |
) |
158 | 136 |
|
159 | 137 |
go func() { |
138 |
+ defer close(shutdown) |
|
139 |
+ |
|
160 | 140 |
// start one more goroutine to recv messages without blocking. |
161 | 141 |
for { |
162 |
- var p [messageLengthMax]byte |
|
163 |
- mh, err := c.channel.recv(context.TODO(), p[:]) |
|
142 |
+ mh, p, err := c.channel.recv(context.TODO()) |
|
143 |
+ if err != nil { |
|
144 |
+ _, ok := status.FromError(err) |
|
145 |
+ if !ok { |
|
146 |
+ // treat all errors that are not an rpc status as terminal. |
|
147 |
+ // all others poison the connection. |
|
148 |
+ shutdownErr = err |
|
149 |
+ return |
|
150 |
+ } |
|
151 |
+ } |
|
164 | 152 |
select { |
165 |
- case incoming <- received{ |
|
166 |
- mh: mh, |
|
167 |
- p: p[:mh.Length], |
|
168 |
- err: err, |
|
153 |
+ case incoming <- &message{ |
|
154 |
+ messageHeader: mh, |
|
155 |
+ p: p[:mh.Length], |
|
156 |
+ err: err, |
|
169 | 157 |
}: |
170 | 158 |
case <-c.done: |
171 | 159 |
return |
... | ... |
@@ -173,32 +148,64 @@ func (c *Client) run() { |
173 | 173 |
} |
174 | 174 |
}() |
175 | 175 |
|
176 |
+ defer c.conn.Close() |
|
177 |
+ defer close(c.done) |
|
178 |
+ |
|
176 | 179 |
for { |
177 | 180 |
select { |
178 |
- case req := <-c.sendRequests: |
|
179 |
- if p, err := proto.Marshal(req.msg.(proto.Message)); err != nil { |
|
180 |
- req.err <- err |
|
181 |
- } else { |
|
182 |
- req.err <- c.channel.send(req.ctx, req.id, messageTypeRequest, p) |
|
183 |
- } |
|
184 |
- case req := <-c.recvRequests: |
|
185 |
- if r, ok := queued[req.id]; ok { |
|
186 |
- req.err <- proto.Unmarshal(r.p, req.msg.(proto.Message)) |
|
181 |
+ case call := <-calls: |
|
182 |
+ if err := c.send(call.ctx, streamID, messageTypeRequest, call.req); err != nil { |
|
183 |
+ call.errs <- err |
|
184 |
+ continue |
|
187 | 185 |
} |
188 |
- waiters[req.id] = req |
|
189 |
- case r := <-incoming: |
|
190 |
- if r.err != nil { |
|
191 |
- c.err = r.err |
|
192 |
- return |
|
186 |
+ |
|
187 |
+ waiters[streamID] = call |
|
188 |
+ streamID += 2 // enforce odd client initiated request ids |
|
189 |
+ case msg := <-incoming: |
|
190 |
+ call, ok := waiters[msg.StreamID] |
|
191 |
+ if !ok { |
|
192 |
+ log.L.Errorf("ttrpc: received message for unknown channel %v", msg.StreamID) |
|
193 |
+ continue |
|
193 | 194 |
} |
194 | 195 |
|
195 |
- if waiter, ok := waiters[r.mh.StreamID]; ok { |
|
196 |
- waiter.err <- proto.Unmarshal(r.p, waiter.msg.(proto.Message)) |
|
197 |
- } else { |
|
198 |
- queued[r.mh.StreamID] = r |
|
196 |
+ call.errs <- c.recv(call.resp, msg) |
|
197 |
+ delete(waiters, msg.StreamID) |
|
198 |
+ case <-shutdown: |
|
199 |
+ shutdownErr = errors.Wrapf(shutdownErr, "ttrpc: client shutting down") |
|
200 |
+ c.err = shutdownErr |
|
201 |
+ for _, waiter := range waiters { |
|
202 |
+ waiter.errs <- shutdownErr |
|
199 | 203 |
} |
204 |
+ c.Close() |
|
205 |
+ return |
|
200 | 206 |
case <-c.closed: |
207 |
+ // broadcast the shutdown error to the remaining waiters. |
|
208 |
+ for _, waiter := range waiters { |
|
209 |
+ waiter.errs <- shutdownErr |
|
210 |
+ } |
|
201 | 211 |
return |
202 | 212 |
} |
203 | 213 |
} |
204 | 214 |
} |
215 |
+ |
|
216 |
+func (c *Client) send(ctx context.Context, streamID uint32, mtype messageType, msg interface{}) error { |
|
217 |
+ p, err := c.codec.Marshal(msg) |
|
218 |
+ if err != nil { |
|
219 |
+ return err |
|
220 |
+ } |
|
221 |
+ |
|
222 |
+ return c.channel.send(ctx, streamID, mtype, p) |
|
223 |
+} |
|
224 |
+ |
|
225 |
+func (c *Client) recv(resp *Response, msg *message) error { |
|
226 |
+ if msg.err != nil { |
|
227 |
+ return msg.err |
|
228 |
+ } |
|
229 |
+ |
|
230 |
+ if msg.Type != messageTypeResponse { |
|
231 |
+ return errors.New("unkown message type received") |
|
232 |
+ } |
|
233 |
+ |
|
234 |
+ defer c.channel.putmbuf(msg.p) |
|
235 |
+ return proto.Unmarshal(msg.p, resp) |
|
236 |
+} |
... | ... |
@@ -2,21 +2,38 @@ package ttrpc |
2 | 2 |
|
3 | 3 |
import ( |
4 | 4 |
"context" |
5 |
+ "math/rand" |
|
5 | 6 |
"net" |
7 |
+ "sync" |
|
8 |
+ "sync/atomic" |
|
9 |
+ "time" |
|
6 | 10 |
|
7 | 11 |
"github.com/containerd/containerd/log" |
12 |
+ "github.com/pkg/errors" |
|
8 | 13 |
"google.golang.org/grpc/codes" |
9 | 14 |
"google.golang.org/grpc/status" |
10 | 15 |
) |
11 | 16 |
|
17 |
+var ( |
|
18 |
+ ErrServerClosed = errors.New("ttrpc: server close") |
|
19 |
+) |
|
20 |
+ |
|
12 | 21 |
type Server struct { |
13 | 22 |
services *serviceSet |
14 | 23 |
codec codec |
24 |
+ |
|
25 |
+ mu sync.Mutex |
|
26 |
+ listeners map[net.Listener]struct{} |
|
27 |
+ connections map[*serverConn]struct{} // all connections to current state |
|
28 |
+ done chan struct{} // marks point at which we stop serving requests |
|
15 | 29 |
} |
16 | 30 |
|
17 | 31 |
func NewServer() *Server { |
18 | 32 |
return &Server{ |
19 |
- services: newServiceSet(), |
|
33 |
+ services: newServiceSet(), |
|
34 |
+ done: make(chan struct{}), |
|
35 |
+ listeners: make(map[net.Listener]struct{}), |
|
36 |
+ connections: make(map[*serverConn]struct{}), |
|
20 | 37 |
} |
21 | 38 |
} |
22 | 39 |
|
... | ... |
@@ -24,28 +41,208 @@ func (s *Server) Register(name string, methods map[string]Method) { |
24 | 24 |
s.services.register(name, methods) |
25 | 25 |
} |
26 | 26 |
|
27 |
-func (s *Server) Shutdown(ctx context.Context) error { |
|
28 |
- // TODO(stevvooe): Wait on connection shutdown. |
|
29 |
- return nil |
|
30 |
-} |
|
31 |
- |
|
32 | 27 |
func (s *Server) Serve(l net.Listener) error { |
28 |
+ s.addListener(l) |
|
29 |
+ defer s.closeListener(l) |
|
30 |
+ |
|
31 |
+ var ( |
|
32 |
+ ctx = context.Background() |
|
33 |
+ backoff time.Duration |
|
34 |
+ ) |
|
35 |
+ |
|
33 | 36 |
for { |
34 | 37 |
conn, err := l.Accept() |
35 | 38 |
if err != nil { |
36 |
- log.L.WithError(err).Error("failed accept") |
|
39 |
+ select { |
|
40 |
+ case <-s.done: |
|
41 |
+ return ErrServerClosed |
|
42 |
+ default: |
|
43 |
+ } |
|
44 |
+ |
|
45 |
+ if terr, ok := err.(interface { |
|
46 |
+ Temporary() bool |
|
47 |
+ }); ok && terr.Temporary() { |
|
48 |
+ if backoff == 0 { |
|
49 |
+ backoff = time.Millisecond |
|
50 |
+ } else { |
|
51 |
+ backoff *= 2 |
|
52 |
+ } |
|
53 |
+ |
|
54 |
+ if max := time.Second; backoff > max { |
|
55 |
+ backoff = max |
|
56 |
+ } |
|
57 |
+ |
|
58 |
+ sleep := time.Duration(rand.Int63n(int64(backoff))) |
|
59 |
+ log.L.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep) |
|
60 |
+ time.Sleep(sleep) |
|
61 |
+ continue |
|
62 |
+ } |
|
63 |
+ |
|
64 |
+ return err |
|
65 |
+ } |
|
66 |
+ |
|
67 |
+ backoff = 0 |
|
68 |
+ sc := s.newConn(conn) |
|
69 |
+ go sc.run(ctx) |
|
70 |
+ } |
|
71 |
+} |
|
72 |
+ |
|
73 |
+func (s *Server) Shutdown(ctx context.Context) error { |
|
74 |
+ s.mu.Lock() |
|
75 |
+ lnerr := s.closeListeners() |
|
76 |
+ select { |
|
77 |
+ case <-s.done: |
|
78 |
+ default: |
|
79 |
+ // protected by mutex |
|
80 |
+ close(s.done) |
|
81 |
+ } |
|
82 |
+ s.mu.Unlock() |
|
83 |
+ |
|
84 |
+ ticker := time.NewTicker(200 * time.Millisecond) |
|
85 |
+ defer ticker.Stop() |
|
86 |
+ for { |
|
87 |
+ if s.closeIdleConns() { |
|
88 |
+ return lnerr |
|
89 |
+ } |
|
90 |
+ select { |
|
91 |
+ case <-ctx.Done(): |
|
92 |
+ return ctx.Err() |
|
93 |
+ case <-ticker.C: |
|
94 |
+ } |
|
95 |
+ } |
|
96 |
+} |
|
97 |
+ |
|
98 |
+// Close the server without waiting for active connections. |
|
99 |
+func (s *Server) Close() error { |
|
100 |
+ s.mu.Lock() |
|
101 |
+ defer s.mu.Unlock() |
|
102 |
+ |
|
103 |
+ select { |
|
104 |
+ case <-s.done: |
|
105 |
+ default: |
|
106 |
+ // protected by mutex |
|
107 |
+ close(s.done) |
|
108 |
+ } |
|
109 |
+ |
|
110 |
+ err := s.closeListeners() |
|
111 |
+ for c := range s.connections { |
|
112 |
+ c.close() |
|
113 |
+ delete(s.connections, c) |
|
114 |
+ } |
|
115 |
+ |
|
116 |
+ return err |
|
117 |
+} |
|
118 |
+ |
|
119 |
+func (s *Server) addListener(l net.Listener) { |
|
120 |
+ s.mu.Lock() |
|
121 |
+ defer s.mu.Unlock() |
|
122 |
+ s.listeners[l] = struct{}{} |
|
123 |
+} |
|
124 |
+ |
|
125 |
+func (s *Server) closeListener(l net.Listener) error { |
|
126 |
+ s.mu.Lock() |
|
127 |
+ defer s.mu.Unlock() |
|
128 |
+ |
|
129 |
+ return s.closeListenerLocked(l) |
|
130 |
+} |
|
131 |
+ |
|
132 |
+func (s *Server) closeListenerLocked(l net.Listener) error { |
|
133 |
+ defer delete(s.listeners, l) |
|
134 |
+ return l.Close() |
|
135 |
+} |
|
136 |
+ |
|
137 |
+func (s *Server) closeListeners() error { |
|
138 |
+ var err error |
|
139 |
+ for l := range s.listeners { |
|
140 |
+ if cerr := s.closeListenerLocked(l); cerr != nil && err == nil { |
|
141 |
+ err = cerr |
|
142 |
+ } |
|
143 |
+ } |
|
144 |
+ return err |
|
145 |
+} |
|
146 |
+ |
|
147 |
+func (s *Server) addConnection(c *serverConn) { |
|
148 |
+ s.mu.Lock() |
|
149 |
+ defer s.mu.Unlock() |
|
150 |
+ |
|
151 |
+ s.connections[c] = struct{}{} |
|
152 |
+} |
|
153 |
+ |
|
154 |
+func (s *Server) closeIdleConns() bool { |
|
155 |
+ s.mu.Lock() |
|
156 |
+ defer s.mu.Unlock() |
|
157 |
+ quiescent := true |
|
158 |
+ for c := range s.connections { |
|
159 |
+ st, ok := c.getState() |
|
160 |
+ if !ok || st != connStateIdle { |
|
161 |
+ quiescent = false |
|
37 | 162 |
continue |
38 | 163 |
} |
164 |
+ c.close() |
|
165 |
+ delete(s.connections, c) |
|
166 |
+ } |
|
167 |
+ return quiescent |
|
168 |
+} |
|
169 |
+ |
|
170 |
+type connState int |
|
171 |
+ |
|
172 |
+const ( |
|
173 |
+ connStateActive = iota + 1 // outstanding requests |
|
174 |
+ connStateIdle // no requests |
|
175 |
+ connStateClosed // closed connection |
|
176 |
+) |
|
39 | 177 |
|
40 |
- go s.handleConn(conn) |
|
178 |
+func (cs connState) String() string { |
|
179 |
+ switch cs { |
|
180 |
+ case connStateActive: |
|
181 |
+ return "active" |
|
182 |
+ case connStateIdle: |
|
183 |
+ return "idle" |
|
184 |
+ case connStateClosed: |
|
185 |
+ return "closed" |
|
186 |
+ default: |
|
187 |
+ return "unknown" |
|
41 | 188 |
} |
189 |
+} |
|
42 | 190 |
|
43 |
- return nil |
|
191 |
+func (s *Server) newConn(conn net.Conn) *serverConn { |
|
192 |
+ c := &serverConn{ |
|
193 |
+ server: s, |
|
194 |
+ conn: conn, |
|
195 |
+ shutdown: make(chan struct{}), |
|
196 |
+ } |
|
197 |
+ c.setState(connStateIdle) |
|
198 |
+ s.addConnection(c) |
|
199 |
+ return c |
|
200 |
+} |
|
201 |
+ |
|
202 |
+type serverConn struct { |
|
203 |
+ server *Server |
|
204 |
+ conn net.Conn |
|
205 |
+ state atomic.Value |
|
206 |
+ |
|
207 |
+ shutdownOnce sync.Once |
|
208 |
+ shutdown chan struct{} // forced shutdown, used by close |
|
209 |
+} |
|
210 |
+ |
|
211 |
+func (c *serverConn) getState() (connState, bool) { |
|
212 |
+ cs, ok := c.state.Load().(connState) |
|
213 |
+ return cs, ok |
|
214 |
+} |
|
215 |
+ |
|
216 |
+func (c *serverConn) setState(newstate connState) { |
|
217 |
+ c.state.Store(newstate) |
|
44 | 218 |
} |
45 | 219 |
|
46 |
-func (s *Server) handleConn(conn net.Conn) { |
|
47 |
- defer conn.Close() |
|
220 |
+func (c *serverConn) close() error { |
|
221 |
+ c.shutdownOnce.Do(func() { |
|
222 |
+ close(c.shutdown) |
|
223 |
+ }) |
|
48 | 224 |
|
225 |
+ return nil |
|
226 |
+} |
|
227 |
+ |
|
228 |
+func (c *serverConn) run(sctx context.Context) { |
|
49 | 229 |
type ( |
50 | 230 |
request struct { |
51 | 231 |
id uint32 |
... | ... |
@@ -59,25 +256,66 @@ func (s *Server) handleConn(conn net.Conn) { |
59 | 59 |
) |
60 | 60 |
|
61 | 61 |
var ( |
62 |
- ch = newChannel(conn, conn) |
|
63 |
- ctx, cancel = context.WithCancel(context.Background()) |
|
64 |
- responses = make(chan response) |
|
65 |
- requests = make(chan request) |
|
66 |
- recvErr = make(chan error, 1) |
|
67 |
- done = make(chan struct{}) |
|
62 |
+ ch = newChannel(c.conn, c.conn) |
|
63 |
+ ctx, cancel = context.WithCancel(sctx) |
|
64 |
+ active int |
|
65 |
+ state connState = connStateIdle |
|
66 |
+ responses = make(chan response) |
|
67 |
+ requests = make(chan request) |
|
68 |
+ recvErr = make(chan error, 1) |
|
69 |
+ shutdown = c.shutdown |
|
70 |
+ done = make(chan struct{}) |
|
68 | 71 |
) |
69 | 72 |
|
73 |
+ defer c.conn.Close() |
|
70 | 74 |
defer cancel() |
71 | 75 |
defer close(done) |
72 | 76 |
|
73 |
- go func() { |
|
77 |
+ go func(recvErr chan error) { |
|
74 | 78 |
defer close(recvErr) |
75 |
- var p [messageLengthMax]byte |
|
79 |
+ sendImmediate := func(id uint32, st *status.Status) bool { |
|
80 |
+ select { |
|
81 |
+ case responses <- response{ |
|
82 |
+ // even though we've had an invalid stream id, we send it |
|
83 |
+ // back on the same stream id so the client knows which |
|
84 |
+ // stream id was bad. |
|
85 |
+ id: id, |
|
86 |
+ resp: &Response{ |
|
87 |
+ Status: st.Proto(), |
|
88 |
+ }, |
|
89 |
+ }: |
|
90 |
+ return true |
|
91 |
+ case <-c.shutdown: |
|
92 |
+ return false |
|
93 |
+ case <-done: |
|
94 |
+ return false |
|
95 |
+ } |
|
96 |
+ } |
|
97 |
+ |
|
76 | 98 |
for { |
77 |
- mh, err := ch.recv(ctx, p[:]) |
|
78 |
- if err != nil { |
|
79 |
- recvErr <- err |
|
99 |
+ select { |
|
100 |
+ case <-c.shutdown: |
|
80 | 101 |
return |
102 |
+ case <-done: |
|
103 |
+ return |
|
104 |
+ default: // proceed |
|
105 |
+ } |
|
106 |
+ |
|
107 |
+ mh, p, err := ch.recv(ctx) |
|
108 |
+ if err != nil { |
|
109 |
+ status, ok := status.FromError(err) |
|
110 |
+ if !ok { |
|
111 |
+ recvErr <- err |
|
112 |
+ return |
|
113 |
+ } |
|
114 |
+ |
|
115 |
+ // in this case, we send an error for that particular message |
|
116 |
+ // when the status is defined. |
|
117 |
+ if !sendImmediate(mh.StreamID, status) { |
|
118 |
+ return |
|
119 |
+ } |
|
120 |
+ |
|
121 |
+ continue |
|
81 | 122 |
} |
82 | 123 |
|
83 | 124 |
if mh.Type != messageTypeRequest { |
... | ... |
@@ -86,44 +324,57 @@ func (s *Server) handleConn(conn net.Conn) { |
86 | 86 |
} |
87 | 87 |
|
88 | 88 |
var req Request |
89 |
- if err := s.codec.Unmarshal(p[:mh.Length], &req); err != nil { |
|
90 |
- recvErr <- err |
|
91 |
- return |
|
89 |
+ if err := c.server.codec.Unmarshal(p, &req); err != nil { |
|
90 |
+ ch.putmbuf(p) |
|
91 |
+ if !sendImmediate(mh.StreamID, status.Newf(codes.InvalidArgument, "unmarshal request error: %v", err)) { |
|
92 |
+ return |
|
93 |
+ } |
|
94 |
+ continue |
|
92 | 95 |
} |
96 |
+ ch.putmbuf(p) |
|
93 | 97 |
|
94 | 98 |
if mh.StreamID%2 != 1 { |
95 | 99 |
// enforce odd client initiated identifiers. |
96 |
- select { |
|
97 |
- case responses <- response{ |
|
98 |
- // even though we've had an invalid stream id, we send it |
|
99 |
- // back on the same stream id so the client knows which |
|
100 |
- // stream id was bad. |
|
101 |
- id: mh.StreamID, |
|
102 |
- resp: &Response{ |
|
103 |
- Status: status.New(codes.InvalidArgument, "StreamID must be odd for client initiated streams").Proto(), |
|
104 |
- }, |
|
105 |
- }: |
|
106 |
- case <-done: |
|
100 |
+ if !sendImmediate(mh.StreamID, status.Newf(codes.InvalidArgument, "StreamID must be odd for client initiated streams")) { |
|
101 |
+ return |
|
107 | 102 |
} |
108 |
- |
|
109 | 103 |
continue |
110 | 104 |
} |
111 | 105 |
|
106 |
+ // Forward the request to the main loop. We don't wait on s.done |
|
107 |
+ // because we have already accepted the client request. |
|
112 | 108 |
select { |
113 | 109 |
case requests <- request{ |
114 | 110 |
id: mh.StreamID, |
115 | 111 |
req: &req, |
116 | 112 |
}: |
117 | 113 |
case <-done: |
114 |
+ return |
|
118 | 115 |
} |
119 | 116 |
} |
120 |
- }() |
|
117 |
+ }(recvErr) |
|
121 | 118 |
|
122 | 119 |
for { |
120 |
+ newstate := state |
|
121 |
+ switch { |
|
122 |
+ case active > 0: |
|
123 |
+ newstate = connStateActive |
|
124 |
+ shutdown = nil |
|
125 |
+ case active == 0: |
|
126 |
+ newstate = connStateIdle |
|
127 |
+ shutdown = c.shutdown // only enable this branch in idle mode |
|
128 |
+ } |
|
129 |
+ |
|
130 |
+ if newstate != state { |
|
131 |
+ c.setState(newstate) |
|
132 |
+ state = newstate |
|
133 |
+ } |
|
134 |
+ |
|
123 | 135 |
select { |
124 | 136 |
case request := <-requests: |
137 |
+ active++ |
|
125 | 138 |
go func(id uint32) { |
126 |
- p, status := s.services.call(ctx, request.req.Service, request.req.Method, request.req.Payload) |
|
139 |
+ p, status := c.server.services.call(ctx, request.req.Service, request.req.Method, request.req.Payload) |
|
127 | 140 |
resp := &Response{ |
128 | 141 |
Status: status.Proto(), |
129 | 142 |
Payload: p, |
... | ... |
@@ -138,17 +389,27 @@ func (s *Server) handleConn(conn net.Conn) { |
138 | 138 |
} |
139 | 139 |
}(request.id) |
140 | 140 |
case response := <-responses: |
141 |
- p, err := s.codec.Marshal(response.resp) |
|
141 |
+ p, err := c.server.codec.Marshal(response.resp) |
|
142 | 142 |
if err != nil { |
143 | 143 |
log.L.WithError(err).Error("failed marshaling response") |
144 | 144 |
return |
145 | 145 |
} |
146 |
+ |
|
146 | 147 |
if err := ch.send(ctx, response.id, messageTypeResponse, p); err != nil { |
147 | 148 |
log.L.WithError(err).Error("failed sending message on channel") |
148 | 149 |
return |
149 | 150 |
} |
151 |
+ |
|
152 |
+ active-- |
|
150 | 153 |
case err := <-recvErr: |
151 |
- log.L.WithError(err).Error("error receiving message") |
|
154 |
+ // TODO(stevvooe): Not wildly clear what we should do in this |
|
155 |
+ // branch. Basically, it means that we are no longer receiving |
|
156 |
+ // requests due to a terminal error. |
|
157 |
+ recvErr = nil // connection is now "closing" |
|
158 |
+ if err != nil { |
|
159 |
+ log.L.WithError(err).Error("error receiving message") |
|
160 |
+ } |
|
161 |
+ case <-shutdown: |
|
152 | 162 |
return |
153 | 163 |
} |
154 | 164 |
} |