diff.pb.go 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: github.com/containerd/containerd/api/services/diff/v1/diff.proto
  3. package diff
  4. import (
  5. context "context"
  6. fmt "fmt"
  7. types "github.com/containerd/containerd/api/types"
  8. proto "github.com/gogo/protobuf/proto"
  9. github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
  10. types1 "github.com/gogo/protobuf/types"
  11. grpc "google.golang.org/grpc"
  12. codes "google.golang.org/grpc/codes"
  13. status "google.golang.org/grpc/status"
  14. io "io"
  15. math "math"
  16. math_bits "math/bits"
  17. reflect "reflect"
  18. strings "strings"
  19. )
  20. // Reference imports to suppress errors if they are not otherwise used.
  21. var _ = proto.Marshal
  22. var _ = fmt.Errorf
  23. var _ = math.Inf
  24. // This is a compile-time assertion to ensure that this generated file
  25. // is compatible with the proto package it is being compiled against.
  26. // A compilation error at this line likely means your copy of the
  27. // proto package needs to be updated.
  28. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  29. type ApplyRequest struct {
  30. // Diff is the descriptor of the diff to be extracted
  31. Diff *types.Descriptor `protobuf:"bytes,1,opt,name=diff,proto3" json:"diff,omitempty"`
  32. Mounts []*types.Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"`
  33. Payloads map[string]*types1.Any `protobuf:"bytes,3,rep,name=payloads,proto3" json:"payloads,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  34. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  35. XXX_unrecognized []byte `json:"-"`
  36. XXX_sizecache int32 `json:"-"`
  37. }
  38. func (m *ApplyRequest) Reset() { *m = ApplyRequest{} }
  39. func (*ApplyRequest) ProtoMessage() {}
  40. func (*ApplyRequest) Descriptor() ([]byte, []int) {
  41. return fileDescriptor_3b36a99e6faaa935, []int{0}
  42. }
  43. func (m *ApplyRequest) XXX_Unmarshal(b []byte) error {
  44. return m.Unmarshal(b)
  45. }
  46. func (m *ApplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  47. if deterministic {
  48. return xxx_messageInfo_ApplyRequest.Marshal(b, m, deterministic)
  49. } else {
  50. b = b[:cap(b)]
  51. n, err := m.MarshalToSizedBuffer(b)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return b[:n], nil
  56. }
  57. }
  58. func (m *ApplyRequest) XXX_Merge(src proto.Message) {
  59. xxx_messageInfo_ApplyRequest.Merge(m, src)
  60. }
  61. func (m *ApplyRequest) XXX_Size() int {
  62. return m.Size()
  63. }
  64. func (m *ApplyRequest) XXX_DiscardUnknown() {
  65. xxx_messageInfo_ApplyRequest.DiscardUnknown(m)
  66. }
  67. var xxx_messageInfo_ApplyRequest proto.InternalMessageInfo
  68. type ApplyResponse struct {
  69. // Applied is the descriptor for the object which was applied.
  70. // If the input was a compressed blob then the result will be
  71. // the descriptor for the uncompressed blob.
  72. Applied *types.Descriptor `protobuf:"bytes,1,opt,name=applied,proto3" json:"applied,omitempty"`
  73. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  74. XXX_unrecognized []byte `json:"-"`
  75. XXX_sizecache int32 `json:"-"`
  76. }
  77. func (m *ApplyResponse) Reset() { *m = ApplyResponse{} }
  78. func (*ApplyResponse) ProtoMessage() {}
  79. func (*ApplyResponse) Descriptor() ([]byte, []int) {
  80. return fileDescriptor_3b36a99e6faaa935, []int{1}
  81. }
  82. func (m *ApplyResponse) XXX_Unmarshal(b []byte) error {
  83. return m.Unmarshal(b)
  84. }
  85. func (m *ApplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  86. if deterministic {
  87. return xxx_messageInfo_ApplyResponse.Marshal(b, m, deterministic)
  88. } else {
  89. b = b[:cap(b)]
  90. n, err := m.MarshalToSizedBuffer(b)
  91. if err != nil {
  92. return nil, err
  93. }
  94. return b[:n], nil
  95. }
  96. }
  97. func (m *ApplyResponse) XXX_Merge(src proto.Message) {
  98. xxx_messageInfo_ApplyResponse.Merge(m, src)
  99. }
  100. func (m *ApplyResponse) XXX_Size() int {
  101. return m.Size()
  102. }
  103. func (m *ApplyResponse) XXX_DiscardUnknown() {
  104. xxx_messageInfo_ApplyResponse.DiscardUnknown(m)
  105. }
  106. var xxx_messageInfo_ApplyResponse proto.InternalMessageInfo
  107. type DiffRequest struct {
  108. // Left are the mounts which represent the older copy
  109. // in which is the base of the computed changes.
  110. Left []*types.Mount `protobuf:"bytes,1,rep,name=left,proto3" json:"left,omitempty"`
  111. // Right are the mounts which represents the newer copy
  112. // in which changes from the left were made into.
  113. Right []*types.Mount `protobuf:"bytes,2,rep,name=right,proto3" json:"right,omitempty"`
  114. // MediaType is the media type descriptor for the created diff
  115. // object
  116. MediaType string `protobuf:"bytes,3,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
  117. // Ref identifies the pre-commit content store object. This
  118. // reference can be used to get the status from the content store.
  119. Ref string `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
  120. // Labels are the labels to apply to the generated content
  121. // on content store commit.
  122. Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  123. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  124. XXX_unrecognized []byte `json:"-"`
  125. XXX_sizecache int32 `json:"-"`
  126. }
  127. func (m *DiffRequest) Reset() { *m = DiffRequest{} }
  128. func (*DiffRequest) ProtoMessage() {}
  129. func (*DiffRequest) Descriptor() ([]byte, []int) {
  130. return fileDescriptor_3b36a99e6faaa935, []int{2}
  131. }
  132. func (m *DiffRequest) XXX_Unmarshal(b []byte) error {
  133. return m.Unmarshal(b)
  134. }
  135. func (m *DiffRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  136. if deterministic {
  137. return xxx_messageInfo_DiffRequest.Marshal(b, m, deterministic)
  138. } else {
  139. b = b[:cap(b)]
  140. n, err := m.MarshalToSizedBuffer(b)
  141. if err != nil {
  142. return nil, err
  143. }
  144. return b[:n], nil
  145. }
  146. }
  147. func (m *DiffRequest) XXX_Merge(src proto.Message) {
  148. xxx_messageInfo_DiffRequest.Merge(m, src)
  149. }
  150. func (m *DiffRequest) XXX_Size() int {
  151. return m.Size()
  152. }
  153. func (m *DiffRequest) XXX_DiscardUnknown() {
  154. xxx_messageInfo_DiffRequest.DiscardUnknown(m)
  155. }
  156. var xxx_messageInfo_DiffRequest proto.InternalMessageInfo
  157. type DiffResponse struct {
  158. // Diff is the descriptor of the diff which can be applied
  159. Diff *types.Descriptor `protobuf:"bytes,3,opt,name=diff,proto3" json:"diff,omitempty"`
  160. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  161. XXX_unrecognized []byte `json:"-"`
  162. XXX_sizecache int32 `json:"-"`
  163. }
  164. func (m *DiffResponse) Reset() { *m = DiffResponse{} }
  165. func (*DiffResponse) ProtoMessage() {}
  166. func (*DiffResponse) Descriptor() ([]byte, []int) {
  167. return fileDescriptor_3b36a99e6faaa935, []int{3}
  168. }
  169. func (m *DiffResponse) XXX_Unmarshal(b []byte) error {
  170. return m.Unmarshal(b)
  171. }
  172. func (m *DiffResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  173. if deterministic {
  174. return xxx_messageInfo_DiffResponse.Marshal(b, m, deterministic)
  175. } else {
  176. b = b[:cap(b)]
  177. n, err := m.MarshalToSizedBuffer(b)
  178. if err != nil {
  179. return nil, err
  180. }
  181. return b[:n], nil
  182. }
  183. }
  184. func (m *DiffResponse) XXX_Merge(src proto.Message) {
  185. xxx_messageInfo_DiffResponse.Merge(m, src)
  186. }
  187. func (m *DiffResponse) XXX_Size() int {
  188. return m.Size()
  189. }
  190. func (m *DiffResponse) XXX_DiscardUnknown() {
  191. xxx_messageInfo_DiffResponse.DiscardUnknown(m)
  192. }
  193. var xxx_messageInfo_DiffResponse proto.InternalMessageInfo
  194. func init() {
  195. proto.RegisterType((*ApplyRequest)(nil), "containerd.services.diff.v1.ApplyRequest")
  196. proto.RegisterMapType((map[string]*types1.Any)(nil), "containerd.services.diff.v1.ApplyRequest.PayloadsEntry")
  197. proto.RegisterType((*ApplyResponse)(nil), "containerd.services.diff.v1.ApplyResponse")
  198. proto.RegisterType((*DiffRequest)(nil), "containerd.services.diff.v1.DiffRequest")
  199. proto.RegisterMapType((map[string]string)(nil), "containerd.services.diff.v1.DiffRequest.LabelsEntry")
  200. proto.RegisterType((*DiffResponse)(nil), "containerd.services.diff.v1.DiffResponse")
  201. }
  202. func init() {
  203. proto.RegisterFile("github.com/containerd/containerd/api/services/diff/v1/diff.proto", fileDescriptor_3b36a99e6faaa935)
  204. }
  205. var fileDescriptor_3b36a99e6faaa935 = []byte{
  206. // 526 bytes of a gzipped FileDescriptorProto
  207. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6f, 0xd3, 0x4c,
  208. 0x10, 0x8d, 0xed, 0x24, 0xdf, 0x97, 0x49, 0x2b, 0xa1, 0x55, 0x24, 0x8c, 0x01, 0xab, 0xca, 0x29,
  209. 0x2d, 0x62, 0x4d, 0x03, 0x2a, 0xd0, 0x5e, 0x5a, 0x54, 0xc4, 0xa5, 0x48, 0x60, 0x7a, 0x40, 0x20,
  210. 0x81, 0x9c, 0x78, 0xed, 0xae, 0x70, 0xbc, 0x8b, 0x77, 0x1d, 0xc9, 0x37, 0xfe, 0x06, 0x67, 0x7e,
  211. 0x0a, 0x97, 0x1e, 0x39, 0x72, 0xa4, 0xf9, 0x25, 0xc8, 0xeb, 0x75, 0x31, 0x02, 0x05, 0xc3, 0xc9,
  212. 0x9b, 0x9d, 0xf7, 0xde, 0xce, 0xbc, 0x37, 0x0a, 0x1c, 0xc6, 0x54, 0x9e, 0xe5, 0x33, 0x3c, 0x67,
  213. 0x0b, 0x6f, 0xce, 0x52, 0x19, 0xd0, 0x94, 0x64, 0x61, 0xf3, 0x18, 0x70, 0xea, 0x09, 0x92, 0x2d,
  214. 0xe9, 0x9c, 0x08, 0x2f, 0xa4, 0x51, 0xe4, 0x2d, 0x77, 0xd5, 0x17, 0xf3, 0x8c, 0x49, 0x86, 0xae,
  215. 0xff, 0xc0, 0xe2, 0x1a, 0x87, 0x55, 0x7d, 0xb9, 0xeb, 0x8c, 0x62, 0x16, 0x33, 0x85, 0xf3, 0xca,
  216. 0x53, 0x45, 0x71, 0xae, 0xc5, 0x8c, 0xc5, 0x09, 0xf1, 0xd4, 0xaf, 0x59, 0x1e, 0x79, 0x41, 0x5a,
  217. 0xe8, 0xd2, 0x5e, 0xab, 0x7e, 0x64, 0xc1, 0x89, 0xf0, 0x16, 0x2c, 0x4f, 0xa5, 0xe6, 0x1d, 0xfc,
  218. 0x05, 0x2f, 0x24, 0x62, 0x9e, 0x51, 0x2e, 0x59, 0x56, 0x91, 0xc7, 0x1f, 0x4d, 0xd8, 0x38, 0xe2,
  219. 0x3c, 0x29, 0x7c, 0xf2, 0x3e, 0x27, 0x42, 0xa2, 0x3b, 0xd0, 0x2d, 0x27, 0xb0, 0x8d, 0x2d, 0x63,
  220. 0x32, 0x9c, 0xde, 0xc0, 0x8d, 0x11, 0x95, 0x04, 0x3e, 0xbe, 0x94, 0xf0, 0x15, 0x12, 0x79, 0xd0,
  221. 0x57, 0xed, 0x08, 0xdb, 0xdc, 0xb2, 0x26, 0xc3, 0xe9, 0xd5, 0x5f, 0x39, 0x4f, 0xcb, 0xba, 0xaf,
  222. 0x61, 0xe8, 0x05, 0xfc, 0xcf, 0x83, 0x22, 0x61, 0x41, 0x28, 0x6c, 0x4b, 0x51, 0xee, 0xe3, 0x35,
  223. 0x4e, 0xe2, 0x66, 0x7f, 0xf8, 0x99, 0x66, 0x3e, 0x4e, 0x65, 0x56, 0xf8, 0x97, 0x42, 0xce, 0x73,
  224. 0xd8, 0xfc, 0xa9, 0x84, 0xae, 0x80, 0xf5, 0x8e, 0x14, 0x6a, 0x8e, 0x81, 0x5f, 0x1e, 0xd1, 0x0e,
  225. 0xf4, 0x96, 0x41, 0x92, 0x13, 0xdb, 0x54, 0xb3, 0x8d, 0x70, 0x95, 0x05, 0xae, 0xb3, 0xc0, 0x47,
  226. 0x69, 0xe1, 0x57, 0x90, 0x7d, 0xf3, 0x81, 0x31, 0x7e, 0x02, 0x9b, 0xfa, 0x69, 0xc1, 0x59, 0x2a,
  227. 0x08, 0xda, 0x83, 0xff, 0x02, 0xce, 0x13, 0x4a, 0xc2, 0x56, 0xf6, 0xd4, 0xe0, 0xf1, 0x27, 0x13,
  228. 0x86, 0xc7, 0x34, 0x8a, 0x6a, 0x8f, 0x6f, 0x41, 0x37, 0x21, 0x91, 0xb4, 0x8d, 0xf5, 0x7e, 0x29,
  229. 0x10, 0xba, 0x0d, 0xbd, 0x8c, 0xc6, 0x67, 0xf2, 0x4f, 0xee, 0x56, 0x28, 0x74, 0x13, 0x60, 0x41,
  230. 0x42, 0x1a, 0xbc, 0x2d, 0x6b, 0xb6, 0xa5, 0xa6, 0x1f, 0xa8, 0x9b, 0xd3, 0x82, 0x93, 0xd2, 0x95,
  231. 0x8c, 0x44, 0x76, 0xb7, 0x72, 0x25, 0x23, 0x11, 0x3a, 0x81, 0x7e, 0x12, 0xcc, 0x48, 0x22, 0xec,
  232. 0x9e, 0x7a, 0xe0, 0xde, 0xda, 0x2c, 0x1a, 0x63, 0xe0, 0x13, 0x45, 0xab, 0x82, 0xd0, 0x1a, 0xce,
  233. 0x43, 0x18, 0x36, 0xae, 0x7f, 0x13, 0xc2, 0xa8, 0x19, 0xc2, 0xa0, 0x69, 0xf7, 0x21, 0x6c, 0x54,
  234. 0xea, 0xda, 0xed, 0x7a, 0x13, 0xad, 0xb6, 0x9b, 0x38, 0xfd, 0x6c, 0x40, 0xb7, 0x94, 0x40, 0x6f,
  235. 0xa0, 0xa7, 0x92, 0x43, 0xdb, 0xad, 0x17, 0xcb, 0xd9, 0x69, 0x03, 0xd5, 0xad, 0xbd, 0xd6, 0xef,
  236. 0x4c, 0xda, 0x7a, 0xe5, 0x6c, 0xb7, 0x40, 0x56, 0xe2, 0x8f, 0x4e, 0xcf, 0x2f, 0xdc, 0xce, 0xd7,
  237. 0x0b, 0xb7, 0xf3, 0x61, 0xe5, 0x1a, 0xe7, 0x2b, 0xd7, 0xf8, 0xb2, 0x72, 0x8d, 0x6f, 0x2b, 0xd7,
  238. 0x78, 0xb5, 0xff, 0x4f, 0xff, 0x58, 0x07, 0xe5, 0xf7, 0x65, 0x67, 0xd6, 0x57, 0x7b, 0x7e, 0xf7,
  239. 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x85, 0x25, 0xb8, 0xf8, 0x04, 0x00, 0x00,
  240. }
  241. // Reference imports to suppress errors if they are not otherwise used.
  242. var _ context.Context
  243. var _ grpc.ClientConn
  244. // This is a compile-time assertion to ensure that this generated file
  245. // is compatible with the grpc package it is being compiled against.
  246. const _ = grpc.SupportPackageIsVersion4
  247. // DiffClient is the client API for Diff service.
  248. //
  249. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  250. type DiffClient interface {
  251. // Apply applies the content associated with the provided digests onto
  252. // the provided mounts. Archive content will be extracted and
  253. // decompressed if necessary.
  254. Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error)
  255. // Diff creates a diff between the given mounts and uploads the result
  256. // to the content store.
  257. Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error)
  258. }
  259. type diffClient struct {
  260. cc *grpc.ClientConn
  261. }
  262. func NewDiffClient(cc *grpc.ClientConn) DiffClient {
  263. return &diffClient{cc}
  264. }
  265. func (c *diffClient) Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) {
  266. out := new(ApplyResponse)
  267. err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Apply", in, out, opts...)
  268. if err != nil {
  269. return nil, err
  270. }
  271. return out, nil
  272. }
  273. func (c *diffClient) Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) {
  274. out := new(DiffResponse)
  275. err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Diff", in, out, opts...)
  276. if err != nil {
  277. return nil, err
  278. }
  279. return out, nil
  280. }
  281. // DiffServer is the server API for Diff service.
  282. type DiffServer interface {
  283. // Apply applies the content associated with the provided digests onto
  284. // the provided mounts. Archive content will be extracted and
  285. // decompressed if necessary.
  286. Apply(context.Context, *ApplyRequest) (*ApplyResponse, error)
  287. // Diff creates a diff between the given mounts and uploads the result
  288. // to the content store.
  289. Diff(context.Context, *DiffRequest) (*DiffResponse, error)
  290. }
  291. // UnimplementedDiffServer can be embedded to have forward compatible implementations.
  292. type UnimplementedDiffServer struct {
  293. }
  294. func (*UnimplementedDiffServer) Apply(ctx context.Context, req *ApplyRequest) (*ApplyResponse, error) {
  295. return nil, status.Errorf(codes.Unimplemented, "method Apply not implemented")
  296. }
  297. func (*UnimplementedDiffServer) Diff(ctx context.Context, req *DiffRequest) (*DiffResponse, error) {
  298. return nil, status.Errorf(codes.Unimplemented, "method Diff not implemented")
  299. }
  300. func RegisterDiffServer(s *grpc.Server, srv DiffServer) {
  301. s.RegisterService(&_Diff_serviceDesc, srv)
  302. }
  303. func _Diff_Apply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  304. in := new(ApplyRequest)
  305. if err := dec(in); err != nil {
  306. return nil, err
  307. }
  308. if interceptor == nil {
  309. return srv.(DiffServer).Apply(ctx, in)
  310. }
  311. info := &grpc.UnaryServerInfo{
  312. Server: srv,
  313. FullMethod: "/containerd.services.diff.v1.Diff/Apply",
  314. }
  315. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  316. return srv.(DiffServer).Apply(ctx, req.(*ApplyRequest))
  317. }
  318. return interceptor(ctx, in, info, handler)
  319. }
  320. func _Diff_Diff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  321. in := new(DiffRequest)
  322. if err := dec(in); err != nil {
  323. return nil, err
  324. }
  325. if interceptor == nil {
  326. return srv.(DiffServer).Diff(ctx, in)
  327. }
  328. info := &grpc.UnaryServerInfo{
  329. Server: srv,
  330. FullMethod: "/containerd.services.diff.v1.Diff/Diff",
  331. }
  332. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  333. return srv.(DiffServer).Diff(ctx, req.(*DiffRequest))
  334. }
  335. return interceptor(ctx, in, info, handler)
  336. }
  337. var _Diff_serviceDesc = grpc.ServiceDesc{
  338. ServiceName: "containerd.services.diff.v1.Diff",
  339. HandlerType: (*DiffServer)(nil),
  340. Methods: []grpc.MethodDesc{
  341. {
  342. MethodName: "Apply",
  343. Handler: _Diff_Apply_Handler,
  344. },
  345. {
  346. MethodName: "Diff",
  347. Handler: _Diff_Diff_Handler,
  348. },
  349. },
  350. Streams: []grpc.StreamDesc{},
  351. Metadata: "github.com/containerd/containerd/api/services/diff/v1/diff.proto",
  352. }
  353. func (m *ApplyRequest) Marshal() (dAtA []byte, err error) {
  354. size := m.Size()
  355. dAtA = make([]byte, size)
  356. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  357. if err != nil {
  358. return nil, err
  359. }
  360. return dAtA[:n], nil
  361. }
  362. func (m *ApplyRequest) MarshalTo(dAtA []byte) (int, error) {
  363. size := m.Size()
  364. return m.MarshalToSizedBuffer(dAtA[:size])
  365. }
  366. func (m *ApplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  367. i := len(dAtA)
  368. _ = i
  369. var l int
  370. _ = l
  371. if m.XXX_unrecognized != nil {
  372. i -= len(m.XXX_unrecognized)
  373. copy(dAtA[i:], m.XXX_unrecognized)
  374. }
  375. if len(m.Payloads) > 0 {
  376. for k := range m.Payloads {
  377. v := m.Payloads[k]
  378. baseI := i
  379. if v != nil {
  380. {
  381. size, err := v.MarshalToSizedBuffer(dAtA[:i])
  382. if err != nil {
  383. return 0, err
  384. }
  385. i -= size
  386. i = encodeVarintDiff(dAtA, i, uint64(size))
  387. }
  388. i--
  389. dAtA[i] = 0x12
  390. }
  391. i -= len(k)
  392. copy(dAtA[i:], k)
  393. i = encodeVarintDiff(dAtA, i, uint64(len(k)))
  394. i--
  395. dAtA[i] = 0xa
  396. i = encodeVarintDiff(dAtA, i, uint64(baseI-i))
  397. i--
  398. dAtA[i] = 0x1a
  399. }
  400. }
  401. if len(m.Mounts) > 0 {
  402. for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- {
  403. {
  404. size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  405. if err != nil {
  406. return 0, err
  407. }
  408. i -= size
  409. i = encodeVarintDiff(dAtA, i, uint64(size))
  410. }
  411. i--
  412. dAtA[i] = 0x12
  413. }
  414. }
  415. if m.Diff != nil {
  416. {
  417. size, err := m.Diff.MarshalToSizedBuffer(dAtA[:i])
  418. if err != nil {
  419. return 0, err
  420. }
  421. i -= size
  422. i = encodeVarintDiff(dAtA, i, uint64(size))
  423. }
  424. i--
  425. dAtA[i] = 0xa
  426. }
  427. return len(dAtA) - i, nil
  428. }
  429. func (m *ApplyResponse) Marshal() (dAtA []byte, err error) {
  430. size := m.Size()
  431. dAtA = make([]byte, size)
  432. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  433. if err != nil {
  434. return nil, err
  435. }
  436. return dAtA[:n], nil
  437. }
  438. func (m *ApplyResponse) MarshalTo(dAtA []byte) (int, error) {
  439. size := m.Size()
  440. return m.MarshalToSizedBuffer(dAtA[:size])
  441. }
  442. func (m *ApplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  443. i := len(dAtA)
  444. _ = i
  445. var l int
  446. _ = l
  447. if m.XXX_unrecognized != nil {
  448. i -= len(m.XXX_unrecognized)
  449. copy(dAtA[i:], m.XXX_unrecognized)
  450. }
  451. if m.Applied != nil {
  452. {
  453. size, err := m.Applied.MarshalToSizedBuffer(dAtA[:i])
  454. if err != nil {
  455. return 0, err
  456. }
  457. i -= size
  458. i = encodeVarintDiff(dAtA, i, uint64(size))
  459. }
  460. i--
  461. dAtA[i] = 0xa
  462. }
  463. return len(dAtA) - i, nil
  464. }
  465. func (m *DiffRequest) Marshal() (dAtA []byte, err error) {
  466. size := m.Size()
  467. dAtA = make([]byte, size)
  468. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  469. if err != nil {
  470. return nil, err
  471. }
  472. return dAtA[:n], nil
  473. }
  474. func (m *DiffRequest) MarshalTo(dAtA []byte) (int, error) {
  475. size := m.Size()
  476. return m.MarshalToSizedBuffer(dAtA[:size])
  477. }
  478. func (m *DiffRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  479. i := len(dAtA)
  480. _ = i
  481. var l int
  482. _ = l
  483. if m.XXX_unrecognized != nil {
  484. i -= len(m.XXX_unrecognized)
  485. copy(dAtA[i:], m.XXX_unrecognized)
  486. }
  487. if len(m.Labels) > 0 {
  488. for k := range m.Labels {
  489. v := m.Labels[k]
  490. baseI := i
  491. i -= len(v)
  492. copy(dAtA[i:], v)
  493. i = encodeVarintDiff(dAtA, i, uint64(len(v)))
  494. i--
  495. dAtA[i] = 0x12
  496. i -= len(k)
  497. copy(dAtA[i:], k)
  498. i = encodeVarintDiff(dAtA, i, uint64(len(k)))
  499. i--
  500. dAtA[i] = 0xa
  501. i = encodeVarintDiff(dAtA, i, uint64(baseI-i))
  502. i--
  503. dAtA[i] = 0x2a
  504. }
  505. }
  506. if len(m.Ref) > 0 {
  507. i -= len(m.Ref)
  508. copy(dAtA[i:], m.Ref)
  509. i = encodeVarintDiff(dAtA, i, uint64(len(m.Ref)))
  510. i--
  511. dAtA[i] = 0x22
  512. }
  513. if len(m.MediaType) > 0 {
  514. i -= len(m.MediaType)
  515. copy(dAtA[i:], m.MediaType)
  516. i = encodeVarintDiff(dAtA, i, uint64(len(m.MediaType)))
  517. i--
  518. dAtA[i] = 0x1a
  519. }
  520. if len(m.Right) > 0 {
  521. for iNdEx := len(m.Right) - 1; iNdEx >= 0; iNdEx-- {
  522. {
  523. size, err := m.Right[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  524. if err != nil {
  525. return 0, err
  526. }
  527. i -= size
  528. i = encodeVarintDiff(dAtA, i, uint64(size))
  529. }
  530. i--
  531. dAtA[i] = 0x12
  532. }
  533. }
  534. if len(m.Left) > 0 {
  535. for iNdEx := len(m.Left) - 1; iNdEx >= 0; iNdEx-- {
  536. {
  537. size, err := m.Left[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  538. if err != nil {
  539. return 0, err
  540. }
  541. i -= size
  542. i = encodeVarintDiff(dAtA, i, uint64(size))
  543. }
  544. i--
  545. dAtA[i] = 0xa
  546. }
  547. }
  548. return len(dAtA) - i, nil
  549. }
  550. func (m *DiffResponse) Marshal() (dAtA []byte, err error) {
  551. size := m.Size()
  552. dAtA = make([]byte, size)
  553. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  554. if err != nil {
  555. return nil, err
  556. }
  557. return dAtA[:n], nil
  558. }
  559. func (m *DiffResponse) MarshalTo(dAtA []byte) (int, error) {
  560. size := m.Size()
  561. return m.MarshalToSizedBuffer(dAtA[:size])
  562. }
  563. func (m *DiffResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  564. i := len(dAtA)
  565. _ = i
  566. var l int
  567. _ = l
  568. if m.XXX_unrecognized != nil {
  569. i -= len(m.XXX_unrecognized)
  570. copy(dAtA[i:], m.XXX_unrecognized)
  571. }
  572. if m.Diff != nil {
  573. {
  574. size, err := m.Diff.MarshalToSizedBuffer(dAtA[:i])
  575. if err != nil {
  576. return 0, err
  577. }
  578. i -= size
  579. i = encodeVarintDiff(dAtA, i, uint64(size))
  580. }
  581. i--
  582. dAtA[i] = 0x1a
  583. }
  584. return len(dAtA) - i, nil
  585. }
  586. func encodeVarintDiff(dAtA []byte, offset int, v uint64) int {
  587. offset -= sovDiff(v)
  588. base := offset
  589. for v >= 1<<7 {
  590. dAtA[offset] = uint8(v&0x7f | 0x80)
  591. v >>= 7
  592. offset++
  593. }
  594. dAtA[offset] = uint8(v)
  595. return base
  596. }
  597. func (m *ApplyRequest) Size() (n int) {
  598. if m == nil {
  599. return 0
  600. }
  601. var l int
  602. _ = l
  603. if m.Diff != nil {
  604. l = m.Diff.Size()
  605. n += 1 + l + sovDiff(uint64(l))
  606. }
  607. if len(m.Mounts) > 0 {
  608. for _, e := range m.Mounts {
  609. l = e.Size()
  610. n += 1 + l + sovDiff(uint64(l))
  611. }
  612. }
  613. if len(m.Payloads) > 0 {
  614. for k, v := range m.Payloads {
  615. _ = k
  616. _ = v
  617. l = 0
  618. if v != nil {
  619. l = v.Size()
  620. l += 1 + sovDiff(uint64(l))
  621. }
  622. mapEntrySize := 1 + len(k) + sovDiff(uint64(len(k))) + l
  623. n += mapEntrySize + 1 + sovDiff(uint64(mapEntrySize))
  624. }
  625. }
  626. if m.XXX_unrecognized != nil {
  627. n += len(m.XXX_unrecognized)
  628. }
  629. return n
  630. }
  631. func (m *ApplyResponse) Size() (n int) {
  632. if m == nil {
  633. return 0
  634. }
  635. var l int
  636. _ = l
  637. if m.Applied != nil {
  638. l = m.Applied.Size()
  639. n += 1 + l + sovDiff(uint64(l))
  640. }
  641. if m.XXX_unrecognized != nil {
  642. n += len(m.XXX_unrecognized)
  643. }
  644. return n
  645. }
  646. func (m *DiffRequest) Size() (n int) {
  647. if m == nil {
  648. return 0
  649. }
  650. var l int
  651. _ = l
  652. if len(m.Left) > 0 {
  653. for _, e := range m.Left {
  654. l = e.Size()
  655. n += 1 + l + sovDiff(uint64(l))
  656. }
  657. }
  658. if len(m.Right) > 0 {
  659. for _, e := range m.Right {
  660. l = e.Size()
  661. n += 1 + l + sovDiff(uint64(l))
  662. }
  663. }
  664. l = len(m.MediaType)
  665. if l > 0 {
  666. n += 1 + l + sovDiff(uint64(l))
  667. }
  668. l = len(m.Ref)
  669. if l > 0 {
  670. n += 1 + l + sovDiff(uint64(l))
  671. }
  672. if len(m.Labels) > 0 {
  673. for k, v := range m.Labels {
  674. _ = k
  675. _ = v
  676. mapEntrySize := 1 + len(k) + sovDiff(uint64(len(k))) + 1 + len(v) + sovDiff(uint64(len(v)))
  677. n += mapEntrySize + 1 + sovDiff(uint64(mapEntrySize))
  678. }
  679. }
  680. if m.XXX_unrecognized != nil {
  681. n += len(m.XXX_unrecognized)
  682. }
  683. return n
  684. }
  685. func (m *DiffResponse) Size() (n int) {
  686. if m == nil {
  687. return 0
  688. }
  689. var l int
  690. _ = l
  691. if m.Diff != nil {
  692. l = m.Diff.Size()
  693. n += 1 + l + sovDiff(uint64(l))
  694. }
  695. if m.XXX_unrecognized != nil {
  696. n += len(m.XXX_unrecognized)
  697. }
  698. return n
  699. }
  700. func sovDiff(x uint64) (n int) {
  701. return (math_bits.Len64(x|1) + 6) / 7
  702. }
  703. func sozDiff(x uint64) (n int) {
  704. return sovDiff(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  705. }
  706. func (this *ApplyRequest) String() string {
  707. if this == nil {
  708. return "nil"
  709. }
  710. repeatedStringForMounts := "[]*Mount{"
  711. for _, f := range this.Mounts {
  712. repeatedStringForMounts += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
  713. }
  714. repeatedStringForMounts += "}"
  715. keysForPayloads := make([]string, 0, len(this.Payloads))
  716. for k, _ := range this.Payloads {
  717. keysForPayloads = append(keysForPayloads, k)
  718. }
  719. github_com_gogo_protobuf_sortkeys.Strings(keysForPayloads)
  720. mapStringForPayloads := "map[string]*types1.Any{"
  721. for _, k := range keysForPayloads {
  722. mapStringForPayloads += fmt.Sprintf("%v: %v,", k, this.Payloads[k])
  723. }
  724. mapStringForPayloads += "}"
  725. s := strings.Join([]string{`&ApplyRequest{`,
  726. `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "types.Descriptor", 1) + `,`,
  727. `Mounts:` + repeatedStringForMounts + `,`,
  728. `Payloads:` + mapStringForPayloads + `,`,
  729. `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
  730. `}`,
  731. }, "")
  732. return s
  733. }
  734. func (this *ApplyResponse) String() string {
  735. if this == nil {
  736. return "nil"
  737. }
  738. s := strings.Join([]string{`&ApplyResponse{`,
  739. `Applied:` + strings.Replace(fmt.Sprintf("%v", this.Applied), "Descriptor", "types.Descriptor", 1) + `,`,
  740. `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
  741. `}`,
  742. }, "")
  743. return s
  744. }
  745. func (this *DiffRequest) String() string {
  746. if this == nil {
  747. return "nil"
  748. }
  749. repeatedStringForLeft := "[]*Mount{"
  750. for _, f := range this.Left {
  751. repeatedStringForLeft += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
  752. }
  753. repeatedStringForLeft += "}"
  754. repeatedStringForRight := "[]*Mount{"
  755. for _, f := range this.Right {
  756. repeatedStringForRight += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
  757. }
  758. repeatedStringForRight += "}"
  759. keysForLabels := make([]string, 0, len(this.Labels))
  760. for k, _ := range this.Labels {
  761. keysForLabels = append(keysForLabels, k)
  762. }
  763. github_com_gogo_protobuf_sortkeys.Strings(keysForLabels)
  764. mapStringForLabels := "map[string]string{"
  765. for _, k := range keysForLabels {
  766. mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k])
  767. }
  768. mapStringForLabels += "}"
  769. s := strings.Join([]string{`&DiffRequest{`,
  770. `Left:` + repeatedStringForLeft + `,`,
  771. `Right:` + repeatedStringForRight + `,`,
  772. `MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`,
  773. `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
  774. `Labels:` + mapStringForLabels + `,`,
  775. `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
  776. `}`,
  777. }, "")
  778. return s
  779. }
  780. func (this *DiffResponse) String() string {
  781. if this == nil {
  782. return "nil"
  783. }
  784. s := strings.Join([]string{`&DiffResponse{`,
  785. `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "types.Descriptor", 1) + `,`,
  786. `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
  787. `}`,
  788. }, "")
  789. return s
  790. }
  791. func valueToStringDiff(v interface{}) string {
  792. rv := reflect.ValueOf(v)
  793. if rv.IsNil() {
  794. return "nil"
  795. }
  796. pv := reflect.Indirect(rv).Interface()
  797. return fmt.Sprintf("*%v", pv)
  798. }
  799. func (m *ApplyRequest) Unmarshal(dAtA []byte) error {
  800. l := len(dAtA)
  801. iNdEx := 0
  802. for iNdEx < l {
  803. preIndex := iNdEx
  804. var wire uint64
  805. for shift := uint(0); ; shift += 7 {
  806. if shift >= 64 {
  807. return ErrIntOverflowDiff
  808. }
  809. if iNdEx >= l {
  810. return io.ErrUnexpectedEOF
  811. }
  812. b := dAtA[iNdEx]
  813. iNdEx++
  814. wire |= uint64(b&0x7F) << shift
  815. if b < 0x80 {
  816. break
  817. }
  818. }
  819. fieldNum := int32(wire >> 3)
  820. wireType := int(wire & 0x7)
  821. if wireType == 4 {
  822. return fmt.Errorf("proto: ApplyRequest: wiretype end group for non-group")
  823. }
  824. if fieldNum <= 0 {
  825. return fmt.Errorf("proto: ApplyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  826. }
  827. switch fieldNum {
  828. case 1:
  829. if wireType != 2 {
  830. return fmt.Errorf("proto: wrong wireType = %d for field Diff", wireType)
  831. }
  832. var msglen int
  833. for shift := uint(0); ; shift += 7 {
  834. if shift >= 64 {
  835. return ErrIntOverflowDiff
  836. }
  837. if iNdEx >= l {
  838. return io.ErrUnexpectedEOF
  839. }
  840. b := dAtA[iNdEx]
  841. iNdEx++
  842. msglen |= int(b&0x7F) << shift
  843. if b < 0x80 {
  844. break
  845. }
  846. }
  847. if msglen < 0 {
  848. return ErrInvalidLengthDiff
  849. }
  850. postIndex := iNdEx + msglen
  851. if postIndex < 0 {
  852. return ErrInvalidLengthDiff
  853. }
  854. if postIndex > l {
  855. return io.ErrUnexpectedEOF
  856. }
  857. if m.Diff == nil {
  858. m.Diff = &types.Descriptor{}
  859. }
  860. if err := m.Diff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  861. return err
  862. }
  863. iNdEx = postIndex
  864. case 2:
  865. if wireType != 2 {
  866. return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType)
  867. }
  868. var msglen int
  869. for shift := uint(0); ; shift += 7 {
  870. if shift >= 64 {
  871. return ErrIntOverflowDiff
  872. }
  873. if iNdEx >= l {
  874. return io.ErrUnexpectedEOF
  875. }
  876. b := dAtA[iNdEx]
  877. iNdEx++
  878. msglen |= int(b&0x7F) << shift
  879. if b < 0x80 {
  880. break
  881. }
  882. }
  883. if msglen < 0 {
  884. return ErrInvalidLengthDiff
  885. }
  886. postIndex := iNdEx + msglen
  887. if postIndex < 0 {
  888. return ErrInvalidLengthDiff
  889. }
  890. if postIndex > l {
  891. return io.ErrUnexpectedEOF
  892. }
  893. m.Mounts = append(m.Mounts, &types.Mount{})
  894. if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  895. return err
  896. }
  897. iNdEx = postIndex
  898. case 3:
  899. if wireType != 2 {
  900. return fmt.Errorf("proto: wrong wireType = %d for field Payloads", wireType)
  901. }
  902. var msglen int
  903. for shift := uint(0); ; shift += 7 {
  904. if shift >= 64 {
  905. return ErrIntOverflowDiff
  906. }
  907. if iNdEx >= l {
  908. return io.ErrUnexpectedEOF
  909. }
  910. b := dAtA[iNdEx]
  911. iNdEx++
  912. msglen |= int(b&0x7F) << shift
  913. if b < 0x80 {
  914. break
  915. }
  916. }
  917. if msglen < 0 {
  918. return ErrInvalidLengthDiff
  919. }
  920. postIndex := iNdEx + msglen
  921. if postIndex < 0 {
  922. return ErrInvalidLengthDiff
  923. }
  924. if postIndex > l {
  925. return io.ErrUnexpectedEOF
  926. }
  927. if m.Payloads == nil {
  928. m.Payloads = make(map[string]*types1.Any)
  929. }
  930. var mapkey string
  931. var mapvalue *types1.Any
  932. for iNdEx < postIndex {
  933. entryPreIndex := iNdEx
  934. var wire uint64
  935. for shift := uint(0); ; shift += 7 {
  936. if shift >= 64 {
  937. return ErrIntOverflowDiff
  938. }
  939. if iNdEx >= l {
  940. return io.ErrUnexpectedEOF
  941. }
  942. b := dAtA[iNdEx]
  943. iNdEx++
  944. wire |= uint64(b&0x7F) << shift
  945. if b < 0x80 {
  946. break
  947. }
  948. }
  949. fieldNum := int32(wire >> 3)
  950. if fieldNum == 1 {
  951. var stringLenmapkey uint64
  952. for shift := uint(0); ; shift += 7 {
  953. if shift >= 64 {
  954. return ErrIntOverflowDiff
  955. }
  956. if iNdEx >= l {
  957. return io.ErrUnexpectedEOF
  958. }
  959. b := dAtA[iNdEx]
  960. iNdEx++
  961. stringLenmapkey |= uint64(b&0x7F) << shift
  962. if b < 0x80 {
  963. break
  964. }
  965. }
  966. intStringLenmapkey := int(stringLenmapkey)
  967. if intStringLenmapkey < 0 {
  968. return ErrInvalidLengthDiff
  969. }
  970. postStringIndexmapkey := iNdEx + intStringLenmapkey
  971. if postStringIndexmapkey < 0 {
  972. return ErrInvalidLengthDiff
  973. }
  974. if postStringIndexmapkey > l {
  975. return io.ErrUnexpectedEOF
  976. }
  977. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  978. iNdEx = postStringIndexmapkey
  979. } else if fieldNum == 2 {
  980. var mapmsglen int
  981. for shift := uint(0); ; shift += 7 {
  982. if shift >= 64 {
  983. return ErrIntOverflowDiff
  984. }
  985. if iNdEx >= l {
  986. return io.ErrUnexpectedEOF
  987. }
  988. b := dAtA[iNdEx]
  989. iNdEx++
  990. mapmsglen |= int(b&0x7F) << shift
  991. if b < 0x80 {
  992. break
  993. }
  994. }
  995. if mapmsglen < 0 {
  996. return ErrInvalidLengthDiff
  997. }
  998. postmsgIndex := iNdEx + mapmsglen
  999. if postmsgIndex < 0 {
  1000. return ErrInvalidLengthDiff
  1001. }
  1002. if postmsgIndex > l {
  1003. return io.ErrUnexpectedEOF
  1004. }
  1005. mapvalue = &types1.Any{}
  1006. if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
  1007. return err
  1008. }
  1009. iNdEx = postmsgIndex
  1010. } else {
  1011. iNdEx = entryPreIndex
  1012. skippy, err := skipDiff(dAtA[iNdEx:])
  1013. if err != nil {
  1014. return err
  1015. }
  1016. if skippy < 0 {
  1017. return ErrInvalidLengthDiff
  1018. }
  1019. if (iNdEx + skippy) > postIndex {
  1020. return io.ErrUnexpectedEOF
  1021. }
  1022. iNdEx += skippy
  1023. }
  1024. }
  1025. m.Payloads[mapkey] = mapvalue
  1026. iNdEx = postIndex
  1027. default:
  1028. iNdEx = preIndex
  1029. skippy, err := skipDiff(dAtA[iNdEx:])
  1030. if err != nil {
  1031. return err
  1032. }
  1033. if skippy < 0 {
  1034. return ErrInvalidLengthDiff
  1035. }
  1036. if (iNdEx + skippy) < 0 {
  1037. return ErrInvalidLengthDiff
  1038. }
  1039. if (iNdEx + skippy) > l {
  1040. return io.ErrUnexpectedEOF
  1041. }
  1042. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1043. iNdEx += skippy
  1044. }
  1045. }
  1046. if iNdEx > l {
  1047. return io.ErrUnexpectedEOF
  1048. }
  1049. return nil
  1050. }
  1051. func (m *ApplyResponse) Unmarshal(dAtA []byte) error {
  1052. l := len(dAtA)
  1053. iNdEx := 0
  1054. for iNdEx < l {
  1055. preIndex := iNdEx
  1056. var wire uint64
  1057. for shift := uint(0); ; shift += 7 {
  1058. if shift >= 64 {
  1059. return ErrIntOverflowDiff
  1060. }
  1061. if iNdEx >= l {
  1062. return io.ErrUnexpectedEOF
  1063. }
  1064. b := dAtA[iNdEx]
  1065. iNdEx++
  1066. wire |= uint64(b&0x7F) << shift
  1067. if b < 0x80 {
  1068. break
  1069. }
  1070. }
  1071. fieldNum := int32(wire >> 3)
  1072. wireType := int(wire & 0x7)
  1073. if wireType == 4 {
  1074. return fmt.Errorf("proto: ApplyResponse: wiretype end group for non-group")
  1075. }
  1076. if fieldNum <= 0 {
  1077. return fmt.Errorf("proto: ApplyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1078. }
  1079. switch fieldNum {
  1080. case 1:
  1081. if wireType != 2 {
  1082. return fmt.Errorf("proto: wrong wireType = %d for field Applied", wireType)
  1083. }
  1084. var msglen int
  1085. for shift := uint(0); ; shift += 7 {
  1086. if shift >= 64 {
  1087. return ErrIntOverflowDiff
  1088. }
  1089. if iNdEx >= l {
  1090. return io.ErrUnexpectedEOF
  1091. }
  1092. b := dAtA[iNdEx]
  1093. iNdEx++
  1094. msglen |= int(b&0x7F) << shift
  1095. if b < 0x80 {
  1096. break
  1097. }
  1098. }
  1099. if msglen < 0 {
  1100. return ErrInvalidLengthDiff
  1101. }
  1102. postIndex := iNdEx + msglen
  1103. if postIndex < 0 {
  1104. return ErrInvalidLengthDiff
  1105. }
  1106. if postIndex > l {
  1107. return io.ErrUnexpectedEOF
  1108. }
  1109. if m.Applied == nil {
  1110. m.Applied = &types.Descriptor{}
  1111. }
  1112. if err := m.Applied.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1113. return err
  1114. }
  1115. iNdEx = postIndex
  1116. default:
  1117. iNdEx = preIndex
  1118. skippy, err := skipDiff(dAtA[iNdEx:])
  1119. if err != nil {
  1120. return err
  1121. }
  1122. if skippy < 0 {
  1123. return ErrInvalidLengthDiff
  1124. }
  1125. if (iNdEx + skippy) < 0 {
  1126. return ErrInvalidLengthDiff
  1127. }
  1128. if (iNdEx + skippy) > l {
  1129. return io.ErrUnexpectedEOF
  1130. }
  1131. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1132. iNdEx += skippy
  1133. }
  1134. }
  1135. if iNdEx > l {
  1136. return io.ErrUnexpectedEOF
  1137. }
  1138. return nil
  1139. }
  1140. func (m *DiffRequest) Unmarshal(dAtA []byte) error {
  1141. l := len(dAtA)
  1142. iNdEx := 0
  1143. for iNdEx < l {
  1144. preIndex := iNdEx
  1145. var wire uint64
  1146. for shift := uint(0); ; shift += 7 {
  1147. if shift >= 64 {
  1148. return ErrIntOverflowDiff
  1149. }
  1150. if iNdEx >= l {
  1151. return io.ErrUnexpectedEOF
  1152. }
  1153. b := dAtA[iNdEx]
  1154. iNdEx++
  1155. wire |= uint64(b&0x7F) << shift
  1156. if b < 0x80 {
  1157. break
  1158. }
  1159. }
  1160. fieldNum := int32(wire >> 3)
  1161. wireType := int(wire & 0x7)
  1162. if wireType == 4 {
  1163. return fmt.Errorf("proto: DiffRequest: wiretype end group for non-group")
  1164. }
  1165. if fieldNum <= 0 {
  1166. return fmt.Errorf("proto: DiffRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1167. }
  1168. switch fieldNum {
  1169. case 1:
  1170. if wireType != 2 {
  1171. return fmt.Errorf("proto: wrong wireType = %d for field Left", wireType)
  1172. }
  1173. var msglen int
  1174. for shift := uint(0); ; shift += 7 {
  1175. if shift >= 64 {
  1176. return ErrIntOverflowDiff
  1177. }
  1178. if iNdEx >= l {
  1179. return io.ErrUnexpectedEOF
  1180. }
  1181. b := dAtA[iNdEx]
  1182. iNdEx++
  1183. msglen |= int(b&0x7F) << shift
  1184. if b < 0x80 {
  1185. break
  1186. }
  1187. }
  1188. if msglen < 0 {
  1189. return ErrInvalidLengthDiff
  1190. }
  1191. postIndex := iNdEx + msglen
  1192. if postIndex < 0 {
  1193. return ErrInvalidLengthDiff
  1194. }
  1195. if postIndex > l {
  1196. return io.ErrUnexpectedEOF
  1197. }
  1198. m.Left = append(m.Left, &types.Mount{})
  1199. if err := m.Left[len(m.Left)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1200. return err
  1201. }
  1202. iNdEx = postIndex
  1203. case 2:
  1204. if wireType != 2 {
  1205. return fmt.Errorf("proto: wrong wireType = %d for field Right", wireType)
  1206. }
  1207. var msglen int
  1208. for shift := uint(0); ; shift += 7 {
  1209. if shift >= 64 {
  1210. return ErrIntOverflowDiff
  1211. }
  1212. if iNdEx >= l {
  1213. return io.ErrUnexpectedEOF
  1214. }
  1215. b := dAtA[iNdEx]
  1216. iNdEx++
  1217. msglen |= int(b&0x7F) << shift
  1218. if b < 0x80 {
  1219. break
  1220. }
  1221. }
  1222. if msglen < 0 {
  1223. return ErrInvalidLengthDiff
  1224. }
  1225. postIndex := iNdEx + msglen
  1226. if postIndex < 0 {
  1227. return ErrInvalidLengthDiff
  1228. }
  1229. if postIndex > l {
  1230. return io.ErrUnexpectedEOF
  1231. }
  1232. m.Right = append(m.Right, &types.Mount{})
  1233. if err := m.Right[len(m.Right)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1234. return err
  1235. }
  1236. iNdEx = postIndex
  1237. case 3:
  1238. if wireType != 2 {
  1239. return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType)
  1240. }
  1241. var stringLen uint64
  1242. for shift := uint(0); ; shift += 7 {
  1243. if shift >= 64 {
  1244. return ErrIntOverflowDiff
  1245. }
  1246. if iNdEx >= l {
  1247. return io.ErrUnexpectedEOF
  1248. }
  1249. b := dAtA[iNdEx]
  1250. iNdEx++
  1251. stringLen |= uint64(b&0x7F) << shift
  1252. if b < 0x80 {
  1253. break
  1254. }
  1255. }
  1256. intStringLen := int(stringLen)
  1257. if intStringLen < 0 {
  1258. return ErrInvalidLengthDiff
  1259. }
  1260. postIndex := iNdEx + intStringLen
  1261. if postIndex < 0 {
  1262. return ErrInvalidLengthDiff
  1263. }
  1264. if postIndex > l {
  1265. return io.ErrUnexpectedEOF
  1266. }
  1267. m.MediaType = string(dAtA[iNdEx:postIndex])
  1268. iNdEx = postIndex
  1269. case 4:
  1270. if wireType != 2 {
  1271. return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType)
  1272. }
  1273. var stringLen uint64
  1274. for shift := uint(0); ; shift += 7 {
  1275. if shift >= 64 {
  1276. return ErrIntOverflowDiff
  1277. }
  1278. if iNdEx >= l {
  1279. return io.ErrUnexpectedEOF
  1280. }
  1281. b := dAtA[iNdEx]
  1282. iNdEx++
  1283. stringLen |= uint64(b&0x7F) << shift
  1284. if b < 0x80 {
  1285. break
  1286. }
  1287. }
  1288. intStringLen := int(stringLen)
  1289. if intStringLen < 0 {
  1290. return ErrInvalidLengthDiff
  1291. }
  1292. postIndex := iNdEx + intStringLen
  1293. if postIndex < 0 {
  1294. return ErrInvalidLengthDiff
  1295. }
  1296. if postIndex > l {
  1297. return io.ErrUnexpectedEOF
  1298. }
  1299. m.Ref = string(dAtA[iNdEx:postIndex])
  1300. iNdEx = postIndex
  1301. case 5:
  1302. if wireType != 2 {
  1303. return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType)
  1304. }
  1305. var msglen int
  1306. for shift := uint(0); ; shift += 7 {
  1307. if shift >= 64 {
  1308. return ErrIntOverflowDiff
  1309. }
  1310. if iNdEx >= l {
  1311. return io.ErrUnexpectedEOF
  1312. }
  1313. b := dAtA[iNdEx]
  1314. iNdEx++
  1315. msglen |= int(b&0x7F) << shift
  1316. if b < 0x80 {
  1317. break
  1318. }
  1319. }
  1320. if msglen < 0 {
  1321. return ErrInvalidLengthDiff
  1322. }
  1323. postIndex := iNdEx + msglen
  1324. if postIndex < 0 {
  1325. return ErrInvalidLengthDiff
  1326. }
  1327. if postIndex > l {
  1328. return io.ErrUnexpectedEOF
  1329. }
  1330. if m.Labels == nil {
  1331. m.Labels = make(map[string]string)
  1332. }
  1333. var mapkey string
  1334. var mapvalue string
  1335. for iNdEx < postIndex {
  1336. entryPreIndex := iNdEx
  1337. var wire uint64
  1338. for shift := uint(0); ; shift += 7 {
  1339. if shift >= 64 {
  1340. return ErrIntOverflowDiff
  1341. }
  1342. if iNdEx >= l {
  1343. return io.ErrUnexpectedEOF
  1344. }
  1345. b := dAtA[iNdEx]
  1346. iNdEx++
  1347. wire |= uint64(b&0x7F) << shift
  1348. if b < 0x80 {
  1349. break
  1350. }
  1351. }
  1352. fieldNum := int32(wire >> 3)
  1353. if fieldNum == 1 {
  1354. var stringLenmapkey uint64
  1355. for shift := uint(0); ; shift += 7 {
  1356. if shift >= 64 {
  1357. return ErrIntOverflowDiff
  1358. }
  1359. if iNdEx >= l {
  1360. return io.ErrUnexpectedEOF
  1361. }
  1362. b := dAtA[iNdEx]
  1363. iNdEx++
  1364. stringLenmapkey |= uint64(b&0x7F) << shift
  1365. if b < 0x80 {
  1366. break
  1367. }
  1368. }
  1369. intStringLenmapkey := int(stringLenmapkey)
  1370. if intStringLenmapkey < 0 {
  1371. return ErrInvalidLengthDiff
  1372. }
  1373. postStringIndexmapkey := iNdEx + intStringLenmapkey
  1374. if postStringIndexmapkey < 0 {
  1375. return ErrInvalidLengthDiff
  1376. }
  1377. if postStringIndexmapkey > l {
  1378. return io.ErrUnexpectedEOF
  1379. }
  1380. mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
  1381. iNdEx = postStringIndexmapkey
  1382. } else if fieldNum == 2 {
  1383. var stringLenmapvalue uint64
  1384. for shift := uint(0); ; shift += 7 {
  1385. if shift >= 64 {
  1386. return ErrIntOverflowDiff
  1387. }
  1388. if iNdEx >= l {
  1389. return io.ErrUnexpectedEOF
  1390. }
  1391. b := dAtA[iNdEx]
  1392. iNdEx++
  1393. stringLenmapvalue |= uint64(b&0x7F) << shift
  1394. if b < 0x80 {
  1395. break
  1396. }
  1397. }
  1398. intStringLenmapvalue := int(stringLenmapvalue)
  1399. if intStringLenmapvalue < 0 {
  1400. return ErrInvalidLengthDiff
  1401. }
  1402. postStringIndexmapvalue := iNdEx + intStringLenmapvalue
  1403. if postStringIndexmapvalue < 0 {
  1404. return ErrInvalidLengthDiff
  1405. }
  1406. if postStringIndexmapvalue > l {
  1407. return io.ErrUnexpectedEOF
  1408. }
  1409. mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
  1410. iNdEx = postStringIndexmapvalue
  1411. } else {
  1412. iNdEx = entryPreIndex
  1413. skippy, err := skipDiff(dAtA[iNdEx:])
  1414. if err != nil {
  1415. return err
  1416. }
  1417. if skippy < 0 {
  1418. return ErrInvalidLengthDiff
  1419. }
  1420. if (iNdEx + skippy) > postIndex {
  1421. return io.ErrUnexpectedEOF
  1422. }
  1423. iNdEx += skippy
  1424. }
  1425. }
  1426. m.Labels[mapkey] = mapvalue
  1427. iNdEx = postIndex
  1428. default:
  1429. iNdEx = preIndex
  1430. skippy, err := skipDiff(dAtA[iNdEx:])
  1431. if err != nil {
  1432. return err
  1433. }
  1434. if skippy < 0 {
  1435. return ErrInvalidLengthDiff
  1436. }
  1437. if (iNdEx + skippy) < 0 {
  1438. return ErrInvalidLengthDiff
  1439. }
  1440. if (iNdEx + skippy) > l {
  1441. return io.ErrUnexpectedEOF
  1442. }
  1443. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1444. iNdEx += skippy
  1445. }
  1446. }
  1447. if iNdEx > l {
  1448. return io.ErrUnexpectedEOF
  1449. }
  1450. return nil
  1451. }
  1452. func (m *DiffResponse) Unmarshal(dAtA []byte) error {
  1453. l := len(dAtA)
  1454. iNdEx := 0
  1455. for iNdEx < l {
  1456. preIndex := iNdEx
  1457. var wire uint64
  1458. for shift := uint(0); ; shift += 7 {
  1459. if shift >= 64 {
  1460. return ErrIntOverflowDiff
  1461. }
  1462. if iNdEx >= l {
  1463. return io.ErrUnexpectedEOF
  1464. }
  1465. b := dAtA[iNdEx]
  1466. iNdEx++
  1467. wire |= uint64(b&0x7F) << shift
  1468. if b < 0x80 {
  1469. break
  1470. }
  1471. }
  1472. fieldNum := int32(wire >> 3)
  1473. wireType := int(wire & 0x7)
  1474. if wireType == 4 {
  1475. return fmt.Errorf("proto: DiffResponse: wiretype end group for non-group")
  1476. }
  1477. if fieldNum <= 0 {
  1478. return fmt.Errorf("proto: DiffResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1479. }
  1480. switch fieldNum {
  1481. case 3:
  1482. if wireType != 2 {
  1483. return fmt.Errorf("proto: wrong wireType = %d for field Diff", wireType)
  1484. }
  1485. var msglen int
  1486. for shift := uint(0); ; shift += 7 {
  1487. if shift >= 64 {
  1488. return ErrIntOverflowDiff
  1489. }
  1490. if iNdEx >= l {
  1491. return io.ErrUnexpectedEOF
  1492. }
  1493. b := dAtA[iNdEx]
  1494. iNdEx++
  1495. msglen |= int(b&0x7F) << shift
  1496. if b < 0x80 {
  1497. break
  1498. }
  1499. }
  1500. if msglen < 0 {
  1501. return ErrInvalidLengthDiff
  1502. }
  1503. postIndex := iNdEx + msglen
  1504. if postIndex < 0 {
  1505. return ErrInvalidLengthDiff
  1506. }
  1507. if postIndex > l {
  1508. return io.ErrUnexpectedEOF
  1509. }
  1510. if m.Diff == nil {
  1511. m.Diff = &types.Descriptor{}
  1512. }
  1513. if err := m.Diff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1514. return err
  1515. }
  1516. iNdEx = postIndex
  1517. default:
  1518. iNdEx = preIndex
  1519. skippy, err := skipDiff(dAtA[iNdEx:])
  1520. if err != nil {
  1521. return err
  1522. }
  1523. if skippy < 0 {
  1524. return ErrInvalidLengthDiff
  1525. }
  1526. if (iNdEx + skippy) < 0 {
  1527. return ErrInvalidLengthDiff
  1528. }
  1529. if (iNdEx + skippy) > l {
  1530. return io.ErrUnexpectedEOF
  1531. }
  1532. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1533. iNdEx += skippy
  1534. }
  1535. }
  1536. if iNdEx > l {
  1537. return io.ErrUnexpectedEOF
  1538. }
  1539. return nil
  1540. }
  1541. func skipDiff(dAtA []byte) (n int, err error) {
  1542. l := len(dAtA)
  1543. iNdEx := 0
  1544. depth := 0
  1545. for iNdEx < l {
  1546. var wire uint64
  1547. for shift := uint(0); ; shift += 7 {
  1548. if shift >= 64 {
  1549. return 0, ErrIntOverflowDiff
  1550. }
  1551. if iNdEx >= l {
  1552. return 0, io.ErrUnexpectedEOF
  1553. }
  1554. b := dAtA[iNdEx]
  1555. iNdEx++
  1556. wire |= (uint64(b) & 0x7F) << shift
  1557. if b < 0x80 {
  1558. break
  1559. }
  1560. }
  1561. wireType := int(wire & 0x7)
  1562. switch wireType {
  1563. case 0:
  1564. for shift := uint(0); ; shift += 7 {
  1565. if shift >= 64 {
  1566. return 0, ErrIntOverflowDiff
  1567. }
  1568. if iNdEx >= l {
  1569. return 0, io.ErrUnexpectedEOF
  1570. }
  1571. iNdEx++
  1572. if dAtA[iNdEx-1] < 0x80 {
  1573. break
  1574. }
  1575. }
  1576. case 1:
  1577. iNdEx += 8
  1578. case 2:
  1579. var length int
  1580. for shift := uint(0); ; shift += 7 {
  1581. if shift >= 64 {
  1582. return 0, ErrIntOverflowDiff
  1583. }
  1584. if iNdEx >= l {
  1585. return 0, io.ErrUnexpectedEOF
  1586. }
  1587. b := dAtA[iNdEx]
  1588. iNdEx++
  1589. length |= (int(b) & 0x7F) << shift
  1590. if b < 0x80 {
  1591. break
  1592. }
  1593. }
  1594. if length < 0 {
  1595. return 0, ErrInvalidLengthDiff
  1596. }
  1597. iNdEx += length
  1598. case 3:
  1599. depth++
  1600. case 4:
  1601. if depth == 0 {
  1602. return 0, ErrUnexpectedEndOfGroupDiff
  1603. }
  1604. depth--
  1605. case 5:
  1606. iNdEx += 4
  1607. default:
  1608. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1609. }
  1610. if iNdEx < 0 {
  1611. return 0, ErrInvalidLengthDiff
  1612. }
  1613. if depth == 0 {
  1614. return iNdEx, nil
  1615. }
  1616. }
  1617. return 0, io.ErrUnexpectedEOF
  1618. }
  1619. var (
  1620. ErrInvalidLengthDiff = fmt.Errorf("proto: negative length found during unmarshaling")
  1621. ErrIntOverflowDiff = fmt.Errorf("proto: integer overflow")
  1622. ErrUnexpectedEndOfGroupDiff = fmt.Errorf("proto: unexpected end of group")
  1623. )