Merge pull request #6841 from kzys/proto-upgrade-6
Migrate off from github.com/gogo/protobuf
This commit is contained in:
commit
3dbd6a2498
4
Makefile
4
Makefile
@ -159,7 +159,7 @@ generate: protos
|
|||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@PATH="${ROOTDIR}/bin:${PATH}" $(GO) generate -x ${PACKAGES}
|
@PATH="${ROOTDIR}/bin:${PATH}" $(GO) generate -x ${PACKAGES}
|
||||||
|
|
||||||
protos: bin/protoc-gen-gogoctrd ## generate protobuf
|
protos: bin/protoc-gen-go-fieldpath
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@find . -path ./vendor -prune -false -o -name '*.pb.go' | xargs rm
|
@find . -path ./vendor -prune -false -o -name '*.pb.go' | xargs rm
|
||||||
$(eval TMPDIR := $(shell mktemp -d))
|
$(eval TMPDIR := $(shell mktemp -d))
|
||||||
@ -168,7 +168,7 @@ protos: bin/protoc-gen-gogoctrd ## generate protobuf
|
|||||||
@(PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${NON_API_PACKAGES})
|
@(PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${NON_API_PACKAGES})
|
||||||
@mv ${TMPDIR}/vendor ${ROOTDIR}
|
@mv ${TMPDIR}/vendor ${ROOTDIR}
|
||||||
@rm -rf ${TMPDIR}
|
@rm -rf ${TMPDIR}
|
||||||
go-fix-acronym -w -a '(Io|Uuid|Os)$$' $(shell find api -name '*.pb.go')
|
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ runtime/ -name '*.pb.go')
|
||||||
|
|
||||||
check-protos: protos ## check if protobufs needs to be generated again
|
check-protos: protos ## check if protobufs needs to be generated again
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version = "1"
|
version = "2"
|
||||||
generator = "gogoctrd"
|
generators = ["go"]
|
||||||
plugins = ["grpc", "fieldpath"]
|
|
||||||
|
|
||||||
# Control protoc include paths. Below are usually some good defaults, but feel
|
# Control protoc include paths. Below are usually some good defaults, but feel
|
||||||
# free to try it without them if it works for your project.
|
# free to try it without them if it works for your project.
|
||||||
@ -12,25 +11,13 @@ plugins = ["grpc", "fieldpath"]
|
|||||||
# Paths that should be treated as include roots in relation to the vendor
|
# Paths that should be treated as include roots in relation to the vendor
|
||||||
# directory. These will be calculated with the vendor directory nearest the
|
# directory. These will be calculated with the vendor directory nearest the
|
||||||
# target package.
|
# target package.
|
||||||
packages = ["github.com/gogo/protobuf", "github.com/gogo/googleapis"]
|
packages = ["github.com/gogo/protobuf"]
|
||||||
|
|
||||||
# Paths that will be added untouched to the end of the includes. We use
|
# Paths that will be added untouched to the end of the includes. We use
|
||||||
# `/usr/local/include` to pickup the common install location of protobuf.
|
# `/usr/local/include` to pickup the common install location of protobuf.
|
||||||
# This is the default.
|
# This is the default.
|
||||||
after = ["/usr/local/include", "/usr/include"]
|
after = ["/usr/local/include", "/usr/include"]
|
||||||
|
|
||||||
# This section maps protobuf imports to Go packages. These will become
|
|
||||||
# `-M` directives in the call to the go protobuf generator.
|
|
||||||
[packages]
|
|
||||||
"gogoproto/gogo.proto" = "github.com/gogo/protobuf/gogoproto"
|
|
||||||
"google/protobuf/any.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/empty.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/descriptor.proto" = "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
|
||||||
"google/protobuf/field_mask.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/timestamp.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/duration.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/rpc/status.proto" = "github.com/gogo/googleapis/google/rpc"
|
|
||||||
|
|
||||||
[[overrides]]
|
[[overrides]]
|
||||||
# enable ttrpc and disable fieldpath and grpc for the shim
|
# enable ttrpc and disable fieldpath and grpc for the shim
|
||||||
prefixes = [
|
prefixes = [
|
||||||
@ -38,7 +25,7 @@ prefixes = [
|
|||||||
"github.com/containerd/containerd/api/runtime/task/v2",
|
"github.com/containerd/containerd/api/runtime/task/v2",
|
||||||
"github.com/containerd/containerd/api/runtime/sandbox/v1",
|
"github.com/containerd/containerd/api/runtime/sandbox/v1",
|
||||||
]
|
]
|
||||||
plugins = ["ttrpc"]
|
generators = ["go", "go-ttrpc"]
|
||||||
|
|
||||||
# Lock down runc config
|
# Lock down runc config
|
||||||
[[descriptors]]
|
[[descriptors]]
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
version = "1"
|
version = "2"
|
||||||
generator = "gogoctrd"
|
generators = ["go", "go-grpc"]
|
||||||
plugins = ["grpc", "fieldpath"]
|
|
||||||
|
|
||||||
# Control protoc include paths. Below are usually some good defaults, but feel
|
# Control protoc include paths. Below are usually some good defaults, but feel
|
||||||
# free to try it without them if it works for your project.
|
# free to try it without them if it works for your project.
|
||||||
@ -12,7 +11,7 @@ plugins = ["grpc", "fieldpath"]
|
|||||||
# Paths that should be treated as include roots in relation to the vendor
|
# Paths that should be treated as include roots in relation to the vendor
|
||||||
# directory. These will be calculated with the vendor directory nearest the
|
# directory. These will be calculated with the vendor directory nearest the
|
||||||
# target package.
|
# target package.
|
||||||
packages = ["github.com/gogo/protobuf", "github.com/gogo/googleapis"]
|
packages = ["github.com/gogo/protobuf"]
|
||||||
|
|
||||||
# Paths that will be added untouched to the end of the includes. We use
|
# Paths that will be added untouched to the end of the includes. We use
|
||||||
# `/usr/local/include` to pickup the common install location of protobuf.
|
# `/usr/local/include` to pickup the common install location of protobuf.
|
||||||
@ -22,22 +21,15 @@ plugins = ["grpc", "fieldpath"]
|
|||||||
# This section maps protobuf imports to Go packages. These will become
|
# This section maps protobuf imports to Go packages. These will become
|
||||||
# `-M` directives in the call to the go protobuf generator.
|
# `-M` directives in the call to the go protobuf generator.
|
||||||
[packages]
|
[packages]
|
||||||
"gogoproto/gogo.proto" = "github.com/gogo/protobuf/gogoproto"
|
"google/rpc/status.proto" = "google.golang.org/genproto/googleapis/rpc/status"
|
||||||
"google/protobuf/any.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/empty.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/descriptor.proto" = "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
|
||||||
"google/protobuf/field_mask.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/timestamp.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/protobuf/duration.proto" = "github.com/gogo/protobuf/types"
|
|
||||||
"google/rpc/status.proto" = "github.com/gogo/googleapis/google/rpc"
|
|
||||||
|
|
||||||
[[overrides]]
|
[[overrides]]
|
||||||
prefixes = ["github.com/containerd/containerd/api/events"]
|
prefixes = ["github.com/containerd/containerd/api/events"]
|
||||||
plugins = ["fieldpath"] # disable grpc for this package
|
generators = ["go", "go-ttrpc", "go-fieldpath"]
|
||||||
|
|
||||||
[[overrides]]
|
[[overrides]]
|
||||||
prefixes = ["github.com/containerd/containerd/api/services/ttrpc/events/v1"]
|
prefixes = ["github.com/containerd/containerd/api/services/ttrpc/events/v1"]
|
||||||
plugins = ["ttrpc", "fieldpath"]
|
generators = ["go", "go-ttrpc", "go-fieldpath"]
|
||||||
|
|
||||||
[[overrides]]
|
[[overrides]]
|
||||||
# enable ttrpc and disable fieldpath and grpc for the shim
|
# enable ttrpc and disable fieldpath and grpc for the shim
|
||||||
@ -46,7 +38,7 @@ prefixes = [
|
|||||||
"github.com/containerd/containerd/api/runtime/task/v2",
|
"github.com/containerd/containerd/api/runtime/task/v2",
|
||||||
"github.com/containerd/containerd/api/runtime/sandbox/v1",
|
"github.com/containerd/containerd/api/runtime/sandbox/v1",
|
||||||
]
|
]
|
||||||
plugins = ["ttrpc"]
|
generators = ["go", "go-ttrpc"]
|
||||||
|
|
||||||
# Aggregrate the API descriptors to lock down API changes.
|
# Aggregrate the API descriptors to lock down API changes.
|
||||||
[[descriptors]]
|
[[descriptors]]
|
||||||
|
File diff suppressed because it is too large
Load Diff
95
api/events/container_fieldpath.pb.go
Normal file
95
api/events/container_fieldpath.pb.go
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/events/container.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
typeurl "github.com/containerd/typeurl"
|
||||||
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ContainerCreate) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "id":
|
||||||
|
return string(m.ID), len(m.ID) > 0
|
||||||
|
case "image":
|
||||||
|
return string(m.Image), len(m.Image) > 0
|
||||||
|
case "runtime":
|
||||||
|
// NOTE(stevvooe): This is probably not correct in many cases.
|
||||||
|
// We assume that the target message also implements the Field
|
||||||
|
// method, which isn't likely true in a lot of cases.
|
||||||
|
//
|
||||||
|
// If you have a broken build and have found this comment,
|
||||||
|
// you may be closer to a solution.
|
||||||
|
if m.Runtime == nil {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
return m.Runtime.Field(fieldpath[1:])
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ContainerCreate_Runtime) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
case "options":
|
||||||
|
decoded, err := typeurl.UnmarshalAny(m.Options)
|
||||||
|
if err != nil {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
adaptor, ok := decoded.(interface{ Field([]string) (string, bool) })
|
||||||
|
if !ok {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
return adaptor.Field(fieldpath[1:])
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ContainerUpdate) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "id":
|
||||||
|
return string(m.ID), len(m.ID) > 0
|
||||||
|
case "image":
|
||||||
|
return string(m.Image), len(m.Image) > 0
|
||||||
|
case "labels":
|
||||||
|
// Labels fields have been special-cased by name. If this breaks,
|
||||||
|
// add better special casing to fieldpath plugin.
|
||||||
|
if len(m.Labels) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
|
||||||
|
return value, ok
|
||||||
|
case "snapshot_key":
|
||||||
|
return string(m.SnapshotKey), len(m.SnapshotKey) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ContainerDelete) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "id":
|
||||||
|
return string(m.ID), len(m.ID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
@ -1,358 +1,171 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
//
|
||||||
|
//Copyright The containerd Authors.
|
||||||
|
//
|
||||||
|
//Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
//you may not use this file except in compliance with the License.
|
||||||
|
//You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
//http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
//Unless required by applicable law or agreed to in writing, software
|
||||||
|
//distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//See the License for the specific language governing permissions and
|
||||||
|
//limitations under the License.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/api/events/content.proto
|
// source: github.com/containerd/containerd/api/events/content.proto
|
||||||
|
|
||||||
package events
|
package events
|
||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/containerd/containerd/protobuf/plugin"
|
_ "github.com/containerd/containerd/protobuf/plugin"
|
||||||
_ "github.com/gogo/protobuf/gogoproto"
|
_ "github.com/gogo/protobuf/gogoproto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
io "io"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
)
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
type ContentDelete struct {
|
type ContentDelete struct {
|
||||||
Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
|
state protoimpl.MessageState
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
sizeCache protoimpl.SizeCache
|
||||||
XXX_unrecognized []byte `json:"-"`
|
unknownFields protoimpl.UnknownFields
|
||||||
XXX_sizecache int32 `json:"-"`
|
|
||||||
|
Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ContentDelete) Reset() {
|
||||||
|
*x = ContentDelete{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_events_content_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ContentDelete) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ContentDelete) Reset() { *m = ContentDelete{} }
|
|
||||||
func (*ContentDelete) ProtoMessage() {}
|
func (*ContentDelete) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ContentDelete) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_events_content_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ContentDelete.ProtoReflect.Descriptor instead.
|
||||||
func (*ContentDelete) Descriptor() ([]byte, []int) {
|
func (*ContentDelete) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_dfb34b8b808e2ecd, []int{0}
|
return file_github_com_containerd_containerd_api_events_content_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
|
||||||
func (m *ContentDelete) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *ContentDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_ContentDelete.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *ContentDelete) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_ContentDelete.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *ContentDelete) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *ContentDelete) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_ContentDelete.DiscardUnknown(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_ContentDelete proto.InternalMessageInfo
|
func (x *ContentDelete) GetDigest() string {
|
||||||
|
if x != nil {
|
||||||
func init() {
|
return x.Digest
|
||||||
proto.RegisterType((*ContentDelete)(nil), "containerd.events.ContentDelete")
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
var File_github_com_containerd_containerd_api_events_content_proto protoreflect.FileDescriptor
|
||||||
proto.RegisterFile("github.com/containerd/containerd/api/events/content.proto", fileDescriptor_dfb34b8b808e2ecd)
|
|
||||||
}
|
|
||||||
|
|
||||||
var fileDescriptor_dfb34b8b808e2ecd = []byte{
|
var file_github_com_containerd_containerd_api_events_content_proto_rawDesc = []byte{
|
||||||
// 194 bytes of a gzipped FileDescriptorProto
|
0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9,
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x63, 0x6f,
|
||||||
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0x83, 0x45, 0x53,
|
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x6f, 0x6e,
|
||||||
0xf3, 0x4a, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x04, 0x11, 0x8a, 0xf4, 0x20, 0x0a, 0xa4,
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x14,
|
||||||
0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xb2, 0xfa, 0x20, 0x16, 0x44, 0xa1, 0x94, 0x03, 0x41, 0x3b,
|
0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70,
|
||||||
0xc0, 0xea, 0x92, 0x4a, 0xd3, 0xf4, 0x0b, 0x72, 0x4a, 0xd3, 0x33, 0xf3, 0xf4, 0xd3, 0x32, 0x53,
|
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||||
0x73, 0x52, 0x0a, 0x12, 0x4b, 0x32, 0x20, 0x26, 0x28, 0xa9, 0x73, 0xf1, 0x3a, 0x43, 0xec, 0x76,
|
0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74,
|
||||||
0x49, 0xcd, 0x49, 0x2d, 0x49, 0x15, 0x12, 0xe3, 0x62, 0x4b, 0xc9, 0x4c, 0x4f, 0x2d, 0x2e, 0x91,
|
0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
|
||||||
0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0xf2, 0x9c, 0x02, 0x4e, 0x3c, 0x94, 0x63, 0xb8, 0xf1,
|
0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68,
|
||||||
0x50, 0x8e, 0xa1, 0xe1, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x27, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
|
||||||
0x78, 0x24, 0xc7, 0xb8, 0xe0, 0x8b, 0x1c, 0x63, 0x94, 0x11, 0x09, 0x9e, 0xb5, 0x86, 0x50, 0x49,
|
0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73,
|
||||||
0x6c, 0x60, 0x17, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x43, 0xb0, 0xdf, 0x8c, 0x29, 0x01,
|
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x42,
|
||||||
0x00, 0x00,
|
0x38, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f,
|
||||||
}
|
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
|
||||||
|
0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3b, 0x65,
|
||||||
// Field returns the value for the given fieldpath as a string, if defined.
|
0x76, 0x65, 0x6e, 0x74, 0x73, 0xa0, 0xf4, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
// If the value is not defined, the second value will be false.
|
0x33,
|
||||||
func (m *ContentDelete) Field(fieldpath []string) (string, bool) {
|
|
||||||
if len(fieldpath) == 0 {
|
|
||||||
return "", false
|
|
||||||
}
|
|
||||||
|
|
||||||
switch fieldpath[0] {
|
|
||||||
case "digest":
|
|
||||||
return string(m.Digest), len(m.Digest) > 0
|
|
||||||
}
|
|
||||||
return "", false
|
|
||||||
}
|
|
||||||
func (m *ContentDelete) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *ContentDelete) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *ContentDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
i -= len(m.XXX_unrecognized)
|
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
if len(m.Digest) > 0 {
|
|
||||||
i -= len(m.Digest)
|
|
||||||
copy(dAtA[i:], m.Digest)
|
|
||||||
i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintContent(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovContent(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *ContentDelete) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.Digest)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovContent(uint64(l))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
n += len(m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovContent(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozContent(x uint64) (n int) {
|
|
||||||
return sovContent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (this *ContentDelete) String() string {
|
|
||||||
if this == nil {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
s := strings.Join([]string{`&ContentDelete{`,
|
|
||||||
`Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
|
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
||||||
`}`,
|
|
||||||
}, "")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
func valueToStringContent(v interface{}) string {
|
|
||||||
rv := reflect.ValueOf(v)
|
|
||||||
if rv.IsNil() {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
pv := reflect.Indirect(rv).Interface()
|
|
||||||
return fmt.Sprintf("*%v", pv)
|
|
||||||
}
|
|
||||||
func (m *ContentDelete) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowContent
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: ContentDelete: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: ContentDelete: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowContent
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthContent
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthContent
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Digest = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipContent(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthContent
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipContent(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowContent
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowContent
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowContent
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthContent
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupContent
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthContent
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthContent = fmt.Errorf("proto: negative length found during unmarshaling")
|
file_github_com_containerd_containerd_api_events_content_proto_rawDescOnce sync.Once
|
||||||
ErrIntOverflowContent = fmt.Errorf("proto: integer overflow")
|
file_github_com_containerd_containerd_api_events_content_proto_rawDescData = file_github_com_containerd_containerd_api_events_content_proto_rawDesc
|
||||||
ErrUnexpectedEndOfGroupContent = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func file_github_com_containerd_containerd_api_events_content_proto_rawDescGZIP() []byte {
|
||||||
|
file_github_com_containerd_containerd_api_events_content_proto_rawDescOnce.Do(func() {
|
||||||
|
file_github_com_containerd_containerd_api_events_content_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_events_content_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_github_com_containerd_containerd_api_events_content_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_events_content_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_github_com_containerd_containerd_api_events_content_proto_goTypes = []interface{}{
|
||||||
|
(*ContentDelete)(nil), // 0: containerd.events.ContentDelete
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_api_events_content_proto_depIdxs = []int32{
|
||||||
|
0, // [0:0] is the sub-list for method output_type
|
||||||
|
0, // [0:0] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_api_events_content_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_api_events_content_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_api_events_content_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_github_com_containerd_containerd_api_events_content_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ContentDelete); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_api_events_content_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_api_events_content_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_api_events_content_proto_depIdxs,
|
||||||
|
MessageInfos: file_github_com_containerd_containerd_api_events_content_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_api_events_content_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_api_events_content_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_api_events_content_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_api_events_content_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
16
api/events/content_fieldpath.pb.go
Normal file
16
api/events/content_fieldpath.pb.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/events/content.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ContentDelete) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "digest":
|
||||||
|
return string(m.Digest), len(m.Digest) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
62
api/events/image_fieldpath.pb.go
Normal file
62
api/events/image_fieldpath.pb.go
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/events/image.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ImageCreate) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
case "labels":
|
||||||
|
// Labels fields have been special-cased by name. If this breaks,
|
||||||
|
// add better special casing to fieldpath plugin.
|
||||||
|
if len(m.Labels) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
|
||||||
|
return value, ok
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ImageUpdate) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
case "labels":
|
||||||
|
// Labels fields have been special-cased by name. If this breaks,
|
||||||
|
// add better special casing to fieldpath plugin.
|
||||||
|
if len(m.Labels) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
|
||||||
|
return value, ok
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ImageDelete) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
62
api/events/namespace_fieldpath.pb.go
Normal file
62
api/events/namespace_fieldpath.pb.go
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/events/namespace.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *NamespaceCreate) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
case "labels":
|
||||||
|
// Labels fields have been special-cased by name. If this breaks,
|
||||||
|
// add better special casing to fieldpath plugin.
|
||||||
|
if len(m.Labels) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
|
||||||
|
return value, ok
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *NamespaceUpdate) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
case "labels":
|
||||||
|
// Labels fields have been special-cased by name. If this breaks,
|
||||||
|
// add better special casing to fieldpath plugin.
|
||||||
|
if len(m.Labels) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
|
||||||
|
return value, ok
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *NamespaceDelete) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
46
api/events/snapshot_fieldpath.pb.go
Normal file
46
api/events/snapshot_fieldpath.pb.go
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/events/snapshot.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *SnapshotPrepare) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "key":
|
||||||
|
return string(m.Key), len(m.Key) > 0
|
||||||
|
case "parent":
|
||||||
|
return string(m.Parent), len(m.Parent) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *SnapshotCommit) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "key":
|
||||||
|
return string(m.Key), len(m.Key) > 0
|
||||||
|
case "name":
|
||||||
|
return string(m.Name), len(m.Name) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *SnapshotRemove) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "key":
|
||||||
|
return string(m.Key), len(m.Key) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
191
api/events/task_fieldpath.pb.go
Normal file
191
api/events/task_fieldpath.pb.go
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/events/task.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskCreate) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
// unhandled: rootfs
|
||||||
|
// unhandled: pid
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
case "bundle":
|
||||||
|
return string(m.Bundle), len(m.Bundle) > 0
|
||||||
|
case "io":
|
||||||
|
// NOTE(stevvooe): This is probably not correct in many cases.
|
||||||
|
// We assume that the target message also implements the Field
|
||||||
|
// method, which isn't likely true in a lot of cases.
|
||||||
|
//
|
||||||
|
// If you have a broken build and have found this comment,
|
||||||
|
// you may be closer to a solution.
|
||||||
|
if m.IO == nil {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
return m.IO.Field(fieldpath[1:])
|
||||||
|
case "checkpoint":
|
||||||
|
return string(m.Checkpoint), len(m.Checkpoint) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskStart) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
// unhandled: pid
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskDelete) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
// unhandled: pid
|
||||||
|
// unhandled: exit_status
|
||||||
|
// unhandled: exited_at
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
case "id":
|
||||||
|
return string(m.ID), len(m.ID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskIO) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "stdin":
|
||||||
|
return string(m.Stdin), len(m.Stdin) > 0
|
||||||
|
case "stdout":
|
||||||
|
return string(m.Stdout), len(m.Stdout) > 0
|
||||||
|
case "stderr":
|
||||||
|
return string(m.Stderr), len(m.Stderr) > 0
|
||||||
|
case "terminal":
|
||||||
|
return fmt.Sprint(m.Terminal), true
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskExit) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
// unhandled: pid
|
||||||
|
// unhandled: exit_status
|
||||||
|
// unhandled: exited_at
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
case "id":
|
||||||
|
return string(m.ID), len(m.ID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskOOM) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskExecAdded) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
case "exec_id":
|
||||||
|
return string(m.ExecID), len(m.ExecID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskExecStarted) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
// unhandled: pid
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
case "exec_id":
|
||||||
|
return string(m.ExecID), len(m.ExecID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskPaused) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskResumed) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *TaskCheckpointed) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "container_id":
|
||||||
|
return string(m.ContainerID), len(m.ContainerID) > 0
|
||||||
|
case "checkpoint":
|
||||||
|
return string(m.Checkpoint), len(m.Checkpoint) > 0
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
@ -3357,8 +3357,7 @@ file {
|
|||||||
java_package: "com.google.rpc"
|
java_package: "com.google.rpc"
|
||||||
java_outer_classname: "StatusProto"
|
java_outer_classname: "StatusProto"
|
||||||
java_multiple_files: true
|
java_multiple_files: true
|
||||||
go_package: "rpc"
|
go_package: "google.golang.org/genproto/googleapis/rpc/status;status"
|
||||||
cc_enable_arenas: true
|
|
||||||
objc_class_prefix: "RPC"
|
objc_class_prefix: "RPC"
|
||||||
}
|
}
|
||||||
syntax: "proto3"
|
syntax: "proto3"
|
||||||
|
File diff suppressed because it is too large
Load Diff
156
api/runtime/sandbox/v1/sandbox_ttrpc.pb.go
Normal file
156
api/runtime/sandbox/v1/sandbox_ttrpc.pb.go
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto
|
||||||
|
package sandbox
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
ttrpc "github.com/containerd/ttrpc"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SandboxService interface {
|
||||||
|
StartSandbox(context.Context, *StartSandboxRequest) (*StartSandboxResponse, error)
|
||||||
|
StopSandbox(context.Context, *StopSandboxRequest) (*StopSandboxResponse, error)
|
||||||
|
WaitSandbox(context.Context, *WaitSandboxRequest) (*WaitSandboxResponse, error)
|
||||||
|
UpdateSandbox(context.Context, *UpdateSandboxRequest) (*UpdateSandboxResponse, error)
|
||||||
|
PauseSandbox(context.Context, *PauseSandboxRequest) (*PauseSandboxResponse, error)
|
||||||
|
ResumeSandbox(context.Context, *ResumeSandboxRequest) (*ResumeSandboxResponse, error)
|
||||||
|
SandboxStatus(context.Context, *SandboxStatusRequest) (*SandboxStatusResponse, error)
|
||||||
|
PingSandbox(context.Context, *PingRequest) (*PingResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterSandboxService(srv *ttrpc.Server, svc SandboxService) {
|
||||||
|
srv.RegisterService("containerd.runtime.sandbox.v1.Sandbox", &ttrpc.ServiceDesc{
|
||||||
|
Methods: map[string]ttrpc.Method{
|
||||||
|
"StartSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req StartSandboxRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.StartSandbox(ctx, &req)
|
||||||
|
},
|
||||||
|
"StopSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req StopSandboxRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.StopSandbox(ctx, &req)
|
||||||
|
},
|
||||||
|
"WaitSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req WaitSandboxRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.WaitSandbox(ctx, &req)
|
||||||
|
},
|
||||||
|
"UpdateSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req UpdateSandboxRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.UpdateSandbox(ctx, &req)
|
||||||
|
},
|
||||||
|
"PauseSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req PauseSandboxRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.PauseSandbox(ctx, &req)
|
||||||
|
},
|
||||||
|
"ResumeSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ResumeSandboxRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.ResumeSandbox(ctx, &req)
|
||||||
|
},
|
||||||
|
"SandboxStatus": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req SandboxStatusRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.SandboxStatus(ctx, &req)
|
||||||
|
},
|
||||||
|
"PingSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req PingRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.PingSandbox(ctx, &req)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
type sandboxClient struct {
|
||||||
|
client *ttrpc.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSandboxClient(client *ttrpc.Client) SandboxService {
|
||||||
|
return &sandboxClient{
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) StartSandbox(ctx context.Context, req *StartSandboxRequest) (*StartSandboxResponse, error) {
|
||||||
|
var resp StartSandboxResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "StartSandbox", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) StopSandbox(ctx context.Context, req *StopSandboxRequest) (*StopSandboxResponse, error) {
|
||||||
|
var resp StopSandboxResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "StopSandbox", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) WaitSandbox(ctx context.Context, req *WaitSandboxRequest) (*WaitSandboxResponse, error) {
|
||||||
|
var resp WaitSandboxResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "WaitSandbox", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) UpdateSandbox(ctx context.Context, req *UpdateSandboxRequest) (*UpdateSandboxResponse, error) {
|
||||||
|
var resp UpdateSandboxResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "UpdateSandbox", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) PauseSandbox(ctx context.Context, req *PauseSandboxRequest) (*PauseSandboxResponse, error) {
|
||||||
|
var resp PauseSandboxResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "PauseSandbox", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) ResumeSandbox(ctx context.Context, req *ResumeSandboxRequest) (*ResumeSandboxResponse, error) {
|
||||||
|
var resp ResumeSandboxResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "ResumeSandbox", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) SandboxStatus(ctx context.Context, req *SandboxStatusRequest) (*SandboxStatusResponse, error) {
|
||||||
|
var resp SandboxStatusResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "SandboxStatus", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *sandboxClient) PingSandbox(ctx context.Context, req *PingRequest) (*PingResponse, error) {
|
||||||
|
var resp PingResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "PingSandbox", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
301
api/runtime/task/v2/shim_ttrpc.pb.go
Normal file
301
api/runtime/task/v2/shim_ttrpc.pb.go
Normal file
@ -0,0 +1,301 @@
|
|||||||
|
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/runtime/task/v2/shim.proto
|
||||||
|
package task
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
ttrpc "github.com/containerd/ttrpc"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
)
|
||||||
|
|
||||||
|
type TaskService interface {
|
||||||
|
State(context.Context, *StateRequest) (*StateResponse, error)
|
||||||
|
Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error)
|
||||||
|
Start(context.Context, *StartRequest) (*StartResponse, error)
|
||||||
|
Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
|
||||||
|
Pids(context.Context, *PidsRequest) (*PidsResponse, error)
|
||||||
|
Pause(context.Context, *PauseRequest) (*empty.Empty, error)
|
||||||
|
Resume(context.Context, *ResumeRequest) (*empty.Empty, error)
|
||||||
|
Checkpoint(context.Context, *CheckpointTaskRequest) (*empty.Empty, error)
|
||||||
|
Kill(context.Context, *KillRequest) (*empty.Empty, error)
|
||||||
|
Exec(context.Context, *ExecProcessRequest) (*empty.Empty, error)
|
||||||
|
ResizePty(context.Context, *ResizePtyRequest) (*empty.Empty, error)
|
||||||
|
CloseIO(context.Context, *CloseIORequest) (*empty.Empty, error)
|
||||||
|
Update(context.Context, *UpdateTaskRequest) (*empty.Empty, error)
|
||||||
|
Wait(context.Context, *WaitRequest) (*WaitResponse, error)
|
||||||
|
Stats(context.Context, *StatsRequest) (*StatsResponse, error)
|
||||||
|
Connect(context.Context, *ConnectRequest) (*ConnectResponse, error)
|
||||||
|
Shutdown(context.Context, *ShutdownRequest) (*empty.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterTaskService(srv *ttrpc.Server, svc TaskService) {
|
||||||
|
srv.RegisterService("containerd.task.v2.Task", &ttrpc.ServiceDesc{
|
||||||
|
Methods: map[string]ttrpc.Method{
|
||||||
|
"State": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req StateRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.State(ctx, &req)
|
||||||
|
},
|
||||||
|
"Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req CreateTaskRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Create(ctx, &req)
|
||||||
|
},
|
||||||
|
"Start": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req StartRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Start(ctx, &req)
|
||||||
|
},
|
||||||
|
"Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req DeleteRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Delete(ctx, &req)
|
||||||
|
},
|
||||||
|
"Pids": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req PidsRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Pids(ctx, &req)
|
||||||
|
},
|
||||||
|
"Pause": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req PauseRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Pause(ctx, &req)
|
||||||
|
},
|
||||||
|
"Resume": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ResumeRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Resume(ctx, &req)
|
||||||
|
},
|
||||||
|
"Checkpoint": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req CheckpointTaskRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Checkpoint(ctx, &req)
|
||||||
|
},
|
||||||
|
"Kill": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req KillRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Kill(ctx, &req)
|
||||||
|
},
|
||||||
|
"Exec": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ExecProcessRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Exec(ctx, &req)
|
||||||
|
},
|
||||||
|
"ResizePty": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ResizePtyRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.ResizePty(ctx, &req)
|
||||||
|
},
|
||||||
|
"CloseIO": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req CloseIORequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.CloseIO(ctx, &req)
|
||||||
|
},
|
||||||
|
"Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req UpdateTaskRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Update(ctx, &req)
|
||||||
|
},
|
||||||
|
"Wait": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req WaitRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Wait(ctx, &req)
|
||||||
|
},
|
||||||
|
"Stats": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req StatsRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Stats(ctx, &req)
|
||||||
|
},
|
||||||
|
"Connect": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ConnectRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Connect(ctx, &req)
|
||||||
|
},
|
||||||
|
"Shutdown": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ShutdownRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Shutdown(ctx, &req)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
type taskClient struct {
|
||||||
|
client *ttrpc.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewTaskClient(client *ttrpc.Client) TaskService {
|
||||||
|
return &taskClient{
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) State(ctx context.Context, req *StateRequest) (*StateResponse, error) {
|
||||||
|
var resp StateResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "State", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Create(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) {
|
||||||
|
var resp CreateTaskResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Create", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Start(ctx context.Context, req *StartRequest) (*StartResponse, error) {
|
||||||
|
var resp StartResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Start", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error) {
|
||||||
|
var resp DeleteResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Delete", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Pids(ctx context.Context, req *PidsRequest) (*PidsResponse, error) {
|
||||||
|
var resp PidsResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Pids", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Pause(ctx context.Context, req *PauseRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Pause", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Resume(ctx context.Context, req *ResumeRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Resume", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Checkpoint", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Kill(ctx context.Context, req *KillRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Kill", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Exec(ctx context.Context, req *ExecProcessRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Exec", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) ResizePty(ctx context.Context, req *ResizePtyRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "ResizePty", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) CloseIO(ctx context.Context, req *CloseIORequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "CloseIO", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Update(ctx context.Context, req *UpdateTaskRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Update", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Wait(ctx context.Context, req *WaitRequest) (*WaitResponse, error) {
|
||||||
|
var resp WaitResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Wait", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Stats(ctx context.Context, req *StatsRequest) (*StatsResponse, error) {
|
||||||
|
var resp StatsResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Stats", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Connect(ctx context.Context, req *ConnectRequest) (*ConnectResponse, error) {
|
||||||
|
var resp ConnectResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Connect", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *taskClient) Shutdown(ctx context.Context, req *ShutdownRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.task.v2.Task", "Shutdown", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
310
api/services/containers/v1/containers_grpc.pb.go
Normal file
310
api/services/containers/v1/containers_grpc.pb.go
Normal file
@ -0,0 +1,310 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package containers
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// ContainersClient is the client API for Containers service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type ContainersClient interface {
|
||||||
|
Get(ctx context.Context, in *GetContainerRequest, opts ...grpc.CallOption) (*GetContainerResponse, error)
|
||||||
|
List(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error)
|
||||||
|
ListStream(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (Containers_ListStreamClient, error)
|
||||||
|
Create(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error)
|
||||||
|
Update(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error)
|
||||||
|
Delete(ctx context.Context, in *DeleteContainerRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type containersClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewContainersClient(cc grpc.ClientConnInterface) ContainersClient {
|
||||||
|
return &containersClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *containersClient) Get(ctx context.Context, in *GetContainerRequest, opts ...grpc.CallOption) (*GetContainerResponse, error) {
|
||||||
|
out := new(GetContainerResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Get", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *containersClient) List(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) {
|
||||||
|
out := new(ListContainersResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/List", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *containersClient) ListStream(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (Containers_ListStreamClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &Containers_ServiceDesc.Streams[0], "/containerd.services.containers.v1.Containers/ListStream", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &containersListStreamClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Containers_ListStreamClient interface {
|
||||||
|
Recv() (*ListContainerMessage, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type containersListStreamClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *containersListStreamClient) Recv() (*ListContainerMessage, error) {
|
||||||
|
m := new(ListContainerMessage)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *containersClient) Create(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) {
|
||||||
|
out := new(CreateContainerResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Create", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *containersClient) Update(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error) {
|
||||||
|
out := new(UpdateContainerResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Update", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *containersClient) Delete(ctx context.Context, in *DeleteContainerRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Delete", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContainersServer is the server API for Containers service.
|
||||||
|
// All implementations must embed UnimplementedContainersServer
|
||||||
|
// for forward compatibility
|
||||||
|
type ContainersServer interface {
|
||||||
|
Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error)
|
||||||
|
List(context.Context, *ListContainersRequest) (*ListContainersResponse, error)
|
||||||
|
ListStream(*ListContainersRequest, Containers_ListStreamServer) error
|
||||||
|
Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error)
|
||||||
|
Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error)
|
||||||
|
Delete(context.Context, *DeleteContainerRequest) (*empty.Empty, error)
|
||||||
|
mustEmbedUnimplementedContainersServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedContainersServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedContainersServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedContainersServer) Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContainersServer) List(context.Context, *ListContainersRequest) (*ListContainersResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContainersServer) ListStream(*ListContainersRequest, Containers_ListStreamServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method ListStream not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContainersServer) Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContainersServer) Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContainersServer) Delete(context.Context, *DeleteContainerRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContainersServer) mustEmbedUnimplementedContainersServer() {}
|
||||||
|
|
||||||
|
// UnsafeContainersServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to ContainersServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeContainersServer interface {
|
||||||
|
mustEmbedUnimplementedContainersServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterContainersServer(s grpc.ServiceRegistrar, srv ContainersServer) {
|
||||||
|
s.RegisterService(&Containers_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Containers_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetContainerRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContainersServer).Get(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.containers.v1.Containers/Get",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContainersServer).Get(ctx, req.(*GetContainerRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Containers_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListContainersRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContainersServer).List(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.containers.v1.Containers/List",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContainersServer).List(ctx, req.(*ListContainersRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Containers_ListStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(ListContainersRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(ContainersServer).ListStream(m, &containersListStreamServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Containers_ListStreamServer interface {
|
||||||
|
Send(*ListContainerMessage) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type containersListStreamServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *containersListStreamServer) Send(m *ListContainerMessage) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Containers_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateContainerRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContainersServer).Create(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.containers.v1.Containers/Create",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContainersServer).Create(ctx, req.(*CreateContainerRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Containers_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateContainerRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContainersServer).Update(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.containers.v1.Containers/Update",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContainersServer).Update(ctx, req.(*UpdateContainerRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Containers_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteContainerRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContainersServer).Delete(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.containers.v1.Containers/Delete",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContainersServer).Delete(ctx, req.(*DeleteContainerRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Containers_ServiceDesc is the grpc.ServiceDesc for Containers service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Containers_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.containers.v1.Containers",
|
||||||
|
HandlerType: (*ContainersServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Get",
|
||||||
|
Handler: _Containers_Get_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "List",
|
||||||
|
Handler: _Containers_List_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Create",
|
||||||
|
Handler: _Containers_Create_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Update",
|
||||||
|
Handler: _Containers_Update_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Delete",
|
||||||
|
Handler: _Containers_Delete_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "ListStream",
|
||||||
|
Handler: _Containers_ListStream_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/containers/v1/containers.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
565
api/services/content/v1/content_grpc.pb.go
Normal file
565
api/services/content/v1/content_grpc.pb.go
Normal file
@ -0,0 +1,565 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package content
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// ContentClient is the client API for Content service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type ContentClient interface {
|
||||||
|
// Info returns information about a committed object.
|
||||||
|
//
|
||||||
|
// This call can be used for getting the size of content and checking for
|
||||||
|
// existence.
|
||||||
|
Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
|
||||||
|
// Update updates content metadata.
|
||||||
|
//
|
||||||
|
// This call can be used to manage the mutable content labels. The
|
||||||
|
// immutable metadata such as digest, size, and committed at cannot
|
||||||
|
// be updated.
|
||||||
|
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
|
||||||
|
// List streams the entire set of content as Info objects and closes the
|
||||||
|
// stream.
|
||||||
|
//
|
||||||
|
// Typically, this will yield a large response, chunked into messages.
|
||||||
|
// Clients should make provisions to ensure they can handle the entire data
|
||||||
|
// set.
|
||||||
|
List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error)
|
||||||
|
// Delete will delete the referenced object.
|
||||||
|
Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
// Read allows one to read an object based on the offset into the content.
|
||||||
|
//
|
||||||
|
// The requested data may be returned in one or more messages.
|
||||||
|
Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error)
|
||||||
|
// Status returns the status for a single reference.
|
||||||
|
Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||||||
|
// ListStatuses returns the status of ongoing object ingestions, started via
|
||||||
|
// Write.
|
||||||
|
//
|
||||||
|
// Only those matching the regular expression will be provided in the
|
||||||
|
// response. If the provided regular expression is empty, all ingestions
|
||||||
|
// will be provided.
|
||||||
|
ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error)
|
||||||
|
// Write begins or resumes writes to a resource identified by a unique ref.
|
||||||
|
// Only one active stream may exist at a time for each ref.
|
||||||
|
//
|
||||||
|
// Once a write stream has started, it may only write to a single ref, thus
|
||||||
|
// once a stream is started, the ref may be omitted on subsequent writes.
|
||||||
|
//
|
||||||
|
// For any write transaction represented by a ref, only a single write may
|
||||||
|
// be made to a given offset. If overlapping writes occur, it is an error.
|
||||||
|
// Writes should be sequential and implementations may throw an error if
|
||||||
|
// this is required.
|
||||||
|
//
|
||||||
|
// If expected_digest is set and already part of the content store, the
|
||||||
|
// write will fail.
|
||||||
|
//
|
||||||
|
// When completed, the commit flag should be set to true. If expected size
|
||||||
|
// or digest is set, the content will be validated against those values.
|
||||||
|
Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error)
|
||||||
|
// Abort cancels the ongoing write named in the request. Any resources
|
||||||
|
// associated with the write will be collected.
|
||||||
|
Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type contentClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewContentClient(cc grpc.ClientConnInterface) ContentClient {
|
||||||
|
return &contentClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
|
||||||
|
out := new(InfoResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Info", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) {
|
||||||
|
out := new(UpdateResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Update", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[0], "/containerd.services.content.v1.Content/List", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &contentListClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Content_ListClient interface {
|
||||||
|
Recv() (*ListContentResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type contentListClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentListClient) Recv() (*ListContentResponse, error) {
|
||||||
|
m := new(ListContentResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Delete", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[1], "/containerd.services.content.v1.Content/Read", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &contentReadClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Content_ReadClient interface {
|
||||||
|
Recv() (*ReadContentResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type contentReadClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentReadClient) Recv() (*ReadContentResponse, error) {
|
||||||
|
m := new(ReadContentResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||||||
|
out := new(StatusResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Status", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error) {
|
||||||
|
out := new(ListStatusesResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/ListStatuses", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &Content_ServiceDesc.Streams[2], "/containerd.services.content.v1.Content/Write", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &contentWriteClient{stream}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Content_WriteClient interface {
|
||||||
|
Send(*WriteContentRequest) error
|
||||||
|
Recv() (*WriteContentResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type contentWriteClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentWriteClient) Send(m *WriteContentRequest) error {
|
||||||
|
return x.ClientStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentWriteClient) Recv() (*WriteContentResponse, error) {
|
||||||
|
m := new(WriteContentResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *contentClient) Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Abort", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ContentServer is the server API for Content service.
|
||||||
|
// All implementations must embed UnimplementedContentServer
|
||||||
|
// for forward compatibility
|
||||||
|
type ContentServer interface {
|
||||||
|
// Info returns information about a committed object.
|
||||||
|
//
|
||||||
|
// This call can be used for getting the size of content and checking for
|
||||||
|
// existence.
|
||||||
|
Info(context.Context, *InfoRequest) (*InfoResponse, error)
|
||||||
|
// Update updates content metadata.
|
||||||
|
//
|
||||||
|
// This call can be used to manage the mutable content labels. The
|
||||||
|
// immutable metadata such as digest, size, and committed at cannot
|
||||||
|
// be updated.
|
||||||
|
Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
|
||||||
|
// List streams the entire set of content as Info objects and closes the
|
||||||
|
// stream.
|
||||||
|
//
|
||||||
|
// Typically, this will yield a large response, chunked into messages.
|
||||||
|
// Clients should make provisions to ensure they can handle the entire data
|
||||||
|
// set.
|
||||||
|
List(*ListContentRequest, Content_ListServer) error
|
||||||
|
// Delete will delete the referenced object.
|
||||||
|
Delete(context.Context, *DeleteContentRequest) (*empty.Empty, error)
|
||||||
|
// Read allows one to read an object based on the offset into the content.
|
||||||
|
//
|
||||||
|
// The requested data may be returned in one or more messages.
|
||||||
|
Read(*ReadContentRequest, Content_ReadServer) error
|
||||||
|
// Status returns the status for a single reference.
|
||||||
|
Status(context.Context, *StatusRequest) (*StatusResponse, error)
|
||||||
|
// ListStatuses returns the status of ongoing object ingestions, started via
|
||||||
|
// Write.
|
||||||
|
//
|
||||||
|
// Only those matching the regular expression will be provided in the
|
||||||
|
// response. If the provided regular expression is empty, all ingestions
|
||||||
|
// will be provided.
|
||||||
|
ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error)
|
||||||
|
// Write begins or resumes writes to a resource identified by a unique ref.
|
||||||
|
// Only one active stream may exist at a time for each ref.
|
||||||
|
//
|
||||||
|
// Once a write stream has started, it may only write to a single ref, thus
|
||||||
|
// once a stream is started, the ref may be omitted on subsequent writes.
|
||||||
|
//
|
||||||
|
// For any write transaction represented by a ref, only a single write may
|
||||||
|
// be made to a given offset. If overlapping writes occur, it is an error.
|
||||||
|
// Writes should be sequential and implementations may throw an error if
|
||||||
|
// this is required.
|
||||||
|
//
|
||||||
|
// If expected_digest is set and already part of the content store, the
|
||||||
|
// write will fail.
|
||||||
|
//
|
||||||
|
// When completed, the commit flag should be set to true. If expected size
|
||||||
|
// or digest is set, the content will be validated against those values.
|
||||||
|
Write(Content_WriteServer) error
|
||||||
|
// Abort cancels the ongoing write named in the request. Any resources
|
||||||
|
// associated with the write will be collected.
|
||||||
|
Abort(context.Context, *AbortRequest) (*empty.Empty, error)
|
||||||
|
mustEmbedUnimplementedContentServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedContentServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedContentServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedContentServer) Info(context.Context, *InfoRequest) (*InfoResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) List(*ListContentRequest, Content_ListServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) Delete(context.Context, *DeleteContentRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) Read(*ReadContentRequest, Content_ReadServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method Read not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListStatuses not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) Write(Content_WriteServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method Write not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) Abort(context.Context, *AbortRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Abort not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedContentServer) mustEmbedUnimplementedContentServer() {}
|
||||||
|
|
||||||
|
// UnsafeContentServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to ContentServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeContentServer interface {
|
||||||
|
mustEmbedUnimplementedContentServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterContentServer(s grpc.ServiceRegistrar, srv ContentServer) {
|
||||||
|
s.RegisterService(&Content_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(InfoRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContentServer).Info(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.content.v1.Content/Info",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContentServer).Info(ctx, req.(*InfoRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContentServer).Update(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.content.v1.Content/Update",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContentServer).Update(ctx, req.(*UpdateRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_List_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(ListContentRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(ContentServer).List(m, &contentListServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Content_ListServer interface {
|
||||||
|
Send(*ListContentResponse) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type contentListServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentListServer) Send(m *ListContentResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteContentRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContentServer).Delete(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.content.v1.Content/Delete",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContentServer).Delete(ctx, req.(*DeleteContentRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_Read_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(ReadContentRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(ContentServer).Read(m, &contentReadServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Content_ReadServer interface {
|
||||||
|
Send(*ReadContentResponse) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type contentReadServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentReadServer) Send(m *ReadContentResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StatusRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContentServer).Status(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.content.v1.Content/Status",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContentServer).Status(ctx, req.(*StatusRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_ListStatuses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListStatusesRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContentServer).ListStatuses(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.content.v1.Content/ListStatuses",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContentServer).ListStatuses(ctx, req.(*ListStatusesRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_Write_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
return srv.(ContentServer).Write(&contentWriteServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Content_WriteServer interface {
|
||||||
|
Send(*WriteContentResponse) error
|
||||||
|
Recv() (*WriteContentRequest, error)
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type contentWriteServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentWriteServer) Send(m *WriteContentResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *contentWriteServer) Recv() (*WriteContentRequest, error) {
|
||||||
|
m := new(WriteContentRequest)
|
||||||
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Content_Abort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(AbortRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ContentServer).Abort(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.content.v1.Content/Abort",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ContentServer).Abort(ctx, req.(*AbortRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Content_ServiceDesc is the grpc.ServiceDesc for Content service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Content_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.content.v1.Content",
|
||||||
|
HandlerType: (*ContentServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Info",
|
||||||
|
Handler: _Content_Info_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Update",
|
||||||
|
Handler: _Content_Update_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Delete",
|
||||||
|
Handler: _Content_Delete_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Status",
|
||||||
|
Handler: _Content_Status_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListStatuses",
|
||||||
|
Handler: _Content_ListStatuses_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Abort",
|
||||||
|
Handler: _Content_Abort_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "List",
|
||||||
|
Handler: _Content_List_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
StreamName: "Read",
|
||||||
|
Handler: _Content_Read_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
StreamName: "Write",
|
||||||
|
Handler: _Content_Write_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
ClientStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/content/v1/content.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
147
api/services/diff/v1/diff_grpc.pb.go
Normal file
147
api/services/diff/v1/diff_grpc.pb.go
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package diff
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// DiffClient is the client API for Diff service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type DiffClient interface {
|
||||||
|
// Apply applies the content associated with the provided digests onto
|
||||||
|
// the provided mounts. Archive content will be extracted and
|
||||||
|
// decompressed if necessary.
|
||||||
|
Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error)
|
||||||
|
// Diff creates a diff between the given mounts and uploads the result
|
||||||
|
// to the content store.
|
||||||
|
Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type diffClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDiffClient(cc grpc.ClientConnInterface) DiffClient {
|
||||||
|
return &diffClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *diffClient) Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) {
|
||||||
|
out := new(ApplyResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Apply", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *diffClient) Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) {
|
||||||
|
out := new(DiffResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Diff", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DiffServer is the server API for Diff service.
|
||||||
|
// All implementations must embed UnimplementedDiffServer
|
||||||
|
// for forward compatibility
|
||||||
|
type DiffServer interface {
|
||||||
|
// Apply applies the content associated with the provided digests onto
|
||||||
|
// the provided mounts. Archive content will be extracted and
|
||||||
|
// decompressed if necessary.
|
||||||
|
Apply(context.Context, *ApplyRequest) (*ApplyResponse, error)
|
||||||
|
// Diff creates a diff between the given mounts and uploads the result
|
||||||
|
// to the content store.
|
||||||
|
Diff(context.Context, *DiffRequest) (*DiffResponse, error)
|
||||||
|
mustEmbedUnimplementedDiffServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedDiffServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedDiffServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedDiffServer) Apply(context.Context, *ApplyRequest) (*ApplyResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Apply not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDiffServer) Diff(context.Context, *DiffRequest) (*DiffResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Diff not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedDiffServer) mustEmbedUnimplementedDiffServer() {}
|
||||||
|
|
||||||
|
// UnsafeDiffServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to DiffServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeDiffServer interface {
|
||||||
|
mustEmbedUnimplementedDiffServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterDiffServer(s grpc.ServiceRegistrar, srv DiffServer) {
|
||||||
|
s.RegisterService(&Diff_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Diff_Apply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ApplyRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DiffServer).Apply(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.diff.v1.Diff/Apply",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DiffServer).Apply(ctx, req.(*ApplyRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Diff_Diff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DiffRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(DiffServer).Diff(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.diff.v1.Diff/Diff",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(DiffServer).Diff(ctx, req.(*DiffRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Diff_ServiceDesc is the grpc.ServiceDesc for Diff service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Diff_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.diff.v1.Diff",
|
||||||
|
HandlerType: (*DiffServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Apply",
|
||||||
|
Handler: _Diff_Apply_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Diff",
|
||||||
|
Handler: _Diff_Diff_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/diff/v1/diff.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
234
api/services/events/v1/events_grpc.pb.go
Normal file
234
api/services/events/v1/events_grpc.pb.go
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// EventsClient is the client API for Events service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type EventsClient interface {
|
||||||
|
// Publish an event to a topic.
|
||||||
|
//
|
||||||
|
// The event will be packed into a timestamp envelope with the namespace
|
||||||
|
// introspected from the context. The envelope will then be dispatched.
|
||||||
|
Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
// Forward sends an event that has already been packaged into an envelope
|
||||||
|
// with a timestamp and namespace.
|
||||||
|
//
|
||||||
|
// This is useful if earlier timestamping is required or when forwarding on
|
||||||
|
// behalf of another component, namespace or publisher.
|
||||||
|
Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
// Subscribe to a stream of events, possibly returning only that match any
|
||||||
|
// of the provided filters.
|
||||||
|
//
|
||||||
|
// Unlike many other methods in containerd, subscribers will get messages
|
||||||
|
// from all namespaces unless otherwise specified. If this is not desired,
|
||||||
|
// a filter can be provided in the format 'namespace==<namespace>' to
|
||||||
|
// restrict the received events.
|
||||||
|
Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type eventsClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewEventsClient(cc grpc.ClientConnInterface) EventsClient {
|
||||||
|
return &eventsClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *eventsClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Publish", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *eventsClient) Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Forward", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *eventsClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &Events_ServiceDesc.Streams[0], "/containerd.services.events.v1.Events/Subscribe", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &eventsSubscribeClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Events_SubscribeClient interface {
|
||||||
|
Recv() (*Envelope, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type eventsSubscribeClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *eventsSubscribeClient) Recv() (*Envelope, error) {
|
||||||
|
m := new(Envelope)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// EventsServer is the server API for Events service.
|
||||||
|
// All implementations must embed UnimplementedEventsServer
|
||||||
|
// for forward compatibility
|
||||||
|
type EventsServer interface {
|
||||||
|
// Publish an event to a topic.
|
||||||
|
//
|
||||||
|
// The event will be packed into a timestamp envelope with the namespace
|
||||||
|
// introspected from the context. The envelope will then be dispatched.
|
||||||
|
Publish(context.Context, *PublishRequest) (*empty.Empty, error)
|
||||||
|
// Forward sends an event that has already been packaged into an envelope
|
||||||
|
// with a timestamp and namespace.
|
||||||
|
//
|
||||||
|
// This is useful if earlier timestamping is required or when forwarding on
|
||||||
|
// behalf of another component, namespace or publisher.
|
||||||
|
Forward(context.Context, *ForwardRequest) (*empty.Empty, error)
|
||||||
|
// Subscribe to a stream of events, possibly returning only that match any
|
||||||
|
// of the provided filters.
|
||||||
|
//
|
||||||
|
// Unlike many other methods in containerd, subscribers will get messages
|
||||||
|
// from all namespaces unless otherwise specified. If this is not desired,
|
||||||
|
// a filter can be provided in the format 'namespace==<namespace>' to
|
||||||
|
// restrict the received events.
|
||||||
|
Subscribe(*SubscribeRequest, Events_SubscribeServer) error
|
||||||
|
mustEmbedUnimplementedEventsServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedEventsServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedEventsServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedEventsServer) Publish(context.Context, *PublishRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedEventsServer) Forward(context.Context, *ForwardRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Forward not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedEventsServer) Subscribe(*SubscribeRequest, Events_SubscribeServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedEventsServer) mustEmbedUnimplementedEventsServer() {}
|
||||||
|
|
||||||
|
// UnsafeEventsServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to EventsServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeEventsServer interface {
|
||||||
|
mustEmbedUnimplementedEventsServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterEventsServer(s grpc.ServiceRegistrar, srv EventsServer) {
|
||||||
|
s.RegisterService(&Events_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Events_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(PublishRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(EventsServer).Publish(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.events.v1.Events/Publish",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(EventsServer).Publish(ctx, req.(*PublishRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Events_Forward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ForwardRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(EventsServer).Forward(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.events.v1.Events/Forward",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(EventsServer).Forward(ctx, req.(*ForwardRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Events_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(SubscribeRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(EventsServer).Subscribe(m, &eventsSubscribeServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Events_SubscribeServer interface {
|
||||||
|
Send(*Envelope) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type eventsSubscribeServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *eventsSubscribeServer) Send(m *Envelope) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Events_ServiceDesc is the grpc.ServiceDesc for Events service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Events_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.events.v1.Events",
|
||||||
|
HandlerType: (*EventsServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Publish",
|
||||||
|
Handler: _Events_Publish_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Forward",
|
||||||
|
Handler: _Events_Forward_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "Subscribe",
|
||||||
|
Handler: _Events_Subscribe_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/events/v1/events.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
262
api/services/images/v1/images_grpc.pb.go
Normal file
262
api/services/images/v1/images_grpc.pb.go
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package images
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// ImagesClient is the client API for Images service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type ImagesClient interface {
|
||||||
|
// Get returns an image by name.
|
||||||
|
Get(ctx context.Context, in *GetImageRequest, opts ...grpc.CallOption) (*GetImageResponse, error)
|
||||||
|
// List returns a list of all images known to containerd.
|
||||||
|
List(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error)
|
||||||
|
// Create an image record in the metadata store.
|
||||||
|
//
|
||||||
|
// The name of the image must be unique.
|
||||||
|
Create(ctx context.Context, in *CreateImageRequest, opts ...grpc.CallOption) (*CreateImageResponse, error)
|
||||||
|
// Update assigns the name to a given target image based on the provided
|
||||||
|
// image.
|
||||||
|
Update(ctx context.Context, in *UpdateImageRequest, opts ...grpc.CallOption) (*UpdateImageResponse, error)
|
||||||
|
// Delete deletes the image by name.
|
||||||
|
Delete(ctx context.Context, in *DeleteImageRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type imagesClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewImagesClient(cc grpc.ClientConnInterface) ImagesClient {
|
||||||
|
return &imagesClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *imagesClient) Get(ctx context.Context, in *GetImageRequest, opts ...grpc.CallOption) (*GetImageResponse, error) {
|
||||||
|
out := new(GetImageResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Get", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *imagesClient) List(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) {
|
||||||
|
out := new(ListImagesResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/List", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *imagesClient) Create(ctx context.Context, in *CreateImageRequest, opts ...grpc.CallOption) (*CreateImageResponse, error) {
|
||||||
|
out := new(CreateImageResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Create", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *imagesClient) Update(ctx context.Context, in *UpdateImageRequest, opts ...grpc.CallOption) (*UpdateImageResponse, error) {
|
||||||
|
out := new(UpdateImageResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Update", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *imagesClient) Delete(ctx context.Context, in *DeleteImageRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Delete", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ImagesServer is the server API for Images service.
|
||||||
|
// All implementations must embed UnimplementedImagesServer
|
||||||
|
// for forward compatibility
|
||||||
|
type ImagesServer interface {
|
||||||
|
// Get returns an image by name.
|
||||||
|
Get(context.Context, *GetImageRequest) (*GetImageResponse, error)
|
||||||
|
// List returns a list of all images known to containerd.
|
||||||
|
List(context.Context, *ListImagesRequest) (*ListImagesResponse, error)
|
||||||
|
// Create an image record in the metadata store.
|
||||||
|
//
|
||||||
|
// The name of the image must be unique.
|
||||||
|
Create(context.Context, *CreateImageRequest) (*CreateImageResponse, error)
|
||||||
|
// Update assigns the name to a given target image based on the provided
|
||||||
|
// image.
|
||||||
|
Update(context.Context, *UpdateImageRequest) (*UpdateImageResponse, error)
|
||||||
|
// Delete deletes the image by name.
|
||||||
|
Delete(context.Context, *DeleteImageRequest) (*empty.Empty, error)
|
||||||
|
mustEmbedUnimplementedImagesServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedImagesServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedImagesServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedImagesServer) Get(context.Context, *GetImageRequest) (*GetImageResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedImagesServer) List(context.Context, *ListImagesRequest) (*ListImagesResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedImagesServer) Create(context.Context, *CreateImageRequest) (*CreateImageResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedImagesServer) Update(context.Context, *UpdateImageRequest) (*UpdateImageResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedImagesServer) Delete(context.Context, *DeleteImageRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedImagesServer) mustEmbedUnimplementedImagesServer() {}
|
||||||
|
|
||||||
|
// UnsafeImagesServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to ImagesServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeImagesServer interface {
|
||||||
|
mustEmbedUnimplementedImagesServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterImagesServer(s grpc.ServiceRegistrar, srv ImagesServer) {
|
||||||
|
s.RegisterService(&Images_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Images_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetImageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ImagesServer).Get(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.images.v1.Images/Get",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ImagesServer).Get(ctx, req.(*GetImageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Images_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListImagesRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ImagesServer).List(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.images.v1.Images/List",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ImagesServer).List(ctx, req.(*ListImagesRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Images_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateImageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ImagesServer).Create(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.images.v1.Images/Create",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ImagesServer).Create(ctx, req.(*CreateImageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Images_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateImageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ImagesServer).Update(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.images.v1.Images/Update",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ImagesServer).Update(ctx, req.(*UpdateImageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Images_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteImageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ImagesServer).Delete(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.images.v1.Images/Delete",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ImagesServer).Delete(ctx, req.(*DeleteImageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Images_ServiceDesc is the grpc.ServiceDesc for Images service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Images_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.images.v1.Images",
|
||||||
|
HandlerType: (*ImagesServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Get",
|
||||||
|
Handler: _Images_Get_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "List",
|
||||||
|
Handler: _Images_List_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Create",
|
||||||
|
Handler: _Images_Create_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Update",
|
||||||
|
Handler: _Images_Update_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Delete",
|
||||||
|
Handler: _Images_Delete_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/images/v1/images.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
148
api/services/introspection/v1/introspection_grpc.pb.go
Normal file
148
api/services/introspection/v1/introspection_grpc.pb.go
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package introspection
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// IntrospectionClient is the client API for Introspection service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type IntrospectionClient interface {
|
||||||
|
// Plugins returns a list of plugins in containerd.
|
||||||
|
//
|
||||||
|
// Clients can use this to detect features and capabilities when using
|
||||||
|
// containerd.
|
||||||
|
Plugins(ctx context.Context, in *PluginsRequest, opts ...grpc.CallOption) (*PluginsResponse, error)
|
||||||
|
// Server returns information about the containerd server
|
||||||
|
Server(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ServerResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type introspectionClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewIntrospectionClient(cc grpc.ClientConnInterface) IntrospectionClient {
|
||||||
|
return &introspectionClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *introspectionClient) Plugins(ctx context.Context, in *PluginsRequest, opts ...grpc.CallOption) (*PluginsResponse, error) {
|
||||||
|
out := new(PluginsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.introspection.v1.Introspection/Plugins", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *introspectionClient) Server(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ServerResponse, error) {
|
||||||
|
out := new(ServerResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.introspection.v1.Introspection/Server", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// IntrospectionServer is the server API for Introspection service.
|
||||||
|
// All implementations must embed UnimplementedIntrospectionServer
|
||||||
|
// for forward compatibility
|
||||||
|
type IntrospectionServer interface {
|
||||||
|
// Plugins returns a list of plugins in containerd.
|
||||||
|
//
|
||||||
|
// Clients can use this to detect features and capabilities when using
|
||||||
|
// containerd.
|
||||||
|
Plugins(context.Context, *PluginsRequest) (*PluginsResponse, error)
|
||||||
|
// Server returns information about the containerd server
|
||||||
|
Server(context.Context, *empty.Empty) (*ServerResponse, error)
|
||||||
|
mustEmbedUnimplementedIntrospectionServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedIntrospectionServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedIntrospectionServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedIntrospectionServer) Plugins(context.Context, *PluginsRequest) (*PluginsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Plugins not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedIntrospectionServer) Server(context.Context, *empty.Empty) (*ServerResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Server not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedIntrospectionServer) mustEmbedUnimplementedIntrospectionServer() {}
|
||||||
|
|
||||||
|
// UnsafeIntrospectionServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to IntrospectionServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeIntrospectionServer interface {
|
||||||
|
mustEmbedUnimplementedIntrospectionServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterIntrospectionServer(s grpc.ServiceRegistrar, srv IntrospectionServer) {
|
||||||
|
s.RegisterService(&Introspection_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Introspection_Plugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(PluginsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(IntrospectionServer).Plugins(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.introspection.v1.Introspection/Plugins",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(IntrospectionServer).Plugins(ctx, req.(*PluginsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Introspection_Server_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(empty.Empty)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(IntrospectionServer).Server(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.introspection.v1.Introspection/Server",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(IntrospectionServer).Server(ctx, req.(*empty.Empty))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Introspection_ServiceDesc is the grpc.ServiceDesc for Introspection service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Introspection_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.introspection.v1.Introspection",
|
||||||
|
HandlerType: (*IntrospectionServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Plugins",
|
||||||
|
Handler: _Introspection_Plugins_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Server",
|
||||||
|
Handler: _Introspection_Server_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/introspection/v1/introspection.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
302
api/services/leases/v1/leases_grpc.pb.go
Normal file
302
api/services/leases/v1/leases_grpc.pb.go
Normal file
@ -0,0 +1,302 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package leases
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// LeasesClient is the client API for Leases service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type LeasesClient interface {
|
||||||
|
// Create creates a new lease for managing changes to metadata. A lease
|
||||||
|
// can be used to protect objects from being removed.
|
||||||
|
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
|
||||||
|
// Delete deletes the lease and makes any unreferenced objects created
|
||||||
|
// during the lease eligible for garbage collection if not referenced
|
||||||
|
// or retained by other resources during the lease.
|
||||||
|
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
// List lists all active leases, returning the full list of
|
||||||
|
// leases and optionally including the referenced resources.
|
||||||
|
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
|
||||||
|
// AddResource references the resource by the provided lease.
|
||||||
|
AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
// DeleteResource dereferences the resource by the provided lease.
|
||||||
|
DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
// ListResources lists all the resources referenced by the lease.
|
||||||
|
ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type leasesClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLeasesClient(cc grpc.ClientConnInterface) LeasesClient {
|
||||||
|
return &leasesClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *leasesClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
|
||||||
|
out := new(CreateResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/Create", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *leasesClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/Delete", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *leasesClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
|
||||||
|
out := new(ListResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/List", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *leasesClient) AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/AddResource", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *leasesClient) DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/DeleteResource", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *leasesClient) ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) {
|
||||||
|
out := new(ListResourcesResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/ListResources", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// LeasesServer is the server API for Leases service.
|
||||||
|
// All implementations must embed UnimplementedLeasesServer
|
||||||
|
// for forward compatibility
|
||||||
|
type LeasesServer interface {
|
||||||
|
// Create creates a new lease for managing changes to metadata. A lease
|
||||||
|
// can be used to protect objects from being removed.
|
||||||
|
Create(context.Context, *CreateRequest) (*CreateResponse, error)
|
||||||
|
// Delete deletes the lease and makes any unreferenced objects created
|
||||||
|
// during the lease eligible for garbage collection if not referenced
|
||||||
|
// or retained by other resources during the lease.
|
||||||
|
Delete(context.Context, *DeleteRequest) (*empty.Empty, error)
|
||||||
|
// List lists all active leases, returning the full list of
|
||||||
|
// leases and optionally including the referenced resources.
|
||||||
|
List(context.Context, *ListRequest) (*ListResponse, error)
|
||||||
|
// AddResource references the resource by the provided lease.
|
||||||
|
AddResource(context.Context, *AddResourceRequest) (*empty.Empty, error)
|
||||||
|
// DeleteResource dereferences the resource by the provided lease.
|
||||||
|
DeleteResource(context.Context, *DeleteResourceRequest) (*empty.Empty, error)
|
||||||
|
// ListResources lists all the resources referenced by the lease.
|
||||||
|
ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error)
|
||||||
|
mustEmbedUnimplementedLeasesServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedLeasesServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedLeasesServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedLeasesServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLeasesServer) Delete(context.Context, *DeleteRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLeasesServer) List(context.Context, *ListRequest) (*ListResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLeasesServer) AddResource(context.Context, *AddResourceRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method AddResource not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLeasesServer) DeleteResource(context.Context, *DeleteResourceRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteResource not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLeasesServer) ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedLeasesServer) mustEmbedUnimplementedLeasesServer() {}
|
||||||
|
|
||||||
|
// UnsafeLeasesServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to LeasesServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeLeasesServer interface {
|
||||||
|
mustEmbedUnimplementedLeasesServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterLeasesServer(s grpc.ServiceRegistrar, srv LeasesServer) {
|
||||||
|
s.RegisterService(&Leases_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Leases_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LeasesServer).Create(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.leases.v1.Leases/Create",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LeasesServer).Create(ctx, req.(*CreateRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Leases_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LeasesServer).Delete(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.leases.v1.Leases/Delete",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LeasesServer).Delete(ctx, req.(*DeleteRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Leases_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LeasesServer).List(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.leases.v1.Leases/List",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LeasesServer).List(ctx, req.(*ListRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Leases_AddResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(AddResourceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LeasesServer).AddResource(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.leases.v1.Leases/AddResource",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LeasesServer).AddResource(ctx, req.(*AddResourceRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Leases_DeleteResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteResourceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LeasesServer).DeleteResource(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.leases.v1.Leases/DeleteResource",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LeasesServer).DeleteResource(ctx, req.(*DeleteResourceRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Leases_ListResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListResourcesRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(LeasesServer).ListResources(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.leases.v1.Leases/ListResources",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(LeasesServer).ListResources(ctx, req.(*ListResourcesRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Leases_ServiceDesc is the grpc.ServiceDesc for Leases service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Leases_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.leases.v1.Leases",
|
||||||
|
HandlerType: (*LeasesServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Create",
|
||||||
|
Handler: _Leases_Create_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Delete",
|
||||||
|
Handler: _Leases_Delete_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "List",
|
||||||
|
Handler: _Leases_List_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "AddResource",
|
||||||
|
Handler: _Leases_AddResource_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteResource",
|
||||||
|
Handler: _Leases_DeleteResource_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListResources",
|
||||||
|
Handler: _Leases_ListResources_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/leases/v1/leases.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
246
api/services/namespaces/v1/namespace_grpc.pb.go
Normal file
246
api/services/namespaces/v1/namespace_grpc.pb.go
Normal file
@ -0,0 +1,246 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package namespaces
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// NamespacesClient is the client API for Namespaces service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type NamespacesClient interface {
|
||||||
|
Get(ctx context.Context, in *GetNamespaceRequest, opts ...grpc.CallOption) (*GetNamespaceResponse, error)
|
||||||
|
List(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error)
|
||||||
|
Create(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*CreateNamespaceResponse, error)
|
||||||
|
Update(ctx context.Context, in *UpdateNamespaceRequest, opts ...grpc.CallOption) (*UpdateNamespaceResponse, error)
|
||||||
|
Delete(ctx context.Context, in *DeleteNamespaceRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type namespacesClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewNamespacesClient(cc grpc.ClientConnInterface) NamespacesClient {
|
||||||
|
return &namespacesClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *namespacesClient) Get(ctx context.Context, in *GetNamespaceRequest, opts ...grpc.CallOption) (*GetNamespaceResponse, error) {
|
||||||
|
out := new(GetNamespaceResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Get", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *namespacesClient) List(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error) {
|
||||||
|
out := new(ListNamespacesResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/List", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *namespacesClient) Create(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*CreateNamespaceResponse, error) {
|
||||||
|
out := new(CreateNamespaceResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Create", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *namespacesClient) Update(ctx context.Context, in *UpdateNamespaceRequest, opts ...grpc.CallOption) (*UpdateNamespaceResponse, error) {
|
||||||
|
out := new(UpdateNamespaceResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Update", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *namespacesClient) Delete(ctx context.Context, in *DeleteNamespaceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Delete", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NamespacesServer is the server API for Namespaces service.
|
||||||
|
// All implementations must embed UnimplementedNamespacesServer
|
||||||
|
// for forward compatibility
|
||||||
|
type NamespacesServer interface {
|
||||||
|
Get(context.Context, *GetNamespaceRequest) (*GetNamespaceResponse, error)
|
||||||
|
List(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error)
|
||||||
|
Create(context.Context, *CreateNamespaceRequest) (*CreateNamespaceResponse, error)
|
||||||
|
Update(context.Context, *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error)
|
||||||
|
Delete(context.Context, *DeleteNamespaceRequest) (*empty.Empty, error)
|
||||||
|
mustEmbedUnimplementedNamespacesServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedNamespacesServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedNamespacesServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedNamespacesServer) Get(context.Context, *GetNamespaceRequest) (*GetNamespaceResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedNamespacesServer) List(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedNamespacesServer) Create(context.Context, *CreateNamespaceRequest) (*CreateNamespaceResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedNamespacesServer) Update(context.Context, *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedNamespacesServer) Delete(context.Context, *DeleteNamespaceRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedNamespacesServer) mustEmbedUnimplementedNamespacesServer() {}
|
||||||
|
|
||||||
|
// UnsafeNamespacesServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to NamespacesServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeNamespacesServer interface {
|
||||||
|
mustEmbedUnimplementedNamespacesServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterNamespacesServer(s grpc.ServiceRegistrar, srv NamespacesServer) {
|
||||||
|
s.RegisterService(&Namespaces_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Namespaces_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetNamespaceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(NamespacesServer).Get(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.namespaces.v1.Namespaces/Get",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(NamespacesServer).Get(ctx, req.(*GetNamespaceRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Namespaces_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListNamespacesRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(NamespacesServer).List(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.namespaces.v1.Namespaces/List",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(NamespacesServer).List(ctx, req.(*ListNamespacesRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Namespaces_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateNamespaceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(NamespacesServer).Create(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.namespaces.v1.Namespaces/Create",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(NamespacesServer).Create(ctx, req.(*CreateNamespaceRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Namespaces_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateNamespaceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(NamespacesServer).Update(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.namespaces.v1.Namespaces/Update",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(NamespacesServer).Update(ctx, req.(*UpdateNamespaceRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Namespaces_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteNamespaceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(NamespacesServer).Delete(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.namespaces.v1.Namespaces/Delete",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(NamespacesServer).Delete(ctx, req.(*DeleteNamespaceRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Namespaces_ServiceDesc is the grpc.ServiceDesc for Namespaces service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Namespaces_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.namespaces.v1.Namespaces",
|
||||||
|
HandlerType: (*NamespacesServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Get",
|
||||||
|
Handler: _Namespaces_Get_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "List",
|
||||||
|
Handler: _Namespaces_List_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Create",
|
||||||
|
Handler: _Namespaces_Create_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Update",
|
||||||
|
Handler: _Namespaces_Update_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Delete",
|
||||||
|
Handler: _Namespaces_Delete_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
439
api/services/sandbox/v1/sandbox_grpc.pb.go
Normal file
439
api/services/sandbox/v1/sandbox_grpc.pb.go
Normal file
@ -0,0 +1,439 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package sandbox
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// StoreClient is the client API for Store service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type StoreClient interface {
|
||||||
|
Create(ctx context.Context, in *StoreCreateRequest, opts ...grpc.CallOption) (*StoreCreateResponse, error)
|
||||||
|
Update(ctx context.Context, in *StoreUpdateRequest, opts ...grpc.CallOption) (*StoreUpdateResponse, error)
|
||||||
|
Delete(ctx context.Context, in *StoreDeleteRequest, opts ...grpc.CallOption) (*StoreDeleteResponse, error)
|
||||||
|
List(ctx context.Context, in *StoreListRequest, opts ...grpc.CallOption) (*StoreListResponse, error)
|
||||||
|
Get(ctx context.Context, in *StoreGetRequest, opts ...grpc.CallOption) (*StoreGetResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type storeClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewStoreClient(cc grpc.ClientConnInterface) StoreClient {
|
||||||
|
return &storeClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *storeClient) Create(ctx context.Context, in *StoreCreateRequest, opts ...grpc.CallOption) (*StoreCreateResponse, error) {
|
||||||
|
out := new(StoreCreateResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Create", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *storeClient) Update(ctx context.Context, in *StoreUpdateRequest, opts ...grpc.CallOption) (*StoreUpdateResponse, error) {
|
||||||
|
out := new(StoreUpdateResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Update", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *storeClient) Delete(ctx context.Context, in *StoreDeleteRequest, opts ...grpc.CallOption) (*StoreDeleteResponse, error) {
|
||||||
|
out := new(StoreDeleteResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Delete", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *storeClient) List(ctx context.Context, in *StoreListRequest, opts ...grpc.CallOption) (*StoreListResponse, error) {
|
||||||
|
out := new(StoreListResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/List", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *storeClient) Get(ctx context.Context, in *StoreGetRequest, opts ...grpc.CallOption) (*StoreGetResponse, error) {
|
||||||
|
out := new(StoreGetResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Store/Get", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StoreServer is the server API for Store service.
|
||||||
|
// All implementations must embed UnimplementedStoreServer
|
||||||
|
// for forward compatibility
|
||||||
|
type StoreServer interface {
|
||||||
|
Create(context.Context, *StoreCreateRequest) (*StoreCreateResponse, error)
|
||||||
|
Update(context.Context, *StoreUpdateRequest) (*StoreUpdateResponse, error)
|
||||||
|
Delete(context.Context, *StoreDeleteRequest) (*StoreDeleteResponse, error)
|
||||||
|
List(context.Context, *StoreListRequest) (*StoreListResponse, error)
|
||||||
|
Get(context.Context, *StoreGetRequest) (*StoreGetResponse, error)
|
||||||
|
mustEmbedUnimplementedStoreServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedStoreServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedStoreServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedStoreServer) Create(context.Context, *StoreCreateRequest) (*StoreCreateResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedStoreServer) Update(context.Context, *StoreUpdateRequest) (*StoreUpdateResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedStoreServer) Delete(context.Context, *StoreDeleteRequest) (*StoreDeleteResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedStoreServer) List(context.Context, *StoreListRequest) (*StoreListResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedStoreServer) Get(context.Context, *StoreGetRequest) (*StoreGetResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedStoreServer) mustEmbedUnimplementedStoreServer() {}
|
||||||
|
|
||||||
|
// UnsafeStoreServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to StoreServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeStoreServer interface {
|
||||||
|
mustEmbedUnimplementedStoreServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterStoreServer(s grpc.ServiceRegistrar, srv StoreServer) {
|
||||||
|
s.RegisterService(&Store_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Store_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StoreCreateRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(StoreServer).Create(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Store/Create",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(StoreServer).Create(ctx, req.(*StoreCreateRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Store_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StoreUpdateRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(StoreServer).Update(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Store/Update",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(StoreServer).Update(ctx, req.(*StoreUpdateRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Store_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StoreDeleteRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(StoreServer).Delete(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Store/Delete",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(StoreServer).Delete(ctx, req.(*StoreDeleteRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Store_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StoreListRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(StoreServer).List(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Store/List",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(StoreServer).List(ctx, req.(*StoreListRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Store_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StoreGetRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(StoreServer).Get(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Store/Get",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(StoreServer).Get(ctx, req.(*StoreGetRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store_ServiceDesc is the grpc.ServiceDesc for Store service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Store_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.sandbox.v1.Store",
|
||||||
|
HandlerType: (*StoreServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Create",
|
||||||
|
Handler: _Store_Create_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Update",
|
||||||
|
Handler: _Store_Update_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Delete",
|
||||||
|
Handler: _Store_Delete_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "List",
|
||||||
|
Handler: _Store_List_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Get",
|
||||||
|
Handler: _Store_Get_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
// ControllerClient is the client API for Controller service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type ControllerClient interface {
|
||||||
|
Start(ctx context.Context, in *ControllerStartRequest, opts ...grpc.CallOption) (*ControllerStartResponse, error)
|
||||||
|
Shutdown(ctx context.Context, in *ControllerShutdownRequest, opts ...grpc.CallOption) (*ControllerShutdownResponse, error)
|
||||||
|
Wait(ctx context.Context, in *ControllerWaitRequest, opts ...grpc.CallOption) (*ControllerWaitResponse, error)
|
||||||
|
Status(ctx context.Context, in *ControllerStatusRequest, opts ...grpc.CallOption) (*ControllerStatusResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type controllerClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewControllerClient(cc grpc.ClientConnInterface) ControllerClient {
|
||||||
|
return &controllerClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *controllerClient) Start(ctx context.Context, in *ControllerStartRequest, opts ...grpc.CallOption) (*ControllerStartResponse, error) {
|
||||||
|
out := new(ControllerStartResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Start", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *controllerClient) Shutdown(ctx context.Context, in *ControllerShutdownRequest, opts ...grpc.CallOption) (*ControllerShutdownResponse, error) {
|
||||||
|
out := new(ControllerShutdownResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Shutdown", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *controllerClient) Wait(ctx context.Context, in *ControllerWaitRequest, opts ...grpc.CallOption) (*ControllerWaitResponse, error) {
|
||||||
|
out := new(ControllerWaitResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Wait", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *controllerClient) Status(ctx context.Context, in *ControllerStatusRequest, opts ...grpc.CallOption) (*ControllerStatusResponse, error) {
|
||||||
|
out := new(ControllerStatusResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.sandbox.v1.Controller/Status", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ControllerServer is the server API for Controller service.
|
||||||
|
// All implementations must embed UnimplementedControllerServer
|
||||||
|
// for forward compatibility
|
||||||
|
type ControllerServer interface {
|
||||||
|
Start(context.Context, *ControllerStartRequest) (*ControllerStartResponse, error)
|
||||||
|
Shutdown(context.Context, *ControllerShutdownRequest) (*ControllerShutdownResponse, error)
|
||||||
|
Wait(context.Context, *ControllerWaitRequest) (*ControllerWaitResponse, error)
|
||||||
|
Status(context.Context, *ControllerStatusRequest) (*ControllerStatusResponse, error)
|
||||||
|
mustEmbedUnimplementedControllerServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedControllerServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedControllerServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedControllerServer) Start(context.Context, *ControllerStartRequest) (*ControllerStartResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedControllerServer) Shutdown(context.Context, *ControllerShutdownRequest) (*ControllerShutdownResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Shutdown not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedControllerServer) Wait(context.Context, *ControllerWaitRequest) (*ControllerWaitResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Wait not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedControllerServer) Status(context.Context, *ControllerStatusRequest) (*ControllerStatusResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedControllerServer) mustEmbedUnimplementedControllerServer() {}
|
||||||
|
|
||||||
|
// UnsafeControllerServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to ControllerServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeControllerServer interface {
|
||||||
|
mustEmbedUnimplementedControllerServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterControllerServer(s grpc.ServiceRegistrar, srv ControllerServer) {
|
||||||
|
s.RegisterService(&Controller_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Controller_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ControllerStartRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ControllerServer).Start(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Controller/Start",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ControllerServer).Start(ctx, req.(*ControllerStartRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Controller_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ControllerShutdownRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ControllerServer).Shutdown(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Controller/Shutdown",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ControllerServer).Shutdown(ctx, req.(*ControllerShutdownRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Controller_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ControllerWaitRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ControllerServer).Wait(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Controller/Wait",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ControllerServer).Wait(ctx, req.(*ControllerWaitRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Controller_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ControllerStatusRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ControllerServer).Status(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.sandbox.v1.Controller/Status",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ControllerServer).Status(ctx, req.(*ControllerStatusRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Controller_ServiceDesc is the grpc.ServiceDesc for Controller service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Controller_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.sandbox.v1.Controller",
|
||||||
|
HandlerType: (*ControllerServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Start",
|
||||||
|
Handler: _Controller_Start_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Shutdown",
|
||||||
|
Handler: _Controller_Shutdown_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Wait",
|
||||||
|
Handler: _Controller_Wait_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Status",
|
||||||
|
Handler: _Controller_Status_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/sandbox/v1/sandbox.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
454
api/services/snapshots/v1/snapshots_grpc.pb.go
Normal file
454
api/services/snapshots/v1/snapshots_grpc.pb.go
Normal file
@ -0,0 +1,454 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package snapshots
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// SnapshotsClient is the client API for Snapshots service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type SnapshotsClient interface {
|
||||||
|
Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error)
|
||||||
|
View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error)
|
||||||
|
Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error)
|
||||||
|
Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error)
|
||||||
|
Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error)
|
||||||
|
List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error)
|
||||||
|
Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error)
|
||||||
|
Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type snapshotsClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSnapshotsClient(cc grpc.ClientConnInterface) SnapshotsClient {
|
||||||
|
return &snapshotsClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) {
|
||||||
|
out := new(PrepareSnapshotResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Prepare", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) {
|
||||||
|
out := new(ViewSnapshotResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/View", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) {
|
||||||
|
out := new(MountsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Mounts", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Commit", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Remove", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) {
|
||||||
|
out := new(StatSnapshotResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Stat", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) {
|
||||||
|
out := new(UpdateSnapshotResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Update", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &Snapshots_ServiceDesc.Streams[0], "/containerd.services.snapshots.v1.Snapshots/List", opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &snapshotsListClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type Snapshots_ListClient interface {
|
||||||
|
Recv() (*ListSnapshotsResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type snapshotsListClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *snapshotsListClient) Recv() (*ListSnapshotsResponse, error) {
|
||||||
|
m := new(ListSnapshotsResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) {
|
||||||
|
out := new(UsageResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Usage", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *snapshotsClient) Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Cleanup", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SnapshotsServer is the server API for Snapshots service.
|
||||||
|
// All implementations must embed UnimplementedSnapshotsServer
|
||||||
|
// for forward compatibility
|
||||||
|
type SnapshotsServer interface {
|
||||||
|
Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error)
|
||||||
|
View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error)
|
||||||
|
Mounts(context.Context, *MountsRequest) (*MountsResponse, error)
|
||||||
|
Commit(context.Context, *CommitSnapshotRequest) (*empty.Empty, error)
|
||||||
|
Remove(context.Context, *RemoveSnapshotRequest) (*empty.Empty, error)
|
||||||
|
Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error)
|
||||||
|
Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error)
|
||||||
|
List(*ListSnapshotsRequest, Snapshots_ListServer) error
|
||||||
|
Usage(context.Context, *UsageRequest) (*UsageResponse, error)
|
||||||
|
Cleanup(context.Context, *CleanupRequest) (*empty.Empty, error)
|
||||||
|
mustEmbedUnimplementedSnapshotsServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedSnapshotsServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedSnapshotsServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedSnapshotsServer) Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Prepare not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method View not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) Mounts(context.Context, *MountsRequest) (*MountsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Mounts not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) Commit(context.Context, *CommitSnapshotRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) Remove(context.Context, *RemoveSnapshotRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Stat not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) List(*ListSnapshotsRequest, Snapshots_ListServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) Usage(context.Context, *UsageRequest) (*UsageResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) Cleanup(context.Context, *CleanupRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Cleanup not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedSnapshotsServer) mustEmbedUnimplementedSnapshotsServer() {}
|
||||||
|
|
||||||
|
// UnsafeSnapshotsServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to SnapshotsServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeSnapshotsServer interface {
|
||||||
|
mustEmbedUnimplementedSnapshotsServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterSnapshotsServer(s grpc.ServiceRegistrar, srv SnapshotsServer) {
|
||||||
|
s.RegisterService(&Snapshots_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Prepare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(PrepareSnapshotRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Prepare(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Prepare",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Prepare(ctx, req.(*PrepareSnapshotRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_View_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ViewSnapshotRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).View(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/View",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).View(ctx, req.(*ViewSnapshotRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Mounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MountsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Mounts(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Mounts",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Mounts(ctx, req.(*MountsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CommitSnapshotRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Commit(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Commit",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Commit(ctx, req.(*CommitSnapshotRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(RemoveSnapshotRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Remove(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Remove",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Remove(ctx, req.(*RemoveSnapshotRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StatSnapshotRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Stat(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Stat",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Stat(ctx, req.(*StatSnapshotRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateSnapshotRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Update(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Update",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Update(ctx, req.(*UpdateSnapshotRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_List_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(ListSnapshotsRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(SnapshotsServer).List(m, &snapshotsListServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type Snapshots_ListServer interface {
|
||||||
|
Send(*ListSnapshotsResponse) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type snapshotsListServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *snapshotsListServer) Send(m *ListSnapshotsResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Usage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UsageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Usage(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Usage",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Usage(ctx, req.(*UsageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Snapshots_Cleanup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CleanupRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(SnapshotsServer).Cleanup(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.snapshots.v1.Snapshots/Cleanup",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(SnapshotsServer).Cleanup(ctx, req.(*CleanupRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Snapshots_ServiceDesc is the grpc.ServiceDesc for Snapshots service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Snapshots_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.snapshots.v1.Snapshots",
|
||||||
|
HandlerType: (*SnapshotsServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Prepare",
|
||||||
|
Handler: _Snapshots_Prepare_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "View",
|
||||||
|
Handler: _Snapshots_View_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Mounts",
|
||||||
|
Handler: _Snapshots_Mounts_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Commit",
|
||||||
|
Handler: _Snapshots_Commit_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Remove",
|
||||||
|
Handler: _Snapshots_Remove_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Stat",
|
||||||
|
Handler: _Snapshots_Stat_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Update",
|
||||||
|
Handler: _Snapshots_Update_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Usage",
|
||||||
|
Handler: _Snapshots_Usage_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Cleanup",
|
||||||
|
Handler: _Snapshots_Cleanup_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "List",
|
||||||
|
Handler: _Snapshots_List_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
686
api/services/tasks/v1/tasks_grpc.pb.go
Normal file
686
api/services/tasks/v1/tasks_grpc.pb.go
Normal file
@ -0,0 +1,686 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package tasks
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// TasksClient is the client API for Tasks service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type TasksClient interface {
|
||||||
|
// Create a task.
|
||||||
|
Create(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error)
|
||||||
|
// Start a process.
|
||||||
|
Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error)
|
||||||
|
// Delete a task and on disk state.
|
||||||
|
Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
||||||
|
DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
||||||
|
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
|
||||||
|
List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error)
|
||||||
|
// Kill a task or process.
|
||||||
|
Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
Exec(ctx context.Context, in *ExecProcessRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
ResizePty(ctx context.Context, in *ResizePtyRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
CloseIO(ctx context.Context, in *CloseIORequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
Pause(ctx context.Context, in *PauseTaskRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
Resume(ctx context.Context, in *ResumeTaskRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
ListPids(ctx context.Context, in *ListPidsRequest, opts ...grpc.CallOption) (*ListPidsResponse, error)
|
||||||
|
Checkpoint(ctx context.Context, in *CheckpointTaskRequest, opts ...grpc.CallOption) (*CheckpointTaskResponse, error)
|
||||||
|
Update(ctx context.Context, in *UpdateTaskRequest, opts ...grpc.CallOption) (*empty.Empty, error)
|
||||||
|
Metrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsResponse, error)
|
||||||
|
Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type tasksClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewTasksClient(cc grpc.ClientConnInterface) TasksClient {
|
||||||
|
return &tasksClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Create(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error) {
|
||||||
|
out := new(CreateTaskResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Create", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) {
|
||||||
|
out := new(StartResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Start", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
|
||||||
|
out := new(DeleteResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Delete", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
|
||||||
|
out := new(DeleteResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/DeleteProcess", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
|
||||||
|
out := new(GetResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Get", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) {
|
||||||
|
out := new(ListTasksResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/List", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Kill", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Exec(ctx context.Context, in *ExecProcessRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Exec", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) ResizePty(ctx context.Context, in *ResizePtyRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/ResizePty", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) CloseIO(ctx context.Context, in *CloseIORequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/CloseIO", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Pause(ctx context.Context, in *PauseTaskRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Pause", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Resume(ctx context.Context, in *ResumeTaskRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Resume", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) ListPids(ctx context.Context, in *ListPidsRequest, opts ...grpc.CallOption) (*ListPidsResponse, error) {
|
||||||
|
out := new(ListPidsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/ListPids", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Checkpoint(ctx context.Context, in *CheckpointTaskRequest, opts ...grpc.CallOption) (*CheckpointTaskResponse, error) {
|
||||||
|
out := new(CheckpointTaskResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Checkpoint", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Update(ctx context.Context, in *UpdateTaskRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
|
||||||
|
out := new(empty.Empty)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Update", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Metrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsResponse, error) {
|
||||||
|
out := new(MetricsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Metrics", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *tasksClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error) {
|
||||||
|
out := new(WaitResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Wait", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// TasksServer is the server API for Tasks service.
|
||||||
|
// All implementations must embed UnimplementedTasksServer
|
||||||
|
// for forward compatibility
|
||||||
|
type TasksServer interface {
|
||||||
|
// Create a task.
|
||||||
|
Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error)
|
||||||
|
// Start a process.
|
||||||
|
Start(context.Context, *StartRequest) (*StartResponse, error)
|
||||||
|
// Delete a task and on disk state.
|
||||||
|
Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error)
|
||||||
|
DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error)
|
||||||
|
Get(context.Context, *GetRequest) (*GetResponse, error)
|
||||||
|
List(context.Context, *ListTasksRequest) (*ListTasksResponse, error)
|
||||||
|
// Kill a task or process.
|
||||||
|
Kill(context.Context, *KillRequest) (*empty.Empty, error)
|
||||||
|
Exec(context.Context, *ExecProcessRequest) (*empty.Empty, error)
|
||||||
|
ResizePty(context.Context, *ResizePtyRequest) (*empty.Empty, error)
|
||||||
|
CloseIO(context.Context, *CloseIORequest) (*empty.Empty, error)
|
||||||
|
Pause(context.Context, *PauseTaskRequest) (*empty.Empty, error)
|
||||||
|
Resume(context.Context, *ResumeTaskRequest) (*empty.Empty, error)
|
||||||
|
ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error)
|
||||||
|
Checkpoint(context.Context, *CheckpointTaskRequest) (*CheckpointTaskResponse, error)
|
||||||
|
Update(context.Context, *UpdateTaskRequest) (*empty.Empty, error)
|
||||||
|
Metrics(context.Context, *MetricsRequest) (*MetricsResponse, error)
|
||||||
|
Wait(context.Context, *WaitRequest) (*WaitResponse, error)
|
||||||
|
mustEmbedUnimplementedTasksServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedTasksServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedTasksServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedTasksServer) Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Start(context.Context, *StartRequest) (*StartResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteProcess not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Get(context.Context, *GetRequest) (*GetResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) List(context.Context, *ListTasksRequest) (*ListTasksResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Kill(context.Context, *KillRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Kill not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Exec(context.Context, *ExecProcessRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) ResizePty(context.Context, *ResizePtyRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ResizePty not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) CloseIO(context.Context, *CloseIORequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CloseIO not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Pause(context.Context, *PauseTaskRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Resume(context.Context, *ResumeTaskRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Resume not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListPids not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Checkpoint(context.Context, *CheckpointTaskRequest) (*CheckpointTaskResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Checkpoint not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Update(context.Context, *UpdateTaskRequest) (*empty.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Metrics(context.Context, *MetricsRequest) (*MetricsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Metrics not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) Wait(context.Context, *WaitRequest) (*WaitResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Wait not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedTasksServer) mustEmbedUnimplementedTasksServer() {}
|
||||||
|
|
||||||
|
// UnsafeTasksServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to TasksServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeTasksServer interface {
|
||||||
|
mustEmbedUnimplementedTasksServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterTasksServer(s grpc.ServiceRegistrar, srv TasksServer) {
|
||||||
|
s.RegisterService(&Tasks_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateTaskRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Create(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Create",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Create(ctx, req.(*CreateTaskRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(StartRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Start(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Start",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Start(ctx, req.(*StartRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteTaskRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Delete(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Delete",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Delete(ctx, req.(*DeleteTaskRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_DeleteProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteProcessRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).DeleteProcess(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/DeleteProcess",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).DeleteProcess(ctx, req.(*DeleteProcessRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Get(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Get",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Get(ctx, req.(*GetRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListTasksRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).List(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/List",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).List(ctx, req.(*ListTasksRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(KillRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Kill(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Kill",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Kill(ctx, req.(*KillRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ExecProcessRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Exec(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Exec",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Exec(ctx, req.(*ExecProcessRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_ResizePty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ResizePtyRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).ResizePty(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/ResizePty",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).ResizePty(ctx, req.(*ResizePtyRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_CloseIO_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CloseIORequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).CloseIO(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/CloseIO",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).CloseIO(ctx, req.(*CloseIORequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(PauseTaskRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Pause(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Pause",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Pause(ctx, req.(*PauseTaskRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Resume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ResumeTaskRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Resume(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Resume",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Resume(ctx, req.(*ResumeTaskRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_ListPids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListPidsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).ListPids(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/ListPids",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).ListPids(ctx, req.(*ListPidsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Checkpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CheckpointTaskRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Checkpoint(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Checkpoint",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Checkpoint(ctx, req.(*CheckpointTaskRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateTaskRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Update(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Update",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Update(ctx, req.(*UpdateTaskRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Metrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MetricsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Metrics(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Metrics",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Metrics(ctx, req.(*MetricsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Tasks_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(WaitRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(TasksServer).Wait(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.tasks.v1.Tasks/Wait",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(TasksServer).Wait(ctx, req.(*WaitRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tasks_ServiceDesc is the grpc.ServiceDesc for Tasks service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Tasks_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.tasks.v1.Tasks",
|
||||||
|
HandlerType: (*TasksServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Create",
|
||||||
|
Handler: _Tasks_Create_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Start",
|
||||||
|
Handler: _Tasks_Start_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Delete",
|
||||||
|
Handler: _Tasks_Delete_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteProcess",
|
||||||
|
Handler: _Tasks_DeleteProcess_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Get",
|
||||||
|
Handler: _Tasks_Get_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "List",
|
||||||
|
Handler: _Tasks_List_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Kill",
|
||||||
|
Handler: _Tasks_Kill_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Exec",
|
||||||
|
Handler: _Tasks_Exec_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ResizePty",
|
||||||
|
Handler: _Tasks_ResizePty_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "CloseIO",
|
||||||
|
Handler: _Tasks_CloseIO_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Pause",
|
||||||
|
Handler: _Tasks_Pause_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Resume",
|
||||||
|
Handler: _Tasks_Resume_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListPids",
|
||||||
|
Handler: _Tasks_ListPids_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Checkpoint",
|
||||||
|
Handler: _Tasks_Checkpoint_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Update",
|
||||||
|
Handler: _Tasks_Update_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Metrics",
|
||||||
|
Handler: _Tasks_Metrics_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Wait",
|
||||||
|
Handler: _Tasks_Wait_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/tasks/v1/tasks.proto",
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
55
api/services/ttrpc/events/v1/events_fieldpath.pb.go
Normal file
55
api/services/ttrpc/events/v1/events_fieldpath.pb.go
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
typeurl "github.com/containerd/typeurl"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *ForwardRequest) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
case "envelope":
|
||||||
|
// NOTE(stevvooe): This is probably not correct in many cases.
|
||||||
|
// We assume that the target message also implements the Field
|
||||||
|
// method, which isn't likely true in a lot of cases.
|
||||||
|
//
|
||||||
|
// If you have a broken build and have found this comment,
|
||||||
|
// you may be closer to a solution.
|
||||||
|
if m.Envelope == nil {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
return m.Envelope.Field(fieldpath[1:])
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Field returns the value for the given fieldpath as a string, if defined.
|
||||||
|
// If the value is not defined, the second value will be false.
|
||||||
|
func (m *Envelope) Field(fieldpath []string) (string, bool) {
|
||||||
|
if len(fieldpath) == 0 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
switch fieldpath[0] {
|
||||||
|
// unhandled: timestamp
|
||||||
|
case "namespace":
|
||||||
|
return string(m.Namespace), len(m.Namespace) > 0
|
||||||
|
case "topic":
|
||||||
|
return string(m.Topic), len(m.Topic) > 0
|
||||||
|
case "event":
|
||||||
|
decoded, err := typeurl.UnmarshalAny(m.Event)
|
||||||
|
if err != nil {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
adaptor, ok := decoded.(interface{ Field([]string) (string, bool) })
|
||||||
|
if !ok {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
return adaptor.Field(fieldpath[1:])
|
||||||
|
}
|
||||||
|
return "", false
|
||||||
|
}
|
45
api/services/ttrpc/events/v1/events_ttrpc.pb.go
Normal file
45
api/services/ttrpc/events/v1/events_ttrpc.pb.go
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto
|
||||||
|
package events
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
ttrpc "github.com/containerd/ttrpc"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
)
|
||||||
|
|
||||||
|
type EventsService interface {
|
||||||
|
Forward(context.Context, *ForwardRequest) (*empty.Empty, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterEventsService(srv *ttrpc.Server, svc EventsService) {
|
||||||
|
srv.RegisterService("containerd.services.events.ttrpc.v1.Events", &ttrpc.ServiceDesc{
|
||||||
|
Methods: map[string]ttrpc.Method{
|
||||||
|
"Forward": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ForwardRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Forward(ctx, &req)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
type eventsClient struct {
|
||||||
|
client *ttrpc.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewEventsClient(client *ttrpc.Client) EventsService {
|
||||||
|
return &eventsClient{
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *eventsClient) Forward(ctx context.Context, req *ForwardRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.services.events.ttrpc.v1.Events", "Forward", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
@ -1,477 +1,189 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
//
|
||||||
|
//Copyright The containerd Authors.
|
||||||
|
//
|
||||||
|
//Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
//you may not use this file except in compliance with the License.
|
||||||
|
//You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
//http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
//Unless required by applicable law or agreed to in writing, software
|
||||||
|
//distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//See the License for the specific language governing permissions and
|
||||||
|
//limitations under the License.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/api/services/version/v1/version.proto
|
// source: github.com/containerd/containerd/api/services/version/v1/version.proto
|
||||||
|
|
||||||
package version
|
package version
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/gogo/protobuf/gogoproto"
|
_ "github.com/gogo/protobuf/gogoproto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
types "github.com/gogo/protobuf/types"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
grpc "google.golang.org/grpc"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
codes "google.golang.org/grpc/codes"
|
|
||||||
status "google.golang.org/grpc/status"
|
|
||||||
io "io"
|
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
)
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
type VersionResponse struct {
|
type VersionResponse struct {
|
||||||
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
state protoimpl.MessageState
|
||||||
Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
|
sizeCache protoimpl.SizeCache
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
unknownFields protoimpl.UnknownFields
|
||||||
XXX_unrecognized []byte `json:"-"`
|
|
||||||
XXX_sizecache int32 `json:"-"`
|
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||||
|
Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *VersionResponse) Reset() {
|
||||||
|
*x = VersionResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *VersionResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *VersionResponse) Reset() { *m = VersionResponse{} }
|
|
||||||
func (*VersionResponse) ProtoMessage() {}
|
func (*VersionResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *VersionResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*VersionResponse) Descriptor() ([]byte, []int) {
|
func (*VersionResponse) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_128109001e578ffe, []int{0}
|
return file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
func (m *VersionResponse) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
func (x *VersionResponse) GetVersion() string {
|
||||||
}
|
if x != nil {
|
||||||
func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
return x.Version
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_VersionResponse.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
}
|
||||||
}
|
return ""
|
||||||
func (m *VersionResponse) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_VersionResponse.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *VersionResponse) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *VersionResponse) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_VersionResponse.DiscardUnknown(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_VersionResponse proto.InternalMessageInfo
|
func (x *VersionResponse) GetRevision() string {
|
||||||
|
if x != nil {
|
||||||
func init() {
|
return x.Revision
|
||||||
proto.RegisterType((*VersionResponse)(nil), "containerd.services.version.v1.VersionResponse")
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
proto.RegisterFile("github.com/containerd/containerd/api/services/version/v1/version.proto", fileDescriptor_128109001e578ffe)
|
|
||||||
}
|
|
||||||
|
|
||||||
var fileDescriptor_128109001e578ffe = []byte{
|
|
||||||
// 241 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4b, 0xcf, 0x2c, 0xc9,
|
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
|
||||||
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb,
|
|
||||||
0x97, 0xa5, 0x16, 0x15, 0x67, 0xe6, 0xe7, 0xe9, 0x97, 0x19, 0xc2, 0x98, 0x7a, 0x05, 0x45, 0xf9,
|
|
||||||
0x25, 0xf9, 0x42, 0x72, 0x08, 0x1d, 0x7a, 0x30, 0xd5, 0x7a, 0x30, 0x25, 0x65, 0x86, 0x52, 0xd2,
|
|
||||||
0xe9, 0xf9, 0xf9, 0xe9, 0x39, 0xa9, 0xfa, 0x60, 0xd5, 0x49, 0xa5, 0x69, 0xfa, 0xa9, 0xb9, 0x05,
|
|
||||||
0x25, 0x95, 0x10, 0xcd, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11,
|
|
||||||
0x55, 0x72, 0xe7, 0xe2, 0x0f, 0x83, 0x18, 0x10, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a,
|
|
||||||
0x24, 0xc1, 0xc5, 0x0e, 0x35, 0x53, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xc6, 0x15, 0x92,
|
|
||||||
0xe2, 0xe2, 0x28, 0x4a, 0x2d, 0xcb, 0x04, 0x4b, 0x31, 0x81, 0xa5, 0xe0, 0x7c, 0xa3, 0x58, 0x2e,
|
|
||||||
0x76, 0xa8, 0x41, 0x42, 0x41, 0x08, 0xa6, 0x98, 0x1e, 0xc4, 0x49, 0x7a, 0x30, 0x27, 0xe9, 0xb9,
|
|
||||||
0x82, 0x9c, 0x24, 0xa5, 0xaf, 0x87, 0xdf, 0x2b, 0x7a, 0x68, 0x8e, 0x72, 0x8a, 0x3a, 0xf1, 0x50,
|
|
||||||
0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78,
|
|
||||||
0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x03, 0xb9, 0x81, 0x6b, 0x0d, 0x65, 0x26, 0xb1,
|
|
||||||
0x81, 0x1d, 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x37, 0xd8, 0xc6, 0xa7, 0x01, 0x00,
|
|
||||||
0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
|
||||||
var _ context.Context
|
|
||||||
var _ grpc.ClientConn
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the grpc package it is being compiled against.
|
|
||||||
const _ = grpc.SupportPackageIsVersion4
|
|
||||||
|
|
||||||
// VersionClient is the client API for Version service.
|
|
||||||
//
|
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
||||||
type VersionClient interface {
|
|
||||||
Version(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*VersionResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type versionClient struct {
|
|
||||||
cc *grpc.ClientConn
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewVersionClient(cc *grpc.ClientConn) VersionClient {
|
|
||||||
return &versionClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *versionClient) Version(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*VersionResponse, error) {
|
|
||||||
out := new(VersionResponse)
|
|
||||||
err := c.cc.Invoke(ctx, "/containerd.services.version.v1.Version/Version", in, out, opts...)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
return out, nil
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// VersionServer is the server API for Version service.
|
var File_github_com_containerd_containerd_api_services_version_v1_version_proto protoreflect.FileDescriptor
|
||||||
type VersionServer interface {
|
|
||||||
Version(context.Context, *types.Empty) (*VersionResponse, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedVersionServer can be embedded to have forward compatible implementations.
|
var file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc = []byte{
|
||||||
type UnimplementedVersionServer struct {
|
0x0a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
}
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f,
|
||||||
func (*UnimplementedVersionServer) Version(ctx context.Context, req *types.Empty) (*VersionResponse, error) {
|
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
|
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||||
}
|
0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x65,
|
||||||
|
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||||
func RegisterVersionServer(s *grpc.Server, srv VersionServer) {
|
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e,
|
||||||
s.RegisterService(&_Version_serviceDesc, srv)
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
}
|
0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x0f, 0x56,
|
||||||
|
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18,
|
||||||
func _Version_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
in := new(types.Empty)
|
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69,
|
||||||
if err := dec(in); err != nil {
|
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69,
|
||||||
return nil, err
|
0x73, 0x69, 0x6f, 0x6e, 0x32, 0x5d, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12,
|
||||||
}
|
0x52, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
|
||||||
if interceptor == nil {
|
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
|
||||||
return srv.(VersionServer).Version(ctx, in)
|
0x74, 0x79, 0x1a, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e,
|
||||||
}
|
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
info := &grpc.UnaryServerInfo{
|
0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
Server: srv,
|
0x6e, 0x73, 0x65, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||||
FullMethod: "/containerd.services.version.v1.Version/Version",
|
0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
}
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76,
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
0x69, 0x63, 0x65, 0x73, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b,
|
||||||
return srv.(VersionServer).Version(ctx, req.(*types.Empty))
|
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
|
||||||
return interceptor(ctx, in, info, handler)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _Version_serviceDesc = grpc.ServiceDesc{
|
|
||||||
ServiceName: "containerd.services.version.v1.Version",
|
|
||||||
HandlerType: (*VersionServer)(nil),
|
|
||||||
Methods: []grpc.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "Version",
|
|
||||||
Handler: _Version_Version_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc.StreamDesc{},
|
|
||||||
Metadata: "github.com/containerd/containerd/api/services/version/v1/version.proto",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *VersionResponse) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *VersionResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *VersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
i -= len(m.XXX_unrecognized)
|
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
if len(m.Revision) > 0 {
|
|
||||||
i -= len(m.Revision)
|
|
||||||
copy(dAtA[i:], m.Revision)
|
|
||||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.Revision)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if len(m.Version) > 0 {
|
|
||||||
i -= len(m.Version)
|
|
||||||
copy(dAtA[i:], m.Version)
|
|
||||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.Version)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintVersion(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovVersion(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *VersionResponse) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.Version)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovVersion(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Revision)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovVersion(uint64(l))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
n += len(m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovVersion(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozVersion(x uint64) (n int) {
|
|
||||||
return sovVersion(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (this *VersionResponse) String() string {
|
|
||||||
if this == nil {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
s := strings.Join([]string{`&VersionResponse{`,
|
|
||||||
`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
|
|
||||||
`Revision:` + fmt.Sprintf("%v", this.Revision) + `,`,
|
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
||||||
`}`,
|
|
||||||
}, "")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
func valueToStringVersion(v interface{}) string {
|
|
||||||
rv := reflect.ValueOf(v)
|
|
||||||
if rv.IsNil() {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
pv := reflect.Indirect(rv).Interface()
|
|
||||||
return fmt.Sprintf("*%v", pv)
|
|
||||||
}
|
|
||||||
func (m *VersionResponse) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowVersion
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: VersionResponse: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: VersionResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowVersion
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthVersion
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthVersion
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Version = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowVersion
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthVersion
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthVersion
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Revision = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipVersion(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthVersion
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipVersion(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowVersion
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowVersion
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowVersion
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthVersion
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupVersion
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthVersion
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthVersion = fmt.Errorf("proto: negative length found during unmarshaling")
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescOnce sync.Once
|
||||||
ErrIntOverflowVersion = fmt.Errorf("proto: integer overflow")
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData = file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc
|
||||||
ErrUnexpectedEndOfGroupVersion = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescGZIP() []byte {
|
||||||
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescOnce.Do(func() {
|
||||||
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_github_com_containerd_containerd_api_services_version_v1_version_proto_goTypes = []interface{}{
|
||||||
|
(*VersionResponse)(nil), // 0: containerd.services.version.v1.VersionResponse
|
||||||
|
(*empty.Empty)(nil), // 1: google.protobuf.Empty
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_api_services_version_v1_version_proto_depIdxs = []int32{
|
||||||
|
1, // 0: containerd.services.version.v1.Version.Version:input_type -> google.protobuf.Empty
|
||||||
|
0, // 1: containerd.services.version.v1.Version.Version:output_type -> containerd.services.version.v1.VersionResponse
|
||||||
|
1, // [1:2] is the sub-list for method output_type
|
||||||
|
0, // [0:1] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_api_services_version_v1_version_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_api_services_version_v1_version_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_api_services_version_v1_version_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*VersionResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_api_services_version_v1_version_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_api_services_version_v1_version_proto_depIdxs,
|
||||||
|
MessageInfos: file_github_com_containerd_containerd_api_services_version_v1_version_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_api_services_version_v1_version_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_api_services_version_v1_version_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
102
api/services/version/v1/version_grpc.pb.go
Normal file
102
api/services/version/v1/version_grpc.pb.go
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
|
||||||
|
package version
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
|
// VersionClient is the client API for Version service.
|
||||||
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
|
type VersionClient interface {
|
||||||
|
Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VersionResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type versionClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewVersionClient(cc grpc.ClientConnInterface) VersionClient {
|
||||||
|
return &versionClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *versionClient) Version(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VersionResponse, error) {
|
||||||
|
out := new(VersionResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/containerd.services.version.v1.Version/Version", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// VersionServer is the server API for Version service.
|
||||||
|
// All implementations must embed UnimplementedVersionServer
|
||||||
|
// for forward compatibility
|
||||||
|
type VersionServer interface {
|
||||||
|
Version(context.Context, *empty.Empty) (*VersionResponse, error)
|
||||||
|
mustEmbedUnimplementedVersionServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedVersionServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedVersionServer struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedVersionServer) Version(context.Context, *empty.Empty) (*VersionResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedVersionServer) mustEmbedUnimplementedVersionServer() {}
|
||||||
|
|
||||||
|
// UnsafeVersionServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to VersionServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeVersionServer interface {
|
||||||
|
mustEmbedUnimplementedVersionServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterVersionServer(s grpc.ServiceRegistrar, srv VersionServer) {
|
||||||
|
s.RegisterService(&Version_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Version_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(empty.Empty)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(VersionServer).Version(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/containerd.services.version.v1.Version/Version",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(VersionServer).Version(ctx, req.(*empty.Empty))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Version_ServiceDesc is the grpc.ServiceDesc for Version service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Version_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "containerd.services.version.v1.Version",
|
||||||
|
HandlerType: (*VersionServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "Version",
|
||||||
|
Handler: _Version_Version_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "github.com/containerd/containerd/api/services/version/v1/version.proto",
|
||||||
|
}
|
@ -1,30 +1,40 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
//
|
||||||
|
//Copyright The containerd Authors.
|
||||||
|
//
|
||||||
|
//Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
//you may not use this file except in compliance with the License.
|
||||||
|
//You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
//http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
//Unless required by applicable law or agreed to in writing, software
|
||||||
|
//distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//See the License for the specific language governing permissions and
|
||||||
|
//limitations under the License.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/api/types/descriptor.proto
|
// source: github.com/containerd/containerd/api/types/descriptor.proto
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/gogo/protobuf/gogoproto"
|
_ "github.com/gogo/protobuf/gogoproto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
io "io"
|
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
)
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
// Descriptor describes a blob in a content store.
|
// Descriptor describes a blob in a content store.
|
||||||
//
|
//
|
||||||
@ -32,565 +42,167 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
// oci descriptor found in a manifest.
|
// oci descriptor found in a manifest.
|
||||||
// See https://godoc.org/github.com/opencontainers/image-spec/specs-go/v1#Descriptor
|
// See https://godoc.org/github.com/opencontainers/image-spec/specs-go/v1#Descriptor
|
||||||
type Descriptor struct {
|
type Descriptor struct {
|
||||||
MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
|
state protoimpl.MessageState
|
||||||
Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"`
|
sizeCache protoimpl.SizeCache
|
||||||
Size_ int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
|
unknownFields protoimpl.UnknownFields
|
||||||
Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
|
||||||
|
Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Descriptor) Reset() {
|
||||||
|
*x = Descriptor{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_descriptor_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Descriptor) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Descriptor) Reset() { *m = Descriptor{} }
|
|
||||||
func (*Descriptor) ProtoMessage() {}
|
func (*Descriptor) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Descriptor) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_descriptor_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Descriptor.ProtoReflect.Descriptor instead.
|
||||||
func (*Descriptor) Descriptor() ([]byte, []int) {
|
func (*Descriptor) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_37f958df3707db9e, []int{0}
|
return file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
|
||||||
func (m *Descriptor) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Descriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Descriptor.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Descriptor) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Descriptor.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Descriptor) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Descriptor) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Descriptor.DiscardUnknown(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_Descriptor proto.InternalMessageInfo
|
func (x *Descriptor) GetMediaType() string {
|
||||||
|
if x != nil {
|
||||||
func init() {
|
return x.MediaType
|
||||||
proto.RegisterType((*Descriptor)(nil), "containerd.types.Descriptor")
|
}
|
||||||
proto.RegisterMapType((map[string]string)(nil), "containerd.types.Descriptor.AnnotationsEntry")
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func (x *Descriptor) GetDigest() string {
|
||||||
proto.RegisterFile("github.com/containerd/containerd/api/types/descriptor.proto", fileDescriptor_37f958df3707db9e)
|
if x != nil {
|
||||||
|
return x.Digest
|
||||||
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_37f958df3707db9e = []byte{
|
func (x *Descriptor) GetSize() int64 {
|
||||||
// 277 bytes of a gzipped FileDescriptorProto
|
if x != nil {
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9,
|
return x.Size
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
}
|
||||||
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0xa4, 0x16,
|
return 0
|
||||||
0x27, 0x17, 0x65, 0x16, 0x94, 0xe4, 0x17, 0xe9, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20,
|
|
||||||
0x94, 0xe9, 0x81, 0x95, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf5, 0x41, 0x2c, 0x88,
|
|
||||||
0x3a, 0xa5, 0x17, 0x8c, 0x5c, 0x5c, 0x2e, 0x70, 0xcd, 0x42, 0xb2, 0x5c, 0x5c, 0xb9, 0xa9, 0x29,
|
|
||||||
0x99, 0x89, 0xf1, 0x20, 0x3d, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x9c, 0x60, 0x91, 0x90,
|
|
||||||
0xca, 0x82, 0x54, 0x21, 0x31, 0x2e, 0xb6, 0x94, 0xcc, 0xf4, 0xd4, 0xe2, 0x12, 0x09, 0x26, 0xb0,
|
|
||||||
0x14, 0x94, 0x27, 0x24, 0xc4, 0xc5, 0x52, 0x9c, 0x59, 0x95, 0x2a, 0xc1, 0xac, 0xc0, 0xa8, 0xc1,
|
|
||||||
0x1c, 0x04, 0x66, 0x0b, 0xf9, 0x73, 0x71, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6,
|
|
||||||
0xe7, 0x15, 0x4b, 0xb0, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0xe9, 0xea, 0xa1, 0xbb, 0x4b, 0x0f, 0x61,
|
|
||||||
0xbb, 0x9e, 0x23, 0x42, 0xbd, 0x6b, 0x5e, 0x49, 0x51, 0x65, 0x10, 0xb2, 0x09, 0x52, 0x76, 0x5c,
|
|
||||||
0x02, 0xe8, 0x0a, 0x84, 0x04, 0xb8, 0x98, 0xb3, 0x53, 0x2b, 0xa1, 0x0e, 0x05, 0x31, 0x85, 0x44,
|
|
||||||
0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0xa1, 0x2e, 0x84, 0x70, 0xac, 0x98, 0x2c, 0x18, 0x9d,
|
|
||||||
0xbc, 0x4e, 0x3c, 0x94, 0x63, 0xb8, 0xf1, 0x50, 0x8e, 0xa1, 0xe1, 0x91, 0x1c, 0xe3, 0x89, 0x47,
|
|
||||||
0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x18, 0x65, 0x40, 0x7c, 0x48, 0x5b,
|
|
||||||
0x83, 0xc9, 0x24, 0x36, 0x70, 0xe8, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x4e, 0xfb,
|
|
||||||
0xcb, 0xa4, 0x01, 0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Descriptor) Marshal() (dAtA []byte, err error) {
|
func (x *Descriptor) GetAnnotations() map[string]string {
|
||||||
size := m.Size()
|
if x != nil {
|
||||||
dAtA = make([]byte, size)
|
return x.Annotations
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Descriptor) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Descriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
i -= len(m.XXX_unrecognized)
|
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
if len(m.Annotations) > 0 {
|
|
||||||
for k := range m.Annotations {
|
|
||||||
v := m.Annotations[k]
|
|
||||||
baseI := i
|
|
||||||
i -= len(v)
|
|
||||||
copy(dAtA[i:], v)
|
|
||||||
i = encodeVarintDescriptor(dAtA, i, uint64(len(v)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
i -= len(k)
|
|
||||||
copy(dAtA[i:], k)
|
|
||||||
i = encodeVarintDescriptor(dAtA, i, uint64(len(k)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
i = encodeVarintDescriptor(dAtA, i, uint64(baseI-i))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x2a
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if m.Size_ != 0 {
|
|
||||||
i = encodeVarintDescriptor(dAtA, i, uint64(m.Size_))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x18
|
|
||||||
}
|
|
||||||
if len(m.Digest) > 0 {
|
|
||||||
i -= len(m.Digest)
|
|
||||||
copy(dAtA[i:], m.Digest)
|
|
||||||
i = encodeVarintDescriptor(dAtA, i, uint64(len(m.Digest)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if len(m.MediaType) > 0 {
|
|
||||||
i -= len(m.MediaType)
|
|
||||||
copy(dAtA[i:], m.MediaType)
|
|
||||||
i = encodeVarintDescriptor(dAtA, i, uint64(len(m.MediaType)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintDescriptor(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovDescriptor(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Descriptor) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.MediaType)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovDescriptor(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Digest)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovDescriptor(uint64(l))
|
|
||||||
}
|
|
||||||
if m.Size_ != 0 {
|
|
||||||
n += 1 + sovDescriptor(uint64(m.Size_))
|
|
||||||
}
|
|
||||||
if len(m.Annotations) > 0 {
|
|
||||||
for k, v := range m.Annotations {
|
|
||||||
_ = k
|
|
||||||
_ = v
|
|
||||||
mapEntrySize := 1 + len(k) + sovDescriptor(uint64(len(k))) + 1 + len(v) + sovDescriptor(uint64(len(v)))
|
|
||||||
n += mapEntrySize + 1 + sovDescriptor(uint64(mapEntrySize))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
n += len(m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovDescriptor(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozDescriptor(x uint64) (n int) {
|
|
||||||
return sovDescriptor(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (this *Descriptor) String() string {
|
|
||||||
if this == nil {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
|
||||||
for k, _ := range this.Annotations {
|
|
||||||
keysForAnnotations = append(keysForAnnotations, k)
|
|
||||||
}
|
|
||||||
github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations)
|
|
||||||
mapStringForAnnotations := "map[string]string{"
|
|
||||||
for _, k := range keysForAnnotations {
|
|
||||||
mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k])
|
|
||||||
}
|
|
||||||
mapStringForAnnotations += "}"
|
|
||||||
s := strings.Join([]string{`&Descriptor{`,
|
|
||||||
`MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`,
|
|
||||||
`Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
|
|
||||||
`Size_:` + fmt.Sprintf("%v", this.Size_) + `,`,
|
|
||||||
`Annotations:` + mapStringForAnnotations + `,`,
|
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
||||||
`}`,
|
|
||||||
}, "")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
func valueToStringDescriptor(v interface{}) string {
|
|
||||||
rv := reflect.ValueOf(v)
|
|
||||||
if rv.IsNil() {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
pv := reflect.Indirect(rv).Interface()
|
|
||||||
return fmt.Sprintf("*%v", pv)
|
|
||||||
}
|
|
||||||
func (m *Descriptor) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Descriptor: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Descriptor: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.MediaType = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Digest = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
|
|
||||||
}
|
|
||||||
m.Size_ = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.Size_ |= int64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if m.Annotations == nil {
|
|
||||||
m.Annotations = make(map[string]string)
|
|
||||||
}
|
|
||||||
var mapkey string
|
|
||||||
var mapvalue string
|
|
||||||
for iNdEx < postIndex {
|
|
||||||
entryPreIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
if fieldNum == 1 {
|
|
||||||
var stringLenmapkey uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLenmapkey |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLenmapkey := int(stringLenmapkey)
|
|
||||||
if intStringLenmapkey < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
|
||||||
if postStringIndexmapkey < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if postStringIndexmapkey > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
|
|
||||||
iNdEx = postStringIndexmapkey
|
|
||||||
} else if fieldNum == 2 {
|
|
||||||
var stringLenmapvalue uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLenmapvalue |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLenmapvalue := int(stringLenmapvalue)
|
|
||||||
if intStringLenmapvalue < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
|
|
||||||
if postStringIndexmapvalue < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if postStringIndexmapvalue > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
|
|
||||||
iNdEx = postStringIndexmapvalue
|
|
||||||
} else {
|
|
||||||
iNdEx = entryPreIndex
|
|
||||||
skippy, err := skipDescriptor(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > postIndex {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.Annotations[mapkey] = mapvalue
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipDescriptor(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func skipDescriptor(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
var File_github_com_containerd_containerd_api_types_descriptor_proto protoreflect.FileDescriptor
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
var file_github_com_containerd_containerd_api_types_descriptor_proto_rawDesc = []byte{
|
||||||
for iNdEx < l {
|
0x0a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
var wire uint64
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
for shift := uint(0); ; shift += 7 {
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x73,
|
||||||
if shift >= 64 {
|
0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63,
|
||||||
return 0, ErrIntOverflowDescriptor
|
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a,
|
||||||
}
|
0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e,
|
||||||
if iNdEx >= l {
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe8, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,
|
||||||
return 0, io.ErrUnexpectedEOF
|
0x70, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x74, 0x79,
|
||||||
}
|
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54,
|
||||||
b := dAtA[iNdEx]
|
0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20,
|
||||||
iNdEx++
|
0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73,
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12,
|
||||||
if b < 0x80 {
|
0x4f, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05,
|
||||||
break
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||||
}
|
0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
|
||||||
}
|
0x6f, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e,
|
||||||
wireType := int(wire & 0x7)
|
0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||||
switch wireType {
|
0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45,
|
||||||
case 0:
|
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
for shift := uint(0); ; shift += 7 {
|
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
|
||||||
if shift >= 64 {
|
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
|
||||||
return 0, ErrIntOverflowDescriptor
|
0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63,
|
||||||
}
|
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||||
if iNdEx >= l {
|
0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74,
|
||||||
return 0, io.ErrUnexpectedEOF
|
0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowDescriptor
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupDescriptor
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthDescriptor
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthDescriptor = fmt.Errorf("proto: negative length found during unmarshaling")
|
file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescOnce sync.Once
|
||||||
ErrIntOverflowDescriptor = fmt.Errorf("proto: integer overflow")
|
file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescData = file_github_com_containerd_containerd_api_types_descriptor_proto_rawDesc
|
||||||
ErrUnexpectedEndOfGroupDescriptor = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescGZIP() []byte {
|
||||||
|
file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescOnce.Do(func() {
|
||||||
|
file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_github_com_containerd_containerd_api_types_descriptor_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_github_com_containerd_containerd_api_types_descriptor_proto_goTypes = []interface{}{
|
||||||
|
(*Descriptor)(nil), // 0: containerd.types.Descriptor
|
||||||
|
nil, // 1: containerd.types.Descriptor.AnnotationsEntry
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_api_types_descriptor_proto_depIdxs = []int32{
|
||||||
|
1, // 0: containerd.types.Descriptor.annotations:type_name -> containerd.types.Descriptor.AnnotationsEntry
|
||||||
|
1, // [1:1] is the sub-list for method output_type
|
||||||
|
1, // [1:1] is the sub-list for method input_type
|
||||||
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_api_types_descriptor_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_api_types_descriptor_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_api_types_descriptor_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_github_com_containerd_containerd_api_types_descriptor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Descriptor); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_api_types_descriptor_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_api_types_descriptor_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_api_types_descriptor_proto_depIdxs,
|
||||||
|
MessageInfos: file_github_com_containerd_containerd_api_types_descriptor_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_api_types_descriptor_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_api_types_descriptor_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_descriptor_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_descriptor_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
@ -1,456 +1,196 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
//
|
||||||
|
//Copyright The containerd Authors.
|
||||||
|
//
|
||||||
|
//Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
//you may not use this file except in compliance with the License.
|
||||||
|
//You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
//http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
//Unless required by applicable law or agreed to in writing, software
|
||||||
|
//distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//See the License for the specific language governing permissions and
|
||||||
|
//limitations under the License.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/api/types/metrics.proto
|
// source: github.com/containerd/containerd/api/types/metrics.proto
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/gogo/protobuf/gogoproto"
|
_ "github.com/gogo/protobuf/gogoproto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
any1 "github.com/golang/protobuf/ptypes/any"
|
||||||
types "github.com/gogo/protobuf/types"
|
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||||
io "io"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
math "math"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
math_bits "math/bits"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
)
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
type Metric struct {
|
type Metric struct {
|
||||||
Timestamp *types.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
state protoimpl.MessageState
|
||||||
ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
sizeCache protoimpl.SizeCache
|
||||||
Data *types.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
unknownFields protoimpl.UnknownFields
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
||||||
XXX_unrecognized []byte `json:"-"`
|
Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Data *any1.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Metric) Reset() {
|
||||||
|
*x = Metric{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_metrics_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Metric) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Metric) Reset() { *m = Metric{} }
|
|
||||||
func (*Metric) ProtoMessage() {}
|
func (*Metric) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Metric) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_metrics_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Metric.ProtoReflect.Descriptor instead.
|
||||||
func (*Metric) Descriptor() ([]byte, []int) {
|
func (*Metric) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_8d594d87edf6e6bc, []int{0}
|
return file_github_com_containerd_containerd_api_types_metrics_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
|
||||||
func (m *Metric) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Metric.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Metric) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Metric.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Metric) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Metric) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Metric.DiscardUnknown(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_Metric proto.InternalMessageInfo
|
func (x *Metric) GetTimestamp() *timestamp.Timestamp {
|
||||||
|
if x != nil {
|
||||||
func init() {
|
return x.Timestamp
|
||||||
proto.RegisterType((*Metric)(nil), "containerd.types.Metric")
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
proto.RegisterFile("github.com/containerd/containerd/api/types/metrics.proto", fileDescriptor_8d594d87edf6e6bc)
|
|
||||||
}
|
|
||||||
|
|
||||||
var fileDescriptor_8d594d87edf6e6bc = []byte{
|
|
||||||
// 246 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x48, 0xcf, 0x2c, 0xc9,
|
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
|
||||||
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xe7, 0xa6, 0x96,
|
|
||||||
0x14, 0x65, 0x26, 0x17, 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0xd4, 0xe8, 0x81,
|
|
||||||
0xe5, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x94, 0x64,
|
|
||||||
0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x98, 0x97, 0x54, 0x9a, 0xa6, 0x9f, 0x98, 0x57, 0x09,
|
|
||||||
0x95, 0x92, 0x47, 0x97, 0x2a, 0xc9, 0xcc, 0x4d, 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0x80, 0x28, 0x50,
|
|
||||||
0x6a, 0x61, 0xe4, 0x62, 0xf3, 0x05, 0xdb, 0x2a, 0x64, 0xc1, 0xc5, 0x09, 0x97, 0x95, 0x60, 0x54,
|
|
||||||
0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd2, 0x83, 0xe8, 0xd7, 0x83, 0xe9, 0xd7, 0x0b, 0x81, 0xa9, 0x08,
|
|
||||||
0x42, 0x28, 0x16, 0x12, 0xe3, 0x62, 0xca, 0x4c, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x74, 0x62,
|
|
||||||
0x7b, 0x74, 0x4f, 0x9e, 0xc9, 0xd3, 0x25, 0x88, 0x29, 0x33, 0x45, 0x48, 0x83, 0x8b, 0x25, 0x25,
|
|
||||||
0xb1, 0x24, 0x51, 0x82, 0x19, 0x6c, 0x98, 0x08, 0x86, 0x61, 0x8e, 0x79, 0x95, 0x41, 0x60, 0x15,
|
|
||||||
0x4e, 0x5e, 0x27, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xd0, 0xf0, 0x48, 0x8e, 0xf1, 0xc4,
|
|
||||||
0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x8c, 0x32, 0x20, 0x3e, 0xf8,
|
|
||||||
0xac, 0xc1, 0x64, 0x12, 0x1b, 0xd8, 0x7c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x28,
|
|
||||||
0x99, 0xa7, 0x79, 0x01, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Metric) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Metric) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
i -= len(m.XXX_unrecognized)
|
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
if m.Data != nil {
|
|
||||||
{
|
|
||||||
size, err := m.Data.MarshalToSizedBuffer(dAtA[:i])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i -= size
|
|
||||||
i = encodeVarintMetrics(dAtA, i, uint64(size))
|
|
||||||
}
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
}
|
|
||||||
if len(m.ID) > 0 {
|
|
||||||
i -= len(m.ID)
|
|
||||||
copy(dAtA[i:], m.ID)
|
|
||||||
i = encodeVarintMetrics(dAtA, i, uint64(len(m.ID)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if m.Timestamp != nil {
|
|
||||||
{
|
|
||||||
size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i -= size
|
|
||||||
i = encodeVarintMetrics(dAtA, i, uint64(size))
|
|
||||||
}
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovMetrics(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Metric) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.Timestamp != nil {
|
|
||||||
l = m.Timestamp.Size()
|
|
||||||
n += 1 + l + sovMetrics(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.ID)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovMetrics(uint64(l))
|
|
||||||
}
|
|
||||||
if m.Data != nil {
|
|
||||||
l = m.Data.Size()
|
|
||||||
n += 1 + l + sovMetrics(uint64(l))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
n += len(m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovMetrics(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozMetrics(x uint64) (n int) {
|
|
||||||
return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (this *Metric) String() string {
|
|
||||||
if this == nil {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
s := strings.Join([]string{`&Metric{`,
|
|
||||||
`Timestamp:` + strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1) + `,`,
|
|
||||||
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
|
||||||
`Data:` + strings.Replace(fmt.Sprintf("%v", this.Data), "Any", "types.Any", 1) + `,`,
|
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
||||||
`}`,
|
|
||||||
}, "")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
func valueToStringMetrics(v interface{}) string {
|
|
||||||
rv := reflect.ValueOf(v)
|
|
||||||
if rv.IsNil() {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
pv := reflect.Indirect(rv).Interface()
|
|
||||||
return fmt.Sprintf("*%v", pv)
|
|
||||||
}
|
|
||||||
func (m *Metric) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMetrics
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Metric: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Metric: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMetrics
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if m.Timestamp == nil {
|
|
||||||
m.Timestamp = &types.Timestamp{}
|
|
||||||
}
|
|
||||||
if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMetrics
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.ID = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMetrics
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= int(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if m.Data == nil {
|
|
||||||
m.Data = &types.Any{}
|
|
||||||
}
|
|
||||||
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipMetrics(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func skipMetrics(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
func (x *Metric) GetID() string {
|
||||||
iNdEx := 0
|
if x != nil {
|
||||||
depth := 0
|
return x.ID
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowMetrics
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowMetrics
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowMetrics
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupMetrics
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthMetrics
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0, io.ErrUnexpectedEOF
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Metric) GetData() *any1.Any {
|
||||||
|
if x != nil {
|
||||||
|
return x.Data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_github_com_containerd_containerd_api_types_metrics_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_metrics_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, 0x65, 0x74,
|
||||||
|
0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6e, 0x74,
|
||||||
|
0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x14, 0x67, 0x6f,
|
||||||
|
0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
|
||||||
|
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
|
||||||
|
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c,
|
||||||
|
0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65,
|
||||||
|
0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
|
||||||
|
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
|
||||||
|
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||||
|
0x6d, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
|
||||||
|
0x69, 0x64, 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
|
||||||
|
0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
|
0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x32, 0x5a, 0x30,
|
||||||
|
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61,
|
||||||
|
0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,
|
||||||
|
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73,
|
||||||
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling")
|
file_github_com_containerd_containerd_api_types_metrics_proto_rawDescOnce sync.Once
|
||||||
ErrIntOverflowMetrics = fmt.Errorf("proto: integer overflow")
|
file_github_com_containerd_containerd_api_types_metrics_proto_rawDescData = file_github_com_containerd_containerd_api_types_metrics_proto_rawDesc
|
||||||
ErrUnexpectedEndOfGroupMetrics = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func file_github_com_containerd_containerd_api_types_metrics_proto_rawDescGZIP() []byte {
|
||||||
|
file_github_com_containerd_containerd_api_types_metrics_proto_rawDescOnce.Do(func() {
|
||||||
|
file_github_com_containerd_containerd_api_types_metrics_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_metrics_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_github_com_containerd_containerd_api_types_metrics_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_metrics_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_github_com_containerd_containerd_api_types_metrics_proto_goTypes = []interface{}{
|
||||||
|
(*Metric)(nil), // 0: containerd.types.Metric
|
||||||
|
(*timestamp.Timestamp)(nil), // 1: google.protobuf.Timestamp
|
||||||
|
(*any1.Any)(nil), // 2: google.protobuf.Any
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_api_types_metrics_proto_depIdxs = []int32{
|
||||||
|
1, // 0: containerd.types.Metric.timestamp:type_name -> google.protobuf.Timestamp
|
||||||
|
2, // 1: containerd.types.Metric.data:type_name -> google.protobuf.Any
|
||||||
|
2, // [2:2] is the sub-list for method output_type
|
||||||
|
2, // [2:2] is the sub-list for method input_type
|
||||||
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
2, // [2:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:2] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_api_types_metrics_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_api_types_metrics_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_api_types_metrics_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_github_com_containerd_containerd_api_types_metrics_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Metric); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_api_types_metrics_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_api_types_metrics_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_api_types_metrics_proto_depIdxs,
|
||||||
|
MessageInfos: file_github_com_containerd_containerd_api_types_metrics_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_api_types_metrics_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_api_types_metrics_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_metrics_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_metrics_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
@ -1,29 +1,40 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
//
|
||||||
|
//Copyright The containerd Authors.
|
||||||
|
//
|
||||||
|
//Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
//you may not use this file except in compliance with the License.
|
||||||
|
//You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
//http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
//Unless required by applicable law or agreed to in writing, software
|
||||||
|
//distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//See the License for the specific language governing permissions and
|
||||||
|
//limitations under the License.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/api/types/mount.proto
|
// source: github.com/containerd/containerd/api/types/mount.proto
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/gogo/protobuf/gogoproto"
|
_ "github.com/gogo/protobuf/gogoproto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
io "io"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
)
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
// Mount describes mounts for a container.
|
// Mount describes mounts for a container.
|
||||||
//
|
//
|
||||||
@ -33,6 +44,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
// The Mount type follows the structure of the mount syscall, including a type,
|
// The Mount type follows the structure of the mount syscall, including a type,
|
||||||
// source, target and options.
|
// source, target and options.
|
||||||
type Mount struct {
|
type Mount struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Type defines the nature of the mount.
|
// Type defines the nature of the mount.
|
||||||
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
|
||||||
// Source specifies the name of the mount. Depending on mount type, this
|
// Source specifies the name of the mount. Depending on mount type, this
|
||||||
@ -41,455 +56,150 @@ type Mount struct {
|
|||||||
// Target path in container
|
// Target path in container
|
||||||
Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
|
Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
|
||||||
// Options specifies zero or more fstab style mount options.
|
// Options specifies zero or more fstab style mount options.
|
||||||
Options []string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"`
|
Options []string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
}
|
||||||
XXX_unrecognized []byte `json:"-"`
|
|
||||||
XXX_sizecache int32 `json:"-"`
|
func (x *Mount) Reset() {
|
||||||
|
*x = Mount{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_mount_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Mount) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Mount) Reset() { *m = Mount{} }
|
|
||||||
func (*Mount) ProtoMessage() {}
|
func (*Mount) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Mount) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_mount_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Mount.ProtoReflect.Descriptor instead.
|
||||||
func (*Mount) Descriptor() ([]byte, []int) {
|
func (*Mount) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_920196890d4a7b9f, []int{0}
|
return file_github_com_containerd_containerd_api_types_mount_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
|
||||||
func (m *Mount) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Mount.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Mount) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Mount.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Mount) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Mount) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Mount.DiscardUnknown(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_Mount proto.InternalMessageInfo
|
func (x *Mount) GetType() string {
|
||||||
|
if x != nil {
|
||||||
func init() {
|
return x.Type
|
||||||
proto.RegisterType((*Mount)(nil), "containerd.types.Mount")
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func (x *Mount) GetSource() string {
|
||||||
proto.RegisterFile("github.com/containerd/containerd/api/types/mount.proto", fileDescriptor_920196890d4a7b9f)
|
if x != nil {
|
||||||
|
return x.Source
|
||||||
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_920196890d4a7b9f = []byte{
|
func (x *Mount) GetTarget() string {
|
||||||
// 200 bytes of a gzipped FileDescriptorProto
|
if x != nil {
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4b, 0xcf, 0x2c, 0xc9,
|
return x.Target
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
}
|
||||||
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xe7, 0xe6, 0x97,
|
return ""
|
||||||
0xe6, 0x95, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0x54, 0xe8, 0x81, 0x65, 0xa5,
|
|
||||||
0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x52, 0x2a, 0x17, 0xab,
|
|
||||||
0x2f, 0x48, 0x9b, 0x90, 0x10, 0x17, 0x0b, 0x48, 0x9d, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10,
|
|
||||||
0x98, 0x2d, 0x24, 0xc6, 0xc5, 0x56, 0x9c, 0x5f, 0x5a, 0x94, 0x9c, 0x2a, 0xc1, 0x04, 0x16, 0x85,
|
|
||||||
0xf2, 0x40, 0xe2, 0x25, 0x89, 0x45, 0xe9, 0xa9, 0x25, 0x12, 0xcc, 0x10, 0x71, 0x08, 0x4f, 0x48,
|
|
||||||
0x82, 0x8b, 0x3d, 0xbf, 0xa0, 0x24, 0x33, 0x3f, 0xaf, 0x58, 0x82, 0x45, 0x81, 0x59, 0x83, 0x33,
|
|
||||||
0x08, 0xc6, 0x75, 0xf2, 0x3a, 0xf1, 0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72,
|
|
||||||
0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x01,
|
|
||||||
0xf1, 0x1e, 0xb4, 0x06, 0x93, 0x49, 0x6c, 0x60, 0x97, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
|
|
||||||
0xe5, 0xc7, 0x07, 0x3f, 0x1b, 0x01, 0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Mount) Marshal() (dAtA []byte, err error) {
|
func (x *Mount) GetOptions() []string {
|
||||||
size := m.Size()
|
if x != nil {
|
||||||
dAtA = make([]byte, size)
|
return x.Options
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Mount) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
i -= len(m.XXX_unrecognized)
|
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
if len(m.Options) > 0 {
|
|
||||||
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
|
||||||
i -= len(m.Options[iNdEx])
|
|
||||||
copy(dAtA[i:], m.Options[iNdEx])
|
|
||||||
i = encodeVarintMount(dAtA, i, uint64(len(m.Options[iNdEx])))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x22
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(m.Target) > 0 {
|
|
||||||
i -= len(m.Target)
|
|
||||||
copy(dAtA[i:], m.Target)
|
|
||||||
i = encodeVarintMount(dAtA, i, uint64(len(m.Target)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
}
|
|
||||||
if len(m.Source) > 0 {
|
|
||||||
i -= len(m.Source)
|
|
||||||
copy(dAtA[i:], m.Source)
|
|
||||||
i = encodeVarintMount(dAtA, i, uint64(len(m.Source)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if len(m.Type) > 0 {
|
|
||||||
i -= len(m.Type)
|
|
||||||
copy(dAtA[i:], m.Type)
|
|
||||||
i = encodeVarintMount(dAtA, i, uint64(len(m.Type)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintMount(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovMount(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Mount) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.Type)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovMount(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Source)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovMount(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Target)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovMount(uint64(l))
|
|
||||||
}
|
|
||||||
if len(m.Options) > 0 {
|
|
||||||
for _, s := range m.Options {
|
|
||||||
l = len(s)
|
|
||||||
n += 1 + l + sovMount(uint64(l))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
n += len(m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovMount(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozMount(x uint64) (n int) {
|
|
||||||
return sovMount(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (this *Mount) String() string {
|
|
||||||
if this == nil {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
s := strings.Join([]string{`&Mount{`,
|
|
||||||
`Type:` + fmt.Sprintf("%v", this.Type) + `,`,
|
|
||||||
`Source:` + fmt.Sprintf("%v", this.Source) + `,`,
|
|
||||||
`Target:` + fmt.Sprintf("%v", this.Target) + `,`,
|
|
||||||
`Options:` + fmt.Sprintf("%v", this.Options) + `,`,
|
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
||||||
`}`,
|
|
||||||
}, "")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
func valueToStringMount(v interface{}) string {
|
|
||||||
rv := reflect.ValueOf(v)
|
|
||||||
if rv.IsNil() {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
pv := reflect.Indirect(rv).Interface()
|
|
||||||
return fmt.Sprintf("*%v", pv)
|
|
||||||
}
|
|
||||||
func (m *Mount) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMount
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Mount: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMount
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Type = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMount
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Source = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMount
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Target = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 4:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowMount
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Options = append(m.Options, string(dAtA[iNdEx:postIndex]))
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipMount(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func skipMount(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
var File_github_com_containerd_containerd_api_types_mount_proto protoreflect.FileDescriptor
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
var file_github_com_containerd_containerd_api_types_mount_proto_rawDesc = []byte{
|
||||||
for iNdEx < l {
|
0x0a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
var wire uint64
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
for shift := uint(0); ; shift += 7 {
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x75,
|
||||||
if shift >= 64 {
|
0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||||
return 0, ErrIntOverflowMount
|
0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f,
|
||||||
}
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
if iNdEx >= l {
|
0x22, 0x65, 0x0a, 0x05, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
|
||||||
return 0, io.ErrUnexpectedEOF
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
|
||||||
}
|
0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
|
||||||
b := dAtA[iNdEx]
|
0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18,
|
||||||
iNdEx++
|
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x18, 0x0a,
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07,
|
||||||
if b < 0x80 {
|
0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||||
break
|
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,
|
||||||
}
|
0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||||
}
|
0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
wireType := int(wire & 0x7)
|
0x74, 0x6f, 0x33,
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowMount
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowMount
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupMount
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthMount
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthMount = fmt.Errorf("proto: negative length found during unmarshaling")
|
file_github_com_containerd_containerd_api_types_mount_proto_rawDescOnce sync.Once
|
||||||
ErrIntOverflowMount = fmt.Errorf("proto: integer overflow")
|
file_github_com_containerd_containerd_api_types_mount_proto_rawDescData = file_github_com_containerd_containerd_api_types_mount_proto_rawDesc
|
||||||
ErrUnexpectedEndOfGroupMount = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func file_github_com_containerd_containerd_api_types_mount_proto_rawDescGZIP() []byte {
|
||||||
|
file_github_com_containerd_containerd_api_types_mount_proto_rawDescOnce.Do(func() {
|
||||||
|
file_github_com_containerd_containerd_api_types_mount_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_mount_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_github_com_containerd_containerd_api_types_mount_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_mount_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_github_com_containerd_containerd_api_types_mount_proto_goTypes = []interface{}{
|
||||||
|
(*Mount)(nil), // 0: containerd.types.Mount
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_api_types_mount_proto_depIdxs = []int32{
|
||||||
|
0, // [0:0] is the sub-list for method output_type
|
||||||
|
0, // [0:0] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_api_types_mount_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_api_types_mount_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_api_types_mount_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_github_com_containerd_containerd_api_types_mount_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Mount); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_api_types_mount_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_api_types_mount_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_api_types_mount_proto_depIdxs,
|
||||||
|
MessageInfos: file_github_com_containerd_containerd_api_types_mount_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_api_types_mount_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_api_types_mount_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_mount_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_mount_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
@ -1,436 +1,186 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
//
|
||||||
|
//Copyright The containerd Authors.
|
||||||
|
//
|
||||||
|
//Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
//you may not use this file except in compliance with the License.
|
||||||
|
//You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
//http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
//Unless required by applicable law or agreed to in writing, software
|
||||||
|
//distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
//See the License for the specific language governing permissions and
|
||||||
|
//limitations under the License.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/api/types/platform.proto
|
// source: github.com/containerd/containerd/api/types/platform.proto
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/gogo/protobuf/gogoproto"
|
_ "github.com/gogo/protobuf/gogoproto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
io "io"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
)
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
// Platform follows the structure of the OCI platform specification, from
|
// Platform follows the structure of the OCI platform specification, from
|
||||||
// descriptors.
|
// descriptors.
|
||||||
type Platform struct {
|
type Platform struct {
|
||||||
OS string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
|
state protoimpl.MessageState
|
||||||
Architecture string `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"`
|
sizeCache protoimpl.SizeCache
|
||||||
Variant string `protobuf:"bytes,3,opt,name=variant,proto3" json:"variant,omitempty"`
|
unknownFields protoimpl.UnknownFields
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
||||||
XXX_unrecognized []byte `json:"-"`
|
OS string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
Architecture string `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"`
|
||||||
|
Variant string `protobuf:"bytes,3,opt,name=variant,proto3" json:"variant,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Platform) Reset() {
|
||||||
|
*x = Platform{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_platform_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Platform) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Platform) Reset() { *m = Platform{} }
|
|
||||||
func (*Platform) ProtoMessage() {}
|
func (*Platform) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Platform) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_github_com_containerd_containerd_api_types_platform_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Platform.ProtoReflect.Descriptor instead.
|
||||||
func (*Platform) Descriptor() ([]byte, []int) {
|
func (*Platform) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_24ba7a4b83e2367e, []int{0}
|
return file_github_com_containerd_containerd_api_types_platform_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
|
||||||
func (m *Platform) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Platform.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Platform) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Platform.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Platform) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Platform) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Platform.DiscardUnknown(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_Platform proto.InternalMessageInfo
|
func (x *Platform) GetOS() string {
|
||||||
|
if x != nil {
|
||||||
func init() {
|
return x.OS
|
||||||
proto.RegisterType((*Platform)(nil), "containerd.types.Platform")
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func (x *Platform) GetArchitecture() string {
|
||||||
proto.RegisterFile("github.com/containerd/containerd/api/types/platform.proto", fileDescriptor_24ba7a4b83e2367e)
|
if x != nil {
|
||||||
|
return x.Architecture
|
||||||
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_24ba7a4b83e2367e = []byte{
|
func (x *Platform) GetVariant() string {
|
||||||
// 194 bytes of a gzipped FileDescriptorProto
|
if x != nil {
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9,
|
return x.Variant
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
}
|
||||||
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0x17, 0xe4, 0x24,
|
return ""
|
||||||
0x96, 0xa4, 0xe5, 0x17, 0xe5, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0x14, 0xe9,
|
|
||||||
0x81, 0x15, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf5, 0x41, 0x2c, 0x88, 0x3a, 0xa5,
|
|
||||||
0x08, 0x2e, 0x8e, 0x00, 0xa8, 0x4e, 0x21, 0x3e, 0x2e, 0xa6, 0xfc, 0x62, 0x09, 0x46, 0x05, 0x46,
|
|
||||||
0x0d, 0xce, 0x20, 0xa6, 0xfc, 0x62, 0x21, 0x25, 0x2e, 0x9e, 0xc4, 0xa2, 0xe4, 0x8c, 0xcc, 0x92,
|
|
||||||
0xd4, 0xe4, 0x92, 0xd2, 0xa2, 0x54, 0x09, 0x26, 0xb0, 0x0c, 0x8a, 0x98, 0x90, 0x04, 0x17, 0x7b,
|
|
||||||
0x59, 0x62, 0x51, 0x66, 0x62, 0x5e, 0x89, 0x04, 0x33, 0x58, 0x1a, 0xc6, 0x75, 0xf2, 0x3a, 0xf1,
|
|
||||||
0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e,
|
|
||||||
0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x01, 0xf1, 0xde, 0xb2, 0x06, 0x93, 0x49,
|
|
||||||
0x6c, 0x60, 0xc7, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x90, 0x53, 0xf1, 0x6b, 0x11, 0x01,
|
|
||||||
0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Platform) Marshal() (dAtA []byte, err error) {
|
var File_github_com_containerd_containerd_api_types_platform_proto protoreflect.FileDescriptor
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Platform) MarshalTo(dAtA []byte) (int, error) {
|
var file_github_com_containerd_containerd_api_types_platform_proto_rawDesc = []byte{
|
||||||
size := m.Size()
|
0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
}
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x61,
|
||||||
|
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f, 0x6e,
|
||||||
func (m *Platform) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x14, 0x67,
|
||||||
i := len(dAtA)
|
0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72,
|
||||||
_ = i
|
0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12,
|
||||||
var l int
|
0x0e, 0x0a, 0x02, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12,
|
||||||
_ = l
|
0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18,
|
||||||
if m.XXX_unrecognized != nil {
|
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74,
|
||||||
i -= len(m.XXX_unrecognized)
|
0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x18, 0x03,
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x42, 0x32, 0x5a,
|
||||||
}
|
0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74,
|
||||||
if len(m.Variant) > 0 {
|
0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||||
i -= len(m.Variant)
|
0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65,
|
||||||
copy(dAtA[i:], m.Variant)
|
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
i = encodeVarintPlatform(dAtA, i, uint64(len(m.Variant)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x1a
|
|
||||||
}
|
|
||||||
if len(m.Architecture) > 0 {
|
|
||||||
i -= len(m.Architecture)
|
|
||||||
copy(dAtA[i:], m.Architecture)
|
|
||||||
i = encodeVarintPlatform(dAtA, i, uint64(len(m.Architecture)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if len(m.OS) > 0 {
|
|
||||||
i -= len(m.OS)
|
|
||||||
copy(dAtA[i:], m.OS)
|
|
||||||
i = encodeVarintPlatform(dAtA, i, uint64(len(m.OS)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintPlatform(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovPlatform(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Platform) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.OS)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovPlatform(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Architecture)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovPlatform(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.Variant)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovPlatform(uint64(l))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
n += len(m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovPlatform(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozPlatform(x uint64) (n int) {
|
|
||||||
return sovPlatform(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (this *Platform) String() string {
|
|
||||||
if this == nil {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
s := strings.Join([]string{`&Platform{`,
|
|
||||||
`Os:` + fmt.Sprintf("%v", this.OS) + `,`,
|
|
||||||
`Architecture:` + fmt.Sprintf("%v", this.Architecture) + `,`,
|
|
||||||
`Variant:` + fmt.Sprintf("%v", this.Variant) + `,`,
|
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
||||||
`}`,
|
|
||||||
}, "")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
func valueToStringPlatform(v interface{}) string {
|
|
||||||
rv := reflect.ValueOf(v)
|
|
||||||
if rv.IsNil() {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
pv := reflect.Indirect(rv).Interface()
|
|
||||||
return fmt.Sprintf("*%v", pv)
|
|
||||||
}
|
|
||||||
func (m *Platform) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowPlatform
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Platform: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Platform: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Os", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowPlatform
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.OS = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Architecture", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowPlatform
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Architecture = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Variant", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowPlatform
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Variant = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipPlatform(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipPlatform(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowPlatform
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowPlatform
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowPlatform
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupPlatform
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthPlatform
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthPlatform = fmt.Errorf("proto: negative length found during unmarshaling")
|
file_github_com_containerd_containerd_api_types_platform_proto_rawDescOnce sync.Once
|
||||||
ErrIntOverflowPlatform = fmt.Errorf("proto: integer overflow")
|
file_github_com_containerd_containerd_api_types_platform_proto_rawDescData = file_github_com_containerd_containerd_api_types_platform_proto_rawDesc
|
||||||
ErrUnexpectedEndOfGroupPlatform = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func file_github_com_containerd_containerd_api_types_platform_proto_rawDescGZIP() []byte {
|
||||||
|
file_github_com_containerd_containerd_api_types_platform_proto_rawDescOnce.Do(func() {
|
||||||
|
file_github_com_containerd_containerd_api_types_platform_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_types_platform_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_github_com_containerd_containerd_api_types_platform_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_platform_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_github_com_containerd_containerd_api_types_platform_proto_goTypes = []interface{}{
|
||||||
|
(*Platform)(nil), // 0: containerd.types.Platform
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_api_types_platform_proto_depIdxs = []int32{
|
||||||
|
0, // [0:0] is the sub-list for method output_type
|
||||||
|
0, // [0:0] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_api_types_platform_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_api_types_platform_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_api_types_platform_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_github_com_containerd_containerd_api_types_platform_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Platform); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_api_types_platform_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_api_types_platform_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_api_types_platform_proto_depIdxs,
|
||||||
|
MessageInfos: file_github_com_containerd_containerd_api_types_platform_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_api_types_platform_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_api_types_platform_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_platform_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_platform_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/gogo/protobuf/gogoproto"
|
|
||||||
"github.com/gogo/protobuf/proto"
|
|
||||||
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
|
||||||
"github.com/gogo/protobuf/protoc-gen-gogo/generator"
|
|
||||||
"github.com/gogo/protobuf/vanity"
|
|
||||||
)
|
|
||||||
|
|
||||||
// CustomNameID preprocess the field, and set the [(gogoproto.customname) = "..."]
|
|
||||||
// if necessary, in order to avoid setting `gogoproto.customname` manually.
|
|
||||||
// The automatically assigned name should conform to Golang convention.
|
|
||||||
func CustomNameID(file *descriptor.FileDescriptorProto) {
|
|
||||||
|
|
||||||
f := func(field *descriptor.FieldDescriptorProto) {
|
|
||||||
// Skip if [(gogoproto.customname) = "..."] has already been set.
|
|
||||||
if gogoproto.IsCustomName(field) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// Skip if embedded
|
|
||||||
if gogoproto.IsEmbed(field) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if field.OneofIndex != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fieldName := generator.CamelCase(*field.Name)
|
|
||||||
switch {
|
|
||||||
case *field.Name == "id":
|
|
||||||
// id -> ID
|
|
||||||
fieldName = "ID"
|
|
||||||
case strings.HasPrefix(*field.Name, "id_"):
|
|
||||||
// id_some -> IDSome
|
|
||||||
fieldName = "ID" + fieldName[2:]
|
|
||||||
case strings.HasSuffix(*field.Name, "_id"):
|
|
||||||
// some_id -> SomeID
|
|
||||||
fieldName = fieldName[:len(fieldName)-2] + "ID"
|
|
||||||
case strings.HasSuffix(*field.Name, "_ids"):
|
|
||||||
// some_ids -> SomeIDs
|
|
||||||
fieldName = fieldName[:len(fieldName)-3] + "IDs"
|
|
||||||
default:
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if field.Options == nil {
|
|
||||||
field.Options = &descriptor.FieldOptions{}
|
|
||||||
}
|
|
||||||
if err := proto.SetExtension(field.Options, gogoproto.E_Customname, &fieldName); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Iterate through all fields in file
|
|
||||||
vanity.ForEachFieldExcludingExtensions(file.MessageType, f)
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "github.com/containerd/containerd/protobuf/plugin/fieldpath"
|
|
||||||
_ "github.com/containerd/ttrpc/plugin"
|
|
||||||
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
|
||||||
"github.com/gogo/protobuf/vanity"
|
|
||||||
"github.com/gogo/protobuf/vanity/command"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
req := command.Read()
|
|
||||||
files := req.GetProtoFile()
|
|
||||||
files = vanity.FilterFiles(files, vanity.NotGoogleProtobufDescriptorProto)
|
|
||||||
for _, opt := range []func(*descriptor.FileDescriptorProto){
|
|
||||||
vanity.TurnOffGoGettersAll,
|
|
||||||
vanity.TurnOffGoStringerAll,
|
|
||||||
vanity.TurnOnMarshalerAll,
|
|
||||||
vanity.TurnOnStringerAll,
|
|
||||||
vanity.TurnOnUnmarshalerAll,
|
|
||||||
vanity.TurnOnSizerAll,
|
|
||||||
CustomNameID,
|
|
||||||
} {
|
|
||||||
vanity.ForEachFile(files, opt)
|
|
||||||
}
|
|
||||||
|
|
||||||
resp := command.Generate(req)
|
|
||||||
command.Write(resp)
|
|
||||||
}
|
|
@ -73,7 +73,7 @@ func WithCheckpointTask(ctx context.Context, client *Client, c *containers.Conta
|
|||||||
platformSpec := platforms.DefaultSpec()
|
platformSpec := platforms.DefaultSpec()
|
||||||
index.Manifests = append(index.Manifests, imagespec.Descriptor{
|
index.Manifests = append(index.Manifests, imagespec.Descriptor{
|
||||||
MediaType: d.MediaType,
|
MediaType: d.MediaType,
|
||||||
Size: d.Size_,
|
Size: d.Size,
|
||||||
Digest: digest.Digest(d.Digest),
|
Digest: digest.Digest(d.Digest),
|
||||||
Platform: &platformSpec,
|
Platform: &platformSpec,
|
||||||
Annotations: d.Annotations,
|
Annotations: d.Annotations,
|
||||||
|
@ -38,7 +38,7 @@ func (ra *remoteReaderAt) ReadAt(p []byte, off int64) (n int, err error) {
|
|||||||
rr := &contentapi.ReadContentRequest{
|
rr := &contentapi.ReadContentRequest{
|
||||||
Digest: ra.digest.String(),
|
Digest: ra.digest.String(),
|
||||||
Offset: off,
|
Offset: off,
|
||||||
Size_: int64(len(p)),
|
Size: int64(len(p)),
|
||||||
}
|
}
|
||||||
// we need a child context with cancel, or the eventually called
|
// we need a child context with cancel, or the eventually called
|
||||||
// grpc.NewStream will leak the goroutine until the whole thing is cleared.
|
// grpc.NewStream will leak the goroutine until the whole thing is cleared.
|
||||||
|
@ -217,7 +217,7 @@ func (pcs *proxyContentStore) negotiate(ctx context.Context, ref string, size in
|
|||||||
func infoToGRPC(info *content.Info) *contentapi.Info {
|
func infoToGRPC(info *content.Info) *contentapi.Info {
|
||||||
return &contentapi.Info{
|
return &contentapi.Info{
|
||||||
Digest: info.Digest.String(),
|
Digest: info.Digest.String(),
|
||||||
Size_: info.Size,
|
Size: info.Size,
|
||||||
CreatedAt: protobuf.ToTimestamp(info.CreatedAt),
|
CreatedAt: protobuf.ToTimestamp(info.CreatedAt),
|
||||||
UpdatedAt: protobuf.ToTimestamp(info.UpdatedAt),
|
UpdatedAt: protobuf.ToTimestamp(info.UpdatedAt),
|
||||||
Labels: info.Labels,
|
Labels: info.Labels,
|
||||||
@ -227,7 +227,7 @@ func infoToGRPC(info *content.Info) *contentapi.Info {
|
|||||||
func infoFromGRPC(info *contentapi.Info) content.Info {
|
func infoFromGRPC(info *contentapi.Info) content.Info {
|
||||||
return content.Info{
|
return content.Info{
|
||||||
Digest: digest.Digest(info.Digest),
|
Digest: digest.Digest(info.Digest),
|
||||||
Size: info.Size_,
|
Size: info.Size,
|
||||||
CreatedAt: protobuf.FromTimestamp(info.CreatedAt),
|
CreatedAt: protobuf.FromTimestamp(info.CreatedAt),
|
||||||
UpdatedAt: protobuf.FromTimestamp(info.UpdatedAt),
|
UpdatedAt: protobuf.FromTimestamp(info.UpdatedAt),
|
||||||
Labels: info.Labels,
|
Labels: info.Labels,
|
||||||
|
@ -161,7 +161,7 @@ func (s service) Usage(ctx context.Context, ur *snapshotsapi.UsageRequest) (*sna
|
|||||||
|
|
||||||
return &snapshotsapi.UsageResponse{
|
return &snapshotsapi.UsageResponse{
|
||||||
Inodes: usage.Inodes,
|
Inodes: usage.Inodes,
|
||||||
Size_: usage.Size,
|
Size: usage.Size,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
diff.go
4
diff.go
@ -98,7 +98,7 @@ func toDescriptor(d *types.Descriptor) ocispec.Descriptor {
|
|||||||
return ocispec.Descriptor{
|
return ocispec.Descriptor{
|
||||||
MediaType: d.MediaType,
|
MediaType: d.MediaType,
|
||||||
Digest: digest.Digest(d.Digest),
|
Digest: digest.Digest(d.Digest),
|
||||||
Size: d.Size_,
|
Size: d.Size,
|
||||||
Annotations: d.Annotations,
|
Annotations: d.Annotations,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ func fromDescriptor(d ocispec.Descriptor) *types.Descriptor {
|
|||||||
return &types.Descriptor{
|
return &types.Descriptor{
|
||||||
MediaType: d.MediaType,
|
MediaType: d.MediaType,
|
||||||
Digest: d.Digest.String(),
|
Digest: d.Digest.String(),
|
||||||
Size_: d.Size,
|
Size: d.Size,
|
||||||
Annotations: d.Annotations,
|
Annotations: d.Annotations,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package exchange
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -27,7 +26,9 @@ import (
|
|||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/events"
|
"github.com/containerd/containerd/events"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
|
"github.com/containerd/containerd/protobuf"
|
||||||
"github.com/containerd/typeurl"
|
"github.com/containerd/typeurl"
|
||||||
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestExchangeBasic(t *testing.T) {
|
func TestExchangeBasic(t *testing.T) {
|
||||||
@ -102,7 +103,7 @@ func TestExchangeBasic(t *testing.T) {
|
|||||||
break subscribercheck
|
break subscribercheck
|
||||||
}
|
}
|
||||||
|
|
||||||
if reflect.DeepEqual(received, testevents) {
|
if cmp.Equal(received, testevents, protobuf.Compare) {
|
||||||
// when we do this, we expect the errs channel to be closed and
|
// when we do this, we expect the errs channel to be closed and
|
||||||
// this will return.
|
// this will return.
|
||||||
subscriber.cancel()
|
subscriber.cancel()
|
||||||
@ -260,7 +261,7 @@ func TestExchangeFilters(t *testing.T) {
|
|||||||
break subscribercheck
|
break subscribercheck
|
||||||
}
|
}
|
||||||
|
|
||||||
if reflect.DeepEqual(received, subscriber.expectEvents) {
|
if cmp.Equal(received, subscriber.expectEvents, protobuf.Compare) {
|
||||||
// when we do this, we expect the errs channel to be closed and
|
// when we do this, we expect the errs channel to be closed and
|
||||||
// this will return.
|
// this will return.
|
||||||
subscriber.cancel()
|
subscriber.cancel()
|
||||||
|
9
go.mod
9
go.mod
@ -17,8 +17,8 @@ require (
|
|||||||
github.com/containerd/go-runc v1.0.0
|
github.com/containerd/go-runc v1.0.0
|
||||||
github.com/containerd/imgcrypt v1.1.5-0.20220421044638-8ba028dca028
|
github.com/containerd/imgcrypt v1.1.5-0.20220421044638-8ba028dca028
|
||||||
github.com/containerd/nri v0.1.0
|
github.com/containerd/nri v0.1.0
|
||||||
github.com/containerd/ttrpc v1.1.0
|
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3
|
||||||
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259
|
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67
|
||||||
github.com/containerd/zfs v1.0.0
|
github.com/containerd/zfs v1.0.0
|
||||||
github.com/containernetworking/plugins v1.1.1
|
github.com/containernetworking/plugins v1.1.1
|
||||||
github.com/coreos/go-systemd/v22 v22.3.2
|
github.com/coreos/go-systemd/v22 v22.3.2
|
||||||
@ -28,8 +28,8 @@ require (
|
|||||||
github.com/docker/go-units v0.4.0
|
github.com/docker/go-units v0.4.0
|
||||||
github.com/emicklei/go-restful/v3 v3.7.3
|
github.com/emicklei/go-restful/v3 v3.7.3
|
||||||
github.com/fsnotify/fsnotify v1.5.1
|
github.com/fsnotify/fsnotify v1.5.1
|
||||||
github.com/gogo/googleapis v1.4.1
|
|
||||||
github.com/gogo/protobuf v1.3.2
|
github.com/gogo/protobuf v1.3.2
|
||||||
|
github.com/golang/protobuf v1.5.2
|
||||||
github.com/google/go-cmp v0.5.6
|
github.com/google/go-cmp v0.5.6
|
||||||
github.com/google/uuid v1.2.0
|
github.com/google/uuid v1.2.0
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
||||||
@ -65,6 +65,7 @@ require (
|
|||||||
go.opentelemetry.io/otel/trace v1.3.0
|
go.opentelemetry.io/otel/trace v1.3.0
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
|
||||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
|
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
|
||||||
|
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
|
||||||
google.golang.org/grpc v1.43.0
|
google.golang.org/grpc v1.43.0
|
||||||
google.golang.org/protobuf v1.27.1
|
google.golang.org/protobuf v1.27.1
|
||||||
k8s.io/api v0.22.5
|
k8s.io/api v0.22.5
|
||||||
@ -91,7 +92,6 @@ require (
|
|||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/godbus/dbus/v5 v5.0.6 // indirect
|
github.com/godbus/dbus/v5 v5.0.6 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
github.com/google/gofuzz v1.2.0 // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
@ -127,7 +127,6 @@ require (
|
|||||||
golang.org/x/text v0.3.7 // indirect
|
golang.org/x/text v0.3.7 // indirect
|
||||||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
|
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
|
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
|
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
|
9
go.sum
9
go.sum
@ -252,14 +252,15 @@ github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDG
|
|||||||
github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8=
|
github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8=
|
||||||
github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
|
github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
|
||||||
github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
|
github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
|
||||||
github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI=
|
|
||||||
github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ=
|
github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ=
|
||||||
|
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3 h1:BhCp66ofL8oYcdelc3CBXc2/Pfvvgx+s+mrp9TvNgn8=
|
||||||
|
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3/go.mod h1:YYyNVhZrTMiaf51Vj6WhAJqJw+vl/nzABhj8pWrzle4=
|
||||||
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
|
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
|
||||||
github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk=
|
github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk=
|
||||||
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
|
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
|
||||||
github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s=
|
github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s=
|
||||||
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259 h1:bJv9qgjarrsdd4XIIczeRdYXON88Fgn3GdXVfnQjcSo=
|
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67 h1:rQvjv7gRi6Ki/NS/U9oLZFhqyk4dh/GH2M3o/4BRkMM=
|
||||||
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259/go.mod h1:HDkcKOXRnX6yKnXv3P0QrogFi0DoiauK/LpQi961f0A=
|
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67/go.mod h1:HDkcKOXRnX6yKnXv3P0QrogFi0DoiauK/LpQi961f0A=
|
||||||
github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw=
|
github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw=
|
||||||
github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y=
|
github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y=
|
||||||
github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY=
|
github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY=
|
||||||
@ -418,8 +419,6 @@ github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro=
|
|||||||
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
|
github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
|
||||||
github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
|
github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
|
||||||
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
|
|
||||||
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
|
|
||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||||
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
|
@ -141,7 +141,7 @@ func imagesFromProto(imagespb []*imagesapi.Image) []images.Image {
|
|||||||
func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
|
func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
|
||||||
return ocispec.Descriptor{
|
return ocispec.Descriptor{
|
||||||
MediaType: desc.MediaType,
|
MediaType: desc.MediaType,
|
||||||
Size: desc.Size_,
|
Size: desc.Size,
|
||||||
Digest: digest.Digest(desc.Digest),
|
Digest: digest.Digest(desc.Digest),
|
||||||
Annotations: desc.Annotations,
|
Annotations: desc.Annotations,
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
|
|||||||
func descToProto(desc *ocispec.Descriptor) *types.Descriptor {
|
func descToProto(desc *ocispec.Descriptor) *types.Descriptor {
|
||||||
return &types.Descriptor{
|
return &types.Descriptor{
|
||||||
MediaType: desc.MediaType,
|
MediaType: desc.MediaType,
|
||||||
Size_: desc.Size,
|
Size: desc.Size,
|
||||||
Digest: desc.Digest.String(),
|
Digest: desc.Digest.String(),
|
||||||
Annotations: desc.Annotations,
|
Annotations: desc.Annotations,
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ require (
|
|||||||
github.com/containerd/cgroups v1.0.3
|
github.com/containerd/cgroups v1.0.3
|
||||||
github.com/containerd/containerd v1.6.2 // see replace; the actual version of containerd is replaced with the code at the root of this repository
|
github.com/containerd/containerd v1.6.2 // see replace; the actual version of containerd is replaced with the code at the root of this repository
|
||||||
github.com/containerd/go-runc v1.0.0
|
github.com/containerd/go-runc v1.0.0
|
||||||
github.com/containerd/ttrpc v1.1.0
|
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3
|
||||||
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259
|
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/opencontainers/go-digest v1.0.0
|
github.com/opencontainers/go-digest v1.0.0
|
||||||
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1
|
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1
|
||||||
@ -32,9 +32,9 @@ require (
|
|||||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||||
github.com/docker/go-units v0.4.0 // indirect
|
github.com/docker/go-units v0.4.0 // indirect
|
||||||
github.com/godbus/dbus/v5 v5.0.6 // indirect
|
github.com/godbus/dbus/v5 v5.0.6 // indirect
|
||||||
github.com/gogo/googleapis v1.4.1 // indirect
|
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
|
github.com/google/go-cmp v0.5.6 // indirect
|
||||||
github.com/google/uuid v1.2.0 // indirect
|
github.com/google/uuid v1.2.0 // indirect
|
||||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
@ -73,6 +73,8 @@ replace (
|
|||||||
// resolution if newer.
|
// resolution if newer.
|
||||||
github.com/containerd/containerd => ../../
|
github.com/containerd/containerd => ../../
|
||||||
|
|
||||||
|
github.com/containerd/typeurl => github.com/kzys/typeurl v1.0.3-0.20220421192127-bac36d33562a
|
||||||
|
|
||||||
// Replace rules below must be kept in sync with the main go.mod file at the
|
// Replace rules below must be kept in sync with the main go.mod file at the
|
||||||
// root, because that's the actual version expected by the "containerd/containerd"
|
// root, because that's the actual version expected by the "containerd/containerd"
|
||||||
// dependency above.
|
// dependency above.
|
||||||
|
@ -151,12 +151,9 @@ github.com/containerd/imgcrypt v1.1.5-0.20220421044638-8ba028dca028/go.mod h1:Lo
|
|||||||
github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY=
|
github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY=
|
||||||
github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM=
|
github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM=
|
||||||
github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
|
github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y=
|
||||||
github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI=
|
|
||||||
github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ=
|
github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ=
|
||||||
github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
|
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3 h1:BhCp66ofL8oYcdelc3CBXc2/Pfvvgx+s+mrp9TvNgn8=
|
||||||
github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s=
|
github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3/go.mod h1:YYyNVhZrTMiaf51Vj6WhAJqJw+vl/nzABhj8pWrzle4=
|
||||||
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259 h1:bJv9qgjarrsdd4XIIczeRdYXON88Fgn3GdXVfnQjcSo=
|
|
||||||
github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259/go.mod h1:HDkcKOXRnX6yKnXv3P0QrogFi0DoiauK/LpQi961f0A=
|
|
||||||
github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY=
|
github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY=
|
||||||
github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y=
|
github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y=
|
||||||
github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8=
|
github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8=
|
||||||
@ -263,8 +260,6 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
|
|||||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro=
|
github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro=
|
||||||
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
|
|
||||||
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
|
|
||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
@ -425,6 +420,8 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
|
|||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/kzys/typeurl v1.0.3-0.20220421192127-bac36d33562a h1:89QixI2ur9quae3eryx/xYEcV6PgT/RXYgUkaeI1wls=
|
||||||
|
github.com/kzys/typeurl v1.0.3-0.20220421192127-bac36d33562a/go.mod h1:HDkcKOXRnX6yKnXv3P0QrogFi0DoiauK/LpQi961f0A=
|
||||||
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
|
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
|
||||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
|
@ -111,7 +111,7 @@ func (r *ImageService) ImageStatus(image *runtimeapi.ImageSpec, opts ...grpc.Cal
|
|||||||
}
|
}
|
||||||
|
|
||||||
if resp.Image != nil {
|
if resp.Image != nil {
|
||||||
if resp.Image.Id == "" || resp.Image.Size_ == 0 {
|
if resp.Image.Id == "" || resp.Image.Size() == 0 {
|
||||||
errorMessage := fmt.Sprintf("Id or size of image %q is not set", image.Image)
|
errorMessage := fmt.Sprintf("Id or size of image %q is not set", image.Image)
|
||||||
klog.Errorf("ImageStatus failed: %s", errorMessage)
|
klog.Errorf("ImageStatus failed: %s", errorMessage)
|
||||||
return nil, errors.New(errorMessage)
|
return nil, errors.New(errorMessage)
|
||||||
|
74
metadata/compare_test.go
Normal file
74
metadata/compare_test.go
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
Copyright The containerd Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package metadata
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"reflect"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/containerd/typeurl"
|
||||||
|
"github.com/google/go-cmp/cmp"
|
||||||
|
)
|
||||||
|
|
||||||
|
// isNil returns true if the given parameter is nil or typed nil.
|
||||||
|
func isNil(x interface{}) bool {
|
||||||
|
if x == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
v := reflect.ValueOf(x)
|
||||||
|
return v.Kind() == reflect.Ptr && v.IsNil()
|
||||||
|
}
|
||||||
|
|
||||||
|
var compareNil = cmp.FilterValues(
|
||||||
|
func(x, y interface{}) bool {
|
||||||
|
return isNil(x) && isNil(y)
|
||||||
|
},
|
||||||
|
cmp.Comparer(func(_, _ interface{}) bool {
|
||||||
|
return true
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
var ignoreTime = cmp.FilterValues(
|
||||||
|
func(x, y interface{}) bool {
|
||||||
|
_, xok := x.(time.Time)
|
||||||
|
_, yok := y.(time.Time)
|
||||||
|
return xok && yok
|
||||||
|
},
|
||||||
|
cmp.Comparer(func(_, _ interface{}) bool {
|
||||||
|
return true
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
var compareAny = cmp.FilterValues(
|
||||||
|
func(x, y interface{}) bool {
|
||||||
|
_, xok := x.(typeurl.Any)
|
||||||
|
_, yok := y.(typeurl.Any)
|
||||||
|
return xok && yok
|
||||||
|
},
|
||||||
|
cmp.Comparer(func(x, y interface{}) bool {
|
||||||
|
vx, ok := x.(typeurl.Any)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
vy, ok := y.(typeurl.Any)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return vx.GetTypeUrl() == vy.GetTypeUrl() && bytes.Equal(vx.GetValue(), vy.GetValue())
|
||||||
|
}),
|
||||||
|
)
|
@ -21,7 +21,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -705,27 +704,8 @@ func checkContainerTimestamps(t *testing.T, c *containers.Container, now time.Ti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// isNil returns true if the given parameter is nil or typed nil.
|
|
||||||
func isNil(x interface{}) bool {
|
|
||||||
if x == nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
v := reflect.ValueOf(x)
|
|
||||||
return v.Kind() == reflect.Ptr && v.IsNil()
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkContainersEqual(t *testing.T, a, b *containers.Container, format string, args ...interface{}) {
|
func checkContainersEqual(t *testing.T, a, b *containers.Container, format string, args ...interface{}) {
|
||||||
// Ignore the difference of nil and typed nil.
|
assert.True(t, cmp.Equal(a, b, compareNil, compareAny))
|
||||||
opt := cmp.FilterValues(
|
|
||||||
func(x, y interface{}) bool {
|
|
||||||
return isNil(x) && isNil(y)
|
|
||||||
},
|
|
||||||
cmp.Comparer(func(_, _ interface{}) bool {
|
|
||||||
return true
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
|
|
||||||
assert.True(t, cmp.Equal(a, b, opt))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func testEnv(t *testing.T) (context.Context, *bolt.DB, func()) {
|
func testEnv(t *testing.T) (context.Context, *bolt.DB, func()) {
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
package metadata
|
package metadata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/protobuf"
|
|
||||||
"github.com/containerd/containerd/protobuf/types"
|
"github.com/containerd/containerd/protobuf/types"
|
||||||
api "github.com/containerd/containerd/sandbox"
|
api "github.com/containerd/containerd/sandbox"
|
||||||
"github.com/containerd/typeurl"
|
"github.com/containerd/typeurl"
|
||||||
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSandboxCreate(t *testing.T) {
|
func TestSandboxCreate(t *testing.T) {
|
||||||
@ -266,27 +265,8 @@ func TestSandboxDelete(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func assertEqualInstances(t *testing.T, x, y api.Sandbox) {
|
func assertEqualInstances(t *testing.T, x, y api.Sandbox) {
|
||||||
if x.ID != y.ID {
|
diff := cmp.Diff(x, y, compareNil, compareAny, ignoreTime)
|
||||||
t.Fatalf("ids are not equal: %q != %q", x.ID, y.ID)
|
if diff != "" {
|
||||||
}
|
t.Fatalf("x and y are different: %s", diff)
|
||||||
|
|
||||||
if !reflect.DeepEqual(x.Labels, y.Labels) {
|
|
||||||
t.Fatalf("labels are not equal: %+v != %+v", x.Labels, y.Labels)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !reflect.DeepEqual(x.Spec, y.Spec) {
|
|
||||||
t.Fatalf("specs are not equal: %+v != %+v", x.Spec, y.Spec)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !reflect.DeepEqual(x.Extensions, y.Extensions) {
|
|
||||||
t.Fatalf("extensions are not equal: %+v != %+v", x.Extensions, y.Extensions)
|
|
||||||
}
|
|
||||||
|
|
||||||
if x.Runtime.Name != y.Runtime.Name {
|
|
||||||
t.Fatalf("runtime names are not equal: %q != %q", x.Runtime.Name, y.Runtime.Name)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !reflect.DeepEqual(protobuf.FromAny(x.Runtime.Options), protobuf.FromAny(y.Runtime.Options)) {
|
|
||||||
t.Fatalf("runtime options are not equal: %+v != %+v", x.Runtime.Options, y.Runtime.Options)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ func (c *criService) ListContainerStats(
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to build metrics request: %w", err)
|
return nil, fmt.Errorf("failed to build metrics request: %w", err)
|
||||||
}
|
}
|
||||||
resp, err := c.client.TaskService().Metrics(ctx, &request)
|
resp, err := c.client.TaskService().Metrics(ctx, request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to fetch metrics for tasks: %w", err)
|
return nil, fmt.Errorf("failed to fetch metrics for tasks: %w", err)
|
||||||
}
|
}
|
||||||
@ -79,8 +79,8 @@ func (c *criService) normalizeContainerStatsFilter(filter *runtime.ContainerStat
|
|||||||
// the information in the stats request and the containerStore
|
// the information in the stats request and the containerStore
|
||||||
func (c *criService) buildTaskMetricsRequest(
|
func (c *criService) buildTaskMetricsRequest(
|
||||||
r *runtime.ListContainerStatsRequest,
|
r *runtime.ListContainerStatsRequest,
|
||||||
) (tasks.MetricsRequest, []containerstore.Container, error) {
|
) (*tasks.MetricsRequest, []containerstore.Container, error) {
|
||||||
var req tasks.MetricsRequest
|
req := &tasks.MetricsRequest{}
|
||||||
if r.GetFilter() == nil {
|
if r.GetFilter() == nil {
|
||||||
return req, c.containerStore.List(), nil
|
return req, c.containerStore.List(), nil
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
eventtypes "github.com/containerd/containerd/api/events"
|
eventtypes "github.com/containerd/containerd/api/events"
|
||||||
|
"github.com/containerd/containerd/protobuf"
|
||||||
"github.com/containerd/typeurl"
|
"github.com/containerd/typeurl"
|
||||||
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
testingclock "k8s.io/utils/clock/testing"
|
testingclock "k8s.io/utils/clock/testing"
|
||||||
)
|
)
|
||||||
@ -107,7 +109,7 @@ func TestBackOff(t *testing.T) {
|
|||||||
for k := range inputQueues {
|
for k := range inputQueues {
|
||||||
actQueue := actual.deBackOff(k)
|
actQueue := actual.deBackOff(k)
|
||||||
doneQueues[k] = actQueue
|
doneQueues[k] = actQueue
|
||||||
assert.Equal(t, actQueue, expectedQueues[k])
|
assert.True(t, cmp.Equal(actQueue.events, expectedQueues[k].events, protobuf.Compare))
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Logf("Should not get out the event again after having got out the backOff event")
|
t.Logf("Should not get out the event again after having got out the backOff event")
|
||||||
|
@ -1,393 +1,168 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// To regenerate api.pb.go run `make protos`
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/pkg/runtimeoptions/v1/api.proto
|
// source: github.com/containerd/containerd/pkg/runtimeoptions/v1/api.proto
|
||||||
|
|
||||||
package runtimeoptions_v1
|
package runtimeoptions_v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
|
||||||
_ "github.com/gogo/protobuf/gogoproto"
|
_ "github.com/gogo/protobuf/gogoproto"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
io "io"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
strings "strings"
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
)
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// TypeUrl specifies the type of the content inside the config file.
|
// TypeUrl specifies the type of the content inside the config file.
|
||||||
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
|
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
|
||||||
// ConfigPath specifies the filesystem location of the config file
|
// ConfigPath specifies the filesystem location of the config file
|
||||||
// used by the runtime.
|
// used by the runtime.
|
||||||
ConfigPath string `protobuf:"bytes,2,opt,name=config_path,json=configPath,proto3" json:"config_path,omitempty"`
|
ConfigPath string `protobuf:"bytes,2,opt,name=config_path,json=configPath,proto3" json:"config_path,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
}
|
||||||
XXX_unrecognized []byte `json:"-"`
|
|
||||||
XXX_sizecache int32 `json:"-"`
|
func (x *Options) Reset() {
|
||||||
|
*x = Options{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Options) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Options) Reset() { *m = Options{} }
|
|
||||||
func (*Options) ProtoMessage() {}
|
func (*Options) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Options) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Options.ProtoReflect.Descriptor instead.
|
||||||
func (*Options) Descriptor() ([]byte, []int) {
|
func (*Options) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_7700dd27e3487aa6, []int{0}
|
return file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
|
||||||
func (m *Options) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Options.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Options) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Options.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Options) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Options) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Options.DiscardUnknown(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_Options proto.InternalMessageInfo
|
func (x *Options) GetTypeUrl() string {
|
||||||
|
if x != nil {
|
||||||
func init() {
|
return x.TypeUrl
|
||||||
proto.RegisterType((*Options)(nil), "runtimeoptions.v1.Options")
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func (x *Options) GetConfigPath() string {
|
||||||
proto.RegisterFile("github.com/containerd/containerd/pkg/runtimeoptions/v1/api.proto", fileDescriptor_7700dd27e3487aa6)
|
if x != nil {
|
||||||
|
return x.ConfigPath
|
||||||
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_7700dd27e3487aa6 = []byte{
|
var File_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto protoreflect.FileDescriptor
|
||||||
// 209 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x48, 0xcf, 0x2c, 0xc9,
|
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
|
||||||
0x4a, 0x41, 0x66, 0x16, 0x64, 0xa7, 0xeb, 0x17, 0x95, 0xe6, 0x95, 0x64, 0xe6, 0xa6, 0xe6, 0x17,
|
|
||||||
0x94, 0x64, 0xe6, 0xe7, 0x15, 0xeb, 0x97, 0x19, 0xea, 0x27, 0x16, 0x64, 0xea, 0x15, 0x14, 0xe5,
|
|
||||||
0x97, 0xe4, 0x0b, 0x09, 0xa2, 0x4a, 0xea, 0x95, 0x19, 0x4a, 0xe9, 0x22, 0x19, 0x9a, 0x9e, 0x9f,
|
|
||||||
0x9e, 0xaf, 0x0f, 0x56, 0x99, 0x54, 0x9a, 0x06, 0xe6, 0x81, 0x39, 0x60, 0x16, 0xc4, 0x04, 0x25,
|
|
||||||
0x57, 0x2e, 0x76, 0x7f, 0x88, 0x66, 0x21, 0x49, 0x2e, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xf8, 0xd2,
|
|
||||||
0xa2, 0x1c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x76, 0x10, 0x3f, 0xb4, 0x28, 0x47, 0x48,
|
|
||||||
0x9e, 0x8b, 0x3b, 0x39, 0x3f, 0x2f, 0x2d, 0x33, 0x3d, 0xbe, 0x20, 0xb1, 0x24, 0x43, 0x82, 0x09,
|
|
||||||
0x2c, 0xcb, 0x05, 0x11, 0x0a, 0x48, 0x2c, 0xc9, 0x70, 0x4a, 0x3a, 0xf1, 0x50, 0x8e, 0xe1, 0xc6,
|
|
||||||
0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8,
|
|
||||||
0xe0, 0x91, 0x1c, 0x63, 0x94, 0x07, 0x79, 0x9e, 0xb4, 0x46, 0x15, 0x89, 0x2f, 0x33, 0x4c, 0x62,
|
|
||||||
0x03, 0xbb, 0xd8, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x94, 0x37, 0xcc, 0x49, 0x37, 0x01, 0x00,
|
|
||||||
0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Options) Marshal() (dAtA []byte, err error) {
|
var file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDesc = []byte{
|
||||||
size := m.Size()
|
0x0a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
dAtA = make([]byte, size)
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
0x72, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x70,
|
||||||
if err != nil {
|
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
return nil, err
|
0x74, 0x6f, 0x12, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x70, 0x74, 0x69, 0x6f,
|
||||||
}
|
0x6e, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||||
return dAtA[:n], nil
|
0x6d, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
|
||||||
}
|
0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x07, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
|
||||||
func (m *Options) MarshalTo(dAtA []byte) (int, error) {
|
0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
size := m.Size()
|
0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f,
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
0x6e, 0x66, 0x69, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
}
|
0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x42, 0x4a, 0x5a, 0x48, 0x67,
|
||||||
|
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
|
||||||
func (m *Options) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f,
|
||||||
i := len(dAtA)
|
0x70, 0x6b, 0x67, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x70, 0x74, 0x69, 0x6f,
|
||||||
_ = i
|
0x6e, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x70, 0x74,
|
||||||
var l int
|
0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
_ = l
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
i -= len(m.XXX_unrecognized)
|
|
||||||
copy(dAtA[i:], m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
if len(m.ConfigPath) > 0 {
|
|
||||||
i -= len(m.ConfigPath)
|
|
||||||
copy(dAtA[i:], m.ConfigPath)
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.ConfigPath)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x12
|
|
||||||
}
|
|
||||||
if len(m.TypeUrl) > 0 {
|
|
||||||
i -= len(m.TypeUrl)
|
|
||||||
copy(dAtA[i:], m.TypeUrl)
|
|
||||||
i = encodeVarintApi(dAtA, i, uint64(len(m.TypeUrl)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovApi(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Options) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.TypeUrl)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovApi(uint64(l))
|
|
||||||
}
|
|
||||||
l = len(m.ConfigPath)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovApi(uint64(l))
|
|
||||||
}
|
|
||||||
if m.XXX_unrecognized != nil {
|
|
||||||
n += len(m.XXX_unrecognized)
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovApi(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozApi(x uint64) (n int) {
|
|
||||||
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (this *Options) String() string {
|
|
||||||
if this == nil {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
s := strings.Join([]string{`&Options{`,
|
|
||||||
`TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`,
|
|
||||||
`ConfigPath:` + fmt.Sprintf("%v", this.ConfigPath) + `,`,
|
|
||||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
|
||||||
`}`,
|
|
||||||
}, "")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
func valueToStringApi(v interface{}) string {
|
|
||||||
rv := reflect.ValueOf(v)
|
|
||||||
if rv.IsNil() {
|
|
||||||
return "nil"
|
|
||||||
}
|
|
||||||
pv := reflect.Indirect(rv).Interface()
|
|
||||||
return fmt.Sprintf("*%v", pv)
|
|
||||||
}
|
|
||||||
func (m *Options) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowApi
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Options: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Options: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowApi
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.TypeUrl = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ConfigPath", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowApi
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.ConfigPath = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipApi(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipApi(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowApi
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowApi
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowApi
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupApi
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthApi
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescOnce sync.Once
|
||||||
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescData = file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDesc
|
||||||
ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescGZIP() []byte {
|
||||||
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescOnce.Do(func() {
|
||||||
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_goTypes = []interface{}{
|
||||||
|
(*Options)(nil), // 0: runtimeoptions.v1.Options
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_depIdxs = []int32{
|
||||||
|
0, // [0:0] is the sub-list for method output_type
|
||||||
|
0, // [0:0] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*Options); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_depIdxs,
|
||||||
|
MessageInfos: file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_pkg_runtimeoptions_v1_api_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
@ -17,28 +17,28 @@
|
|||||||
package protobuf
|
package protobuf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/containerd/containerd/protobuf/types"
|
|
||||||
"github.com/containerd/typeurl"
|
"github.com/containerd/typeurl"
|
||||||
|
"google.golang.org/protobuf/types/known/anypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FromAny converts typeurl.Any to github.com/containerd/containerd/protobuf/types.Any.
|
// FromAny converts typeurl.Any to github.com/containerd/containerd/protobuf/types.Any.
|
||||||
func FromAny(from typeurl.Any) *types.Any {
|
func FromAny(from typeurl.Any) *anypb.Any {
|
||||||
if from == nil {
|
if from == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if pbany, ok := from.(*types.Any); ok {
|
if pbany, ok := from.(*anypb.Any); ok {
|
||||||
return pbany
|
return pbany
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.Any{
|
return &anypb.Any{
|
||||||
TypeUrl: from.GetTypeUrl(),
|
TypeUrl: from.GetTypeUrl(),
|
||||||
Value: from.GetValue(),
|
Value: from.GetValue(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromAny converts an arbitrary interface to github.com/containerd/containerd/protobuf/types.Any.
|
// FromAny converts an arbitrary interface to github.com/containerd/containerd/protobuf/types.Any.
|
||||||
func MarshalAnyToProto(from interface{}) (*types.Any, error) {
|
func MarshalAnyToProto(from interface{}) (*anypb.Any, error) {
|
||||||
any, err := typeurl.MarshalAny(from)
|
any, err := typeurl.MarshalAny(from)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -14,15 +14,28 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package fieldpath
|
package protobuf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/containerd/containerd/protobuf/plugin"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/gogo/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Enabled returns true if E_Fieldpath is enabled
|
var Compare = cmp.FilterValues(
|
||||||
func Enabled(file *descriptor.FileDescriptorProto, message *descriptor.DescriptorProto) bool {
|
func(x, y interface{}) bool {
|
||||||
return proto.GetBoolExtension(message.Options, plugin.E_Fieldpath, proto.GetBoolExtension(file.Options, plugin.E_FieldpathAll, false))
|
_, xok := x.(proto.Message)
|
||||||
}
|
_, yok := y.(proto.Message)
|
||||||
|
return xok && yok
|
||||||
|
},
|
||||||
|
cmp.Comparer(func(x, y interface{}) bool {
|
||||||
|
vx, ok := x.(proto.Message)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
vy, ok := y.(proto.Message)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return proto.Equal(vx, vy)
|
||||||
|
}),
|
||||||
|
)
|
@ -1,66 +1,144 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Protocol Buffers for Go with Gadgets
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
||||||
|
// http://github.com/gogo/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.26.0
|
||||||
|
// protoc v3.11.4
|
||||||
// source: github.com/containerd/containerd/protobuf/plugin/fieldpath.proto
|
// source: github.com/containerd/containerd/protobuf/plugin/fieldpath.proto
|
||||||
|
|
||||||
package plugin
|
package plugin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
math "math"
|
reflect "reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||||
// is compatible with the proto package it is being compiled against.
|
{
|
||||||
// A compilation error at this line likely means your copy of the
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
// proto package needs to be updated.
|
ExtensionType: (*bool)(nil),
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
Field: 63300,
|
||||||
|
Name: "containerd.plugin.fieldpath_all",
|
||||||
var E_FieldpathAll = &proto.ExtensionDesc{
|
Tag: "varint,63300,opt,name=fieldpath_all",
|
||||||
ExtendedType: (*descriptor.FileOptions)(nil),
|
Filename: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto",
|
||||||
ExtensionType: (*bool)(nil),
|
},
|
||||||
Field: 63300,
|
{
|
||||||
Name: "containerd.plugin.fieldpath_all",
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
Tag: "varint,63300,opt,name=fieldpath_all",
|
ExtensionType: (*bool)(nil),
|
||||||
Filename: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto",
|
Field: 64400,
|
||||||
|
Name: "containerd.plugin.fieldpath",
|
||||||
|
Tag: "varint,64400,opt,name=fieldpath",
|
||||||
|
Filename: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_Fieldpath = &proto.ExtensionDesc{
|
// Extension fields to descriptor.FileOptions.
|
||||||
ExtendedType: (*descriptor.MessageOptions)(nil),
|
var (
|
||||||
ExtensionType: (*bool)(nil),
|
// optional bool fieldpath_all = 63300;
|
||||||
Field: 64400,
|
E_FieldpathAll = &file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes[0]
|
||||||
Name: "containerd.plugin.fieldpath",
|
)
|
||||||
Tag: "varint,64400,opt,name=fieldpath",
|
|
||||||
Filename: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto",
|
// Extension fields to descriptor.MessageOptions.
|
||||||
|
var (
|
||||||
|
// optional bool fieldpath = 64400;
|
||||||
|
E_Fieldpath = &file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes[1]
|
||||||
|
)
|
||||||
|
|
||||||
|
var File_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
|
0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x6c, 0x75, 0x67,
|
||||||
|
0x69, 0x6e, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x12, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x70,
|
||||||
|
0x6c, 0x75, 0x67, 0x69, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
|
||||||
|
0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x43, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64,
|
||||||
|
0x70, 0x61, 0x74, 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||||
|
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f,
|
||||||
|
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc4, 0xee, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c,
|
||||||
|
0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x09,
|
||||||
|
0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||||
|
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73,
|
||||||
|
0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x90, 0xf7, 0x03, 0x20, 0x01,
|
||||||
|
0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x42, 0x32, 0x5a,
|
||||||
|
0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74,
|
||||||
|
0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||||
|
0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69,
|
||||||
|
0x6e,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_goTypes = []interface{}{
|
||||||
proto.RegisterExtension(E_FieldpathAll)
|
(*descriptor.FileOptions)(nil), // 0: google.protobuf.FileOptions
|
||||||
proto.RegisterExtension(E_Fieldpath)
|
(*descriptor.MessageOptions)(nil), // 1: google.protobuf.MessageOptions
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_depIdxs = []int32{
|
||||||
|
0, // 0: containerd.plugin.fieldpath_all:extendee -> google.protobuf.FileOptions
|
||||||
|
1, // 1: containerd.plugin.fieldpath:extendee -> google.protobuf.MessageOptions
|
||||||
|
2, // [2:2] is the sub-list for method output_type
|
||||||
|
2, // [2:2] is the sub-list for method input_type
|
||||||
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
0, // [0:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() { file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_init() }
|
||||||
proto.RegisterFile("github.com/containerd/containerd/protobuf/plugin/fieldpath.proto", fileDescriptor_604a244430167409)
|
func file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_init() {
|
||||||
}
|
if File_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto != nil {
|
||||||
|
return
|
||||||
var fileDescriptor_604a244430167409 = []byte{
|
}
|
||||||
// 208 bytes of a gzipped FileDescriptorProto
|
type x struct{}
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x48, 0xcf, 0x2c, 0xc9,
|
out := protoimpl.TypeBuilder{
|
||||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
|
File: protoimpl.DescBuilder{
|
||||||
0x4a, 0x41, 0x66, 0x16, 0x14, 0xe5, 0x97, 0xe4, 0x27, 0x95, 0xa6, 0xe9, 0x17, 0xe4, 0x94, 0xa6,
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
0x67, 0xe6, 0xe9, 0xa7, 0x65, 0xa6, 0xe6, 0xa4, 0x14, 0x24, 0x96, 0x64, 0xe8, 0x81, 0x65, 0x84,
|
RawDescriptor: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_rawDesc,
|
||||||
0x04, 0x11, 0x6a, 0xf5, 0x20, 0x4a, 0xa4, 0x14, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0x11, 0x5a,
|
NumEnums: 0,
|
||||||
0x53, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0xf2, 0x8b, 0x20, 0x9a, 0xac, 0x9c, 0xb9, 0x78,
|
NumMessages: 0,
|
||||||
0xe1, 0xe6, 0xc4, 0x27, 0xe6, 0xe4, 0x08, 0xc9, 0xe8, 0x41, 0xf4, 0xe8, 0xc1, 0xf4, 0xe8, 0xb9,
|
NumExtensions: 2,
|
||||||
0x65, 0xe6, 0xa4, 0xfa, 0x17, 0x94, 0x64, 0xe6, 0xe7, 0x15, 0x4b, 0x1c, 0x79, 0xc7, 0xac, 0xc0,
|
NumServices: 0,
|
||||||
0xa8, 0xc1, 0x11, 0xc4, 0x03, 0xd7, 0xe4, 0x98, 0x93, 0x63, 0x65, 0xcf, 0xc5, 0x09, 0xe7, 0x0b,
|
},
|
||||||
0xc9, 0x63, 0x18, 0xe0, 0x9b, 0x5a, 0x5c, 0x9c, 0x98, 0x0e, 0x37, 0x63, 0xc2, 0x77, 0x88, 0x19,
|
GoTypes: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_goTypes,
|
||||||
0x08, 0x3d, 0x4e, 0x5e, 0x27, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xd0, 0xf0, 0x48, 0x8e,
|
DependencyIndexes: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_depIdxs,
|
||||||
0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x8c, 0x32, 0x20,
|
ExtensionInfos: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes,
|
||||||
0x35, 0x58, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x81, 0x40, 0x89, 0x49, 0x01, 0x00, 0x00,
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_depIdxs = nil
|
||||||
}
|
}
|
||||||
|
@ -1,172 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package fieldpath
|
|
||||||
|
|
||||||
import (
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/gogo/protobuf/gogoproto"
|
|
||||||
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
|
||||||
"github.com/gogo/protobuf/protoc-gen-gogo/generator"
|
|
||||||
)
|
|
||||||
|
|
||||||
type fieldpathGenerator struct {
|
|
||||||
*generator.Generator
|
|
||||||
generator.PluginImports
|
|
||||||
typeurlPkg generator.Single
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
generator.RegisterPlugin(new(fieldpathGenerator))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *fieldpathGenerator) Name() string {
|
|
||||||
return "fieldpath"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *fieldpathGenerator) Init(g *generator.Generator) {
|
|
||||||
p.Generator = g
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *fieldpathGenerator) Generate(file *generator.FileDescriptor) {
|
|
||||||
p.PluginImports = generator.NewPluginImports(p.Generator)
|
|
||||||
p.typeurlPkg = p.NewImport("github.com/containerd/typeurl")
|
|
||||||
|
|
||||||
for _, m := range file.Messages() {
|
|
||||||
if m.DescriptorProto.GetOptions().GetMapEntry() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if Enabled(file.FileDescriptorProto, m.DescriptorProto) {
|
|
||||||
p.generateMessage(m)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *fieldpathGenerator) generateMessage(m *generator.Descriptor) {
|
|
||||||
ccTypeName := generator.CamelCaseSlice(m.TypeName())
|
|
||||||
|
|
||||||
p.P()
|
|
||||||
p.P(`// Field returns the value for the given fieldpath as a string, if defined.`)
|
|
||||||
p.P(`// If the value is not defined, the second value will be false.`)
|
|
||||||
p.P("func(m *", ccTypeName, ") Field(fieldpath []string) (string, bool) {")
|
|
||||||
p.In()
|
|
||||||
|
|
||||||
var (
|
|
||||||
fields []*descriptor.FieldDescriptorProto
|
|
||||||
unhandled []*descriptor.FieldDescriptorProto
|
|
||||||
)
|
|
||||||
|
|
||||||
for _, f := range m.Field {
|
|
||||||
if f.IsBool() || f.IsString() || isLabelsField(f) || isAnyField(f) || isMessageField(f) {
|
|
||||||
fields = append(fields, f)
|
|
||||||
} else {
|
|
||||||
unhandled = append(unhandled, f)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(fields) > 0 {
|
|
||||||
p.P(`if len(fieldpath) == 0 {`)
|
|
||||||
p.In()
|
|
||||||
p.P(`return "", false`)
|
|
||||||
p.Out()
|
|
||||||
p.P(`}`)
|
|
||||||
p.P()
|
|
||||||
p.P("switch fieldpath[0] {")
|
|
||||||
|
|
||||||
for _, f := range unhandled {
|
|
||||||
p.P("// unhandled: ", f.GetName())
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, f := range fields {
|
|
||||||
fName := generator.CamelCase(*f.Name)
|
|
||||||
if gogoproto.IsCustomName(f) {
|
|
||||||
fName = gogoproto.GetCustomName(f)
|
|
||||||
}
|
|
||||||
|
|
||||||
p.P(`case "`, f.GetName(), `":`)
|
|
||||||
p.In()
|
|
||||||
switch {
|
|
||||||
case isLabelsField(f):
|
|
||||||
p.P(`// Labels fields have been special-cased by name. If this breaks,`)
|
|
||||||
p.P(`// add better special casing to fieldpath plugin.`)
|
|
||||||
p.P(`if len(m.`, fName, `) == 0 {`)
|
|
||||||
p.In()
|
|
||||||
p.P(`return "", false`)
|
|
||||||
p.Out()
|
|
||||||
p.P("}")
|
|
||||||
p.P(`value, ok := m.`, fName, `[strings.Join(fieldpath[1:], ".")]`)
|
|
||||||
p.P(`return value, ok`)
|
|
||||||
case isAnyField(f):
|
|
||||||
p.P(`decoded, err := `, p.typeurlPkg.Use(), `.UnmarshalAny(m.`, fName, `)`)
|
|
||||||
p.P(`if err != nil {`)
|
|
||||||
p.In()
|
|
||||||
p.P(`return "", false`)
|
|
||||||
p.Out()
|
|
||||||
p.P(`}`)
|
|
||||||
p.P()
|
|
||||||
p.P(`adaptor, ok := decoded.(interface { Field([]string) (string, bool) })`)
|
|
||||||
p.P(`if !ok {`)
|
|
||||||
p.In()
|
|
||||||
p.P(`return "", false`)
|
|
||||||
p.Out()
|
|
||||||
p.P(`}`)
|
|
||||||
p.P(`return adaptor.Field(fieldpath[1:])`)
|
|
||||||
case isMessageField(f):
|
|
||||||
p.P(`// NOTE(stevvooe): This is probably not correct in many cases.`)
|
|
||||||
p.P(`// We assume that the target message also implements the Field`)
|
|
||||||
p.P(`// method, which isn't likely true in a lot of cases.`)
|
|
||||||
p.P(`//`)
|
|
||||||
p.P(`// If you have a broken build and have found this comment,`)
|
|
||||||
p.P(`// you may be closer to a solution.`)
|
|
||||||
p.P(`if m.`, fName, ` == nil {`)
|
|
||||||
p.In()
|
|
||||||
p.P(`return "", false`)
|
|
||||||
p.Out()
|
|
||||||
p.P(`}`)
|
|
||||||
p.P()
|
|
||||||
p.P(`return m.`, fName, `.Field(fieldpath[1:])`)
|
|
||||||
case f.IsString():
|
|
||||||
p.P(`return string(m.`, fName, `), len(m.`, fName, `) > 0`)
|
|
||||||
case f.IsBool():
|
|
||||||
p.P(`return fmt.Sprint(m.`, fName, `), true`)
|
|
||||||
}
|
|
||||||
p.Out()
|
|
||||||
}
|
|
||||||
|
|
||||||
p.P(`}`)
|
|
||||||
} else {
|
|
||||||
for _, f := range unhandled {
|
|
||||||
p.P("// unhandled: ", f.GetName())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p.P(`return "", false`)
|
|
||||||
p.Out()
|
|
||||||
p.P("}")
|
|
||||||
}
|
|
||||||
|
|
||||||
func isMessageField(f *descriptor.FieldDescriptorProto) bool {
|
|
||||||
return !f.IsRepeated() && f.IsMessage() && f.GetTypeName() != ".google.protobuf.Timestamp"
|
|
||||||
}
|
|
||||||
|
|
||||||
func isLabelsField(f *descriptor.FieldDescriptorProto) bool {
|
|
||||||
return f.IsMessage() && f.GetName() == "labels" && strings.HasSuffix(f.GetTypeName(), ".LabelsEntry")
|
|
||||||
}
|
|
||||||
|
|
||||||
func isAnyField(f *descriptor.FieldDescriptorProto) bool {
|
|
||||||
return !f.IsRepeated() && f.IsMessage() && f.GetTypeName() == ".google.protobuf.Any"
|
|
||||||
}
|
|
@ -18,13 +18,13 @@
|
|||||||
package proto
|
package proto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
gogo "github.com/gogo/protobuf/proto"
|
google "google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Marshal(input gogo.Message) ([]byte, error) {
|
func Marshal(input google.Message) ([]byte, error) {
|
||||||
return gogo.Marshal(input)
|
return google.Marshal(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Unmarshal(input []byte, output gogo.Message) error {
|
func Unmarshal(input []byte, output google.Message) error {
|
||||||
return gogo.Unmarshal(input, output)
|
return google.Unmarshal(input, output)
|
||||||
}
|
}
|
||||||
|
@ -19,30 +19,18 @@ package protobuf
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/types"
|
"google.golang.org/protobuf/types/known/timestamppb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Once we migrate off from gogo/protobuf, we can use the function below, which don't return any errors.
|
// Once we migrate off from gogo/protobuf, we can use the function below, which don't return any errors.
|
||||||
// https://github.com/protocolbuffers/protobuf-go/blob/v1.28.0/types/known/timestamppb/timestamp.pb.go#L200-L208
|
// https://github.com/protocolbuffers/protobuf-go/blob/v1.28.0/types/known/timestamppb/timestamp.pb.go#L200-L208
|
||||||
|
|
||||||
// ToTimestamp creates protobuf's Timestamp from time.Time.
|
// ToTimestamp creates protobuf's Timestamp from time.Time.
|
||||||
func ToTimestamp(from time.Time) *types.Timestamp {
|
func ToTimestamp(from time.Time) *timestamppb.Timestamp {
|
||||||
pt, err := types.TimestampProto(from)
|
return timestamppb.New(from)
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return pt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromTimestamp creates time.Time from protobuf's Timestamp.
|
// FromTimestamp creates time.Time from protobuf's Timestamp.
|
||||||
func FromTimestamp(from *types.Timestamp) time.Time {
|
func FromTimestamp(from *timestamppb.Timestamp) time.Time {
|
||||||
if from == nil {
|
return from.AsTime()
|
||||||
// Return time.Time's zero value as like timestamppb.
|
|
||||||
return time.Time{}.UTC()
|
|
||||||
}
|
|
||||||
tt, err := types.TimestampFromProto(from)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return tt
|
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,11 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
gogo "github.com/gogo/protobuf/types"
|
"google.golang.org/genproto/protobuf/field_mask"
|
||||||
|
"google.golang.org/protobuf/types/known/anypb"
|
||||||
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Empty = gogo.Empty
|
type Empty = emptypb.Empty
|
||||||
type Any = gogo.Any
|
type Any = anypb.Any
|
||||||
type FieldMask = gogo.FieldMask
|
type FieldMask = field_mask.FieldMask
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -449,13 +449,13 @@ func (s *Service) Checkpoint(ctx context.Context, r *shimapi.CheckpointTaskReque
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var options runctypes.CheckpointOptions
|
var options *runctypes.CheckpointOptions
|
||||||
if r.Options != nil {
|
if r.Options != nil {
|
||||||
v, err := typeurl.UnmarshalAny(r.Options)
|
v, err := typeurl.UnmarshalAny(r.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
options = *v.(*runctypes.CheckpointOptions)
|
options = v.(*runctypes.CheckpointOptions)
|
||||||
}
|
}
|
||||||
if err := p.(*process.Init).Checkpoint(ctx, &process.CheckpointConfig{
|
if err := p.(*process.Init).Checkpoint(ctx, &process.CheckpointConfig{
|
||||||
Path: r.Path,
|
Path: r.Path,
|
||||||
@ -644,13 +644,13 @@ func getTopic(ctx context.Context, e interface{}) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newInit(ctx context.Context, path, workDir, runtimeRoot, namespace string, systemdCgroup bool, platform stdio.Platform, r *process.CreateConfig, rootfs string) (*process.Init, error) {
|
func newInit(ctx context.Context, path, workDir, runtimeRoot, namespace string, systemdCgroup bool, platform stdio.Platform, r *process.CreateConfig, rootfs string) (*process.Init, error) {
|
||||||
var options runctypes.CreateOptions
|
options := &runctypes.CreateOptions{}
|
||||||
if r.Options != nil {
|
if r.Options != nil {
|
||||||
v, err := typeurl.UnmarshalAny(r.Options)
|
v, err := typeurl.UnmarshalAny(r.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
options = *v.(*runctypes.CreateOptions)
|
options = v.(*runctypes.CreateOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime := process.NewRunc(runtimeRoot, path, namespace, r.Runtime, systemdCgroup)
|
runtime := process.NewRunc(runtimeRoot, path, namespace, r.Runtime, systemdCgroup)
|
||||||
|
File diff suppressed because it is too large
Load Diff
285
runtime/v1/shim/v1/shim_ttrpc.pb.go
Normal file
285
runtime/v1/shim/v1/shim_ttrpc.pb.go
Normal file
@ -0,0 +1,285 @@
|
|||||||
|
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
|
||||||
|
// source: github.com/containerd/containerd/runtime/v1/shim/v1/shim.proto
|
||||||
|
package shim
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
ttrpc "github.com/containerd/ttrpc"
|
||||||
|
empty "github.com/golang/protobuf/ptypes/empty"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ShimService interface {
|
||||||
|
State(context.Context, *StateRequest) (*StateResponse, error)
|
||||||
|
Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error)
|
||||||
|
Start(context.Context, *StartRequest) (*StartResponse, error)
|
||||||
|
Delete(context.Context, *empty.Empty) (*DeleteResponse, error)
|
||||||
|
DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error)
|
||||||
|
ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error)
|
||||||
|
Pause(context.Context, *empty.Empty) (*empty.Empty, error)
|
||||||
|
Resume(context.Context, *empty.Empty) (*empty.Empty, error)
|
||||||
|
Checkpoint(context.Context, *CheckpointTaskRequest) (*empty.Empty, error)
|
||||||
|
Kill(context.Context, *KillRequest) (*empty.Empty, error)
|
||||||
|
Exec(context.Context, *ExecProcessRequest) (*empty.Empty, error)
|
||||||
|
ResizePty(context.Context, *ResizePtyRequest) (*empty.Empty, error)
|
||||||
|
CloseIO(context.Context, *CloseIORequest) (*empty.Empty, error)
|
||||||
|
ShimInfo(context.Context, *empty.Empty) (*ShimInfoResponse, error)
|
||||||
|
Update(context.Context, *UpdateTaskRequest) (*empty.Empty, error)
|
||||||
|
Wait(context.Context, *WaitRequest) (*WaitResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterShimService(srv *ttrpc.Server, svc ShimService) {
|
||||||
|
srv.RegisterService("containerd.runtime.linux.shim.v1.Shim", &ttrpc.ServiceDesc{
|
||||||
|
Methods: map[string]ttrpc.Method{
|
||||||
|
"State": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req StateRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.State(ctx, &req)
|
||||||
|
},
|
||||||
|
"Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req CreateTaskRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Create(ctx, &req)
|
||||||
|
},
|
||||||
|
"Start": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req StartRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Start(ctx, &req)
|
||||||
|
},
|
||||||
|
"Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req empty.Empty
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Delete(ctx, &req)
|
||||||
|
},
|
||||||
|
"DeleteProcess": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req DeleteProcessRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.DeleteProcess(ctx, &req)
|
||||||
|
},
|
||||||
|
"ListPids": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ListPidsRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.ListPids(ctx, &req)
|
||||||
|
},
|
||||||
|
"Pause": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req empty.Empty
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Pause(ctx, &req)
|
||||||
|
},
|
||||||
|
"Resume": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req empty.Empty
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Resume(ctx, &req)
|
||||||
|
},
|
||||||
|
"Checkpoint": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req CheckpointTaskRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Checkpoint(ctx, &req)
|
||||||
|
},
|
||||||
|
"Kill": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req KillRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Kill(ctx, &req)
|
||||||
|
},
|
||||||
|
"Exec": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ExecProcessRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Exec(ctx, &req)
|
||||||
|
},
|
||||||
|
"ResizePty": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req ResizePtyRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.ResizePty(ctx, &req)
|
||||||
|
},
|
||||||
|
"CloseIO": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req CloseIORequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.CloseIO(ctx, &req)
|
||||||
|
},
|
||||||
|
"ShimInfo": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req empty.Empty
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.ShimInfo(ctx, &req)
|
||||||
|
},
|
||||||
|
"Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req UpdateTaskRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Update(ctx, &req)
|
||||||
|
},
|
||||||
|
"Wait": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||||
|
var req WaitRequest
|
||||||
|
if err := unmarshal(&req); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return svc.Wait(ctx, &req)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
type shimClient struct {
|
||||||
|
client *ttrpc.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewShimClient(client *ttrpc.Client) ShimService {
|
||||||
|
return &shimClient{
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) State(ctx context.Context, req *StateRequest) (*StateResponse, error) {
|
||||||
|
var resp StateResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "State", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Create(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) {
|
||||||
|
var resp CreateTaskResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Create", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Start(ctx context.Context, req *StartRequest) (*StartResponse, error) {
|
||||||
|
var resp StartResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Start", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Delete(ctx context.Context, req *empty.Empty) (*DeleteResponse, error) {
|
||||||
|
var resp DeleteResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Delete", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) DeleteProcess(ctx context.Context, req *DeleteProcessRequest) (*DeleteResponse, error) {
|
||||||
|
var resp DeleteResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "DeleteProcess", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) ListPids(ctx context.Context, req *ListPidsRequest) (*ListPidsResponse, error) {
|
||||||
|
var resp ListPidsResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "ListPids", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Pause(ctx context.Context, req *empty.Empty) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Pause", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Resume(ctx context.Context, req *empty.Empty) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Resume", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Checkpoint", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Kill(ctx context.Context, req *KillRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Kill", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Exec(ctx context.Context, req *ExecProcessRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Exec", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) ResizePty(ctx context.Context, req *ResizePtyRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "ResizePty", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) CloseIO(ctx context.Context, req *CloseIORequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "CloseIO", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) ShimInfo(ctx context.Context, req *empty.Empty) (*ShimInfoResponse, error) {
|
||||||
|
var resp ShimInfoResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "ShimInfo", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Update(ctx context.Context, req *UpdateTaskRequest) (*empty.Empty, error) {
|
||||||
|
var resp empty.Empty
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Update", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *shimClient) Wait(ctx context.Context, req *WaitRequest) (*WaitResponse, error) {
|
||||||
|
var resp WaitResponse
|
||||||
|
if err := c.client.Call(ctx, "containerd.runtime.linux.shim.v1.Shim", "Wait", req, &resp); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
@ -48,14 +48,14 @@ func NewContainer(ctx context.Context, platform stdio.Platform, r *task.CreateTa
|
|||||||
return nil, fmt.Errorf("create namespace: %w", err)
|
return nil, fmt.Errorf("create namespace: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var opts options.Options
|
opts := &options.Options{}
|
||||||
if r.Options.GetValue() != nil {
|
if r.Options.GetValue() != nil {
|
||||||
v, err := typeurl.UnmarshalAny(r.Options)
|
v, err := typeurl.UnmarshalAny(r.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if v != nil {
|
if v != nil {
|
||||||
opts = *v.(*options.Options)
|
opts = v.(*options.Options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ func NewContainer(ctx context.Context, platform stdio.Platform, r *task.CreateTa
|
|||||||
ns,
|
ns,
|
||||||
platform,
|
platform,
|
||||||
config,
|
config,
|
||||||
&opts,
|
opts,
|
||||||
rootfs,
|
rootfs,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -188,7 +188,7 @@ func ReadOptions(path string) (*options.Options, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WriteOptions writes the options information into the path
|
// WriteOptions writes the options information into the path
|
||||||
func WriteOptions(path string, opts options.Options) error {
|
func WriteOptions(path string, opts *options.Options) error {
|
||||||
data, err := json.Marshal(opts)
|
data, err := json.Marshal(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -467,13 +467,13 @@ func (c *Container) Checkpoint(ctx context.Context, r *task.CheckpointTaskReques
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
var opts options.CheckpointOptions
|
var opts *options.CheckpointOptions
|
||||||
if r.Options != nil {
|
if r.Options != nil {
|
||||||
v, err := typeurl.UnmarshalAny(r.Options)
|
v, err := typeurl.UnmarshalAny(r.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
opts = *v.(*options.CheckpointOptions)
|
opts = v.(*options.CheckpointOptions)
|
||||||
}
|
}
|
||||||
return p.(*process.Init).Checkpoint(ctx, &process.CheckpointConfig{
|
return p.(*process.Init).Checkpoint(ctx, &process.CheckpointConfig{
|
||||||
Path: r.Path,
|
Path: r.Path,
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,9 @@ go install github.com/containerd/protobuild@v0.2.0
|
|||||||
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.2.0
|
go install github.com/containerd/protobuild/cmd/go-fix-acronym@v0.2.0
|
||||||
go install github.com/cpuguy83/go-md2man/v2@v2.0.1
|
go install github.com/cpuguy83/go-md2man/v2@v2.0.1
|
||||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.0
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.0
|
||||||
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
|
||||||
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
|
||||||
|
go install github.com/containerd/ttrpc/cmd/protoc-gen-go-ttrpc@944ef4a40df3446714a823207972b7d9858ffac5
|
||||||
|
|
||||||
# the following packages need to exist in $GOPATH so we can't use
|
# the following packages need to exist in $GOPATH so we can't use
|
||||||
# go modules-aware mode of `go get` for these includes used during
|
# go modules-aware mode of `go get` for these includes used during
|
||||||
|
@ -58,3 +58,11 @@ ppc64le)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
rm -rf "$PROTOBUF_DIR"
|
rm -rf "$PROTOBUF_DIR"
|
||||||
|
|
||||||
|
# Download status.proto. grpc repos' one seems copied from
|
||||||
|
# https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto,
|
||||||
|
# but we use grpc's since the repos has tags/releases.
|
||||||
|
mkdir -p /usr/local/include/google/rpc
|
||||||
|
curl \
|
||||||
|
-L https://raw.githubusercontent.com/grpc/grpc/v1.45.2/src/proto/grpc/status/status.proto \
|
||||||
|
-o /usr/local/include/google/rpc/status.proto
|
||||||
|
@ -104,7 +104,7 @@ func (s *service) List(req *api.ListContentRequest, session api.Content_ListServ
|
|||||||
if err := s.store.Walk(session.Context(), func(info content.Info) error {
|
if err := s.store.Walk(session.Context(), func(info content.Info) error {
|
||||||
buffer = append(buffer, &api.Info{
|
buffer = append(buffer, &api.Info{
|
||||||
Digest: info.Digest.String(),
|
Digest: info.Digest.String(),
|
||||||
Size_: info.Size,
|
Size: info.Size,
|
||||||
CreatedAt: protobuf.ToTimestamp(info.CreatedAt),
|
CreatedAt: protobuf.ToTimestamp(info.CreatedAt),
|
||||||
Labels: info.Labels,
|
Labels: info.Labels,
|
||||||
})
|
})
|
||||||
@ -167,7 +167,7 @@ func (s *service) Read(req *api.ReadContentRequest, session api.Content_ReadServ
|
|||||||
offset = req.Offset
|
offset = req.Offset
|
||||||
// size is read size, not the expected size of the blob (oi.Size), which the caller might not be aware of.
|
// size is read size, not the expected size of the blob (oi.Size), which the caller might not be aware of.
|
||||||
// offset+size can be larger than oi.Size.
|
// offset+size can be larger than oi.Size.
|
||||||
size = req.Size_
|
size = req.Size
|
||||||
|
|
||||||
// TODO(stevvooe): Using the global buffer pool. At 32KB, it is probably
|
// TODO(stevvooe): Using the global buffer pool. At 32KB, it is probably
|
||||||
// little inefficient for work over a fast network. We can tune this later.
|
// little inefficient for work over a fast network. We can tune this later.
|
||||||
@ -456,7 +456,7 @@ func (s *service) Abort(ctx context.Context, req *api.AbortRequest) (*ptypes.Emp
|
|||||||
func infoToGRPC(info content.Info) *api.Info {
|
func infoToGRPC(info content.Info) *api.Info {
|
||||||
return &api.Info{
|
return &api.Info{
|
||||||
Digest: info.Digest.String(),
|
Digest: info.Digest.String(),
|
||||||
Size_: info.Size,
|
Size: info.Size,
|
||||||
CreatedAt: protobuf.ToTimestamp(info.CreatedAt),
|
CreatedAt: protobuf.ToTimestamp(info.CreatedAt),
|
||||||
UpdatedAt: protobuf.ToTimestamp(info.UpdatedAt),
|
UpdatedAt: protobuf.ToTimestamp(info.UpdatedAt),
|
||||||
Labels: info.Labels,
|
Labels: info.Labels,
|
||||||
@ -466,7 +466,7 @@ func infoToGRPC(info content.Info) *api.Info {
|
|||||||
func infoFromGRPC(info *api.Info) content.Info {
|
func infoFromGRPC(info *api.Info) content.Info {
|
||||||
return content.Info{
|
return content.Info{
|
||||||
Digest: digest.Digest(info.Digest),
|
Digest: digest.Digest(info.Digest),
|
||||||
Size: info.Size_,
|
Size: info.Size,
|
||||||
CreatedAt: protobuf.FromTimestamp(info.CreatedAt),
|
CreatedAt: protobuf.FromTimestamp(info.CreatedAt),
|
||||||
UpdatedAt: protobuf.FromTimestamp(info.UpdatedAt),
|
UpdatedAt: protobuf.FromTimestamp(info.UpdatedAt),
|
||||||
Labels: info.Labels,
|
Labels: info.Labels,
|
||||||
|
@ -177,7 +177,7 @@ func toDescriptor(d *types.Descriptor) ocispec.Descriptor {
|
|||||||
return ocispec.Descriptor{
|
return ocispec.Descriptor{
|
||||||
MediaType: d.MediaType,
|
MediaType: d.MediaType,
|
||||||
Digest: digest.Digest(d.Digest),
|
Digest: digest.Digest(d.Digest),
|
||||||
Size: d.Size_,
|
Size: d.Size,
|
||||||
Annotations: d.Annotations,
|
Annotations: d.Annotations,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ func fromDescriptor(d ocispec.Descriptor) *types.Descriptor {
|
|||||||
return &types.Descriptor{
|
return &types.Descriptor{
|
||||||
MediaType: d.MediaType,
|
MediaType: d.MediaType,
|
||||||
Digest: d.Digest.String(),
|
Digest: d.Digest.String(),
|
||||||
Size_: d.Size,
|
Size: d.Size,
|
||||||
Annotations: d.Annotations,
|
Annotations: d.Annotations,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ func imageFromProto(imagepb *imagesapi.Image) images.Image {
|
|||||||
func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
|
func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
|
||||||
return ocispec.Descriptor{
|
return ocispec.Descriptor{
|
||||||
MediaType: desc.MediaType,
|
MediaType: desc.MediaType,
|
||||||
Size: desc.Size_,
|
Size: desc.Size,
|
||||||
Digest: digest.Digest(desc.Digest),
|
Digest: digest.Digest(desc.Digest),
|
||||||
Annotations: desc.Annotations,
|
Annotations: desc.Annotations,
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
|
|||||||
func descToProto(desc *ocispec.Descriptor) *types.Descriptor {
|
func descToProto(desc *ocispec.Descriptor) *types.Descriptor {
|
||||||
return &types.Descriptor{
|
return &types.Descriptor{
|
||||||
MediaType: desc.MediaType,
|
MediaType: desc.MediaType,
|
||||||
Size_: desc.Size,
|
Size: desc.Size,
|
||||||
Digest: desc.Digest.String(),
|
Digest: desc.Digest.String(),
|
||||||
Annotations: desc.Annotations,
|
Annotations: desc.Annotations,
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,9 @@ import (
|
|||||||
"github.com/containerd/containerd/plugin"
|
"github.com/containerd/containerd/plugin"
|
||||||
ptypes "github.com/containerd/containerd/protobuf/types"
|
ptypes "github.com/containerd/containerd/protobuf/types"
|
||||||
"github.com/containerd/containerd/services"
|
"github.com/containerd/containerd/services"
|
||||||
"github.com/gogo/googleapis/google/rpc"
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
"google.golang.org/genproto/googleapis/rpc/code"
|
||||||
|
rpc "google.golang.org/genproto/googleapis/rpc/status"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
@ -55,7 +56,7 @@ type Local struct {
|
|||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
root string
|
root string
|
||||||
plugins *plugin.Set
|
plugins *plugin.Set
|
||||||
pluginCache []api.Plugin
|
pluginCache []*api.Plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = (api.IntrospectionClient)(&Local{})
|
var _ = (api.IntrospectionClient)(&Local{})
|
||||||
@ -79,7 +80,7 @@ func (l *Local) Plugins(ctx context.Context, req *api.PluginsRequest, _ ...grpc.
|
|||||||
for _, p := range allPlugins {
|
for _, p := range allPlugins {
|
||||||
p := p
|
p := p
|
||||||
if filter.Match(adaptPlugin(p)) {
|
if filter.Match(adaptPlugin(p)) {
|
||||||
plugins = append(plugins, &p)
|
plugins = append(plugins, p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +89,7 @@ func (l *Local) Plugins(ctx context.Context, req *api.PluginsRequest, _ ...grpc.
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Local) getPlugins() []api.Plugin {
|
func (l *Local) getPlugins() []*api.Plugin {
|
||||||
l.mu.Lock()
|
l.mu.Lock()
|
||||||
defer l.mu.Unlock()
|
defer l.mu.Unlock()
|
||||||
plugins := l.plugins.GetAll()
|
plugins := l.plugins.GetAll()
|
||||||
@ -148,7 +149,7 @@ func (l *Local) uuidPath() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func adaptPlugin(o interface{}) filters.Adaptor {
|
func adaptPlugin(o interface{}) filters.Adaptor {
|
||||||
obj := o.(api.Plugin)
|
obj := o.(*api.Plugin)
|
||||||
return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
|
return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
|
||||||
if len(fieldpath) == 0 {
|
if len(fieldpath) == 0 {
|
||||||
return "", false
|
return "", false
|
||||||
@ -174,8 +175,8 @@ func adaptPlugin(o interface{}) filters.Adaptor {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func pluginsToPB(plugins []*plugin.Plugin) []api.Plugin {
|
func pluginsToPB(plugins []*plugin.Plugin) []*api.Plugin {
|
||||||
var pluginsPB []api.Plugin
|
var pluginsPB []*api.Plugin
|
||||||
for _, p := range plugins {
|
for _, p := range plugins {
|
||||||
var platforms []*types.Platform
|
var platforms []*types.Platform
|
||||||
for _, p := range p.Meta.Platforms {
|
for _, p := range p.Meta.Platforms {
|
||||||
@ -209,13 +210,13 @@ func pluginsToPB(plugins []*plugin.Plugin) []api.Plugin {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
initErr = &rpc.Status{
|
initErr = &rpc.Status{
|
||||||
Code: int32(rpc.UNKNOWN),
|
Code: int32(code.Code_UNKNOWN),
|
||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginsPB = append(pluginsPB, api.Plugin{
|
pluginsPB = append(pluginsPB, &api.Plugin{
|
||||||
Type: p.Registration.Type.String(),
|
Type: p.Registration.Type.String(),
|
||||||
ID: p.Registration.ID,
|
ID: p.Registration.ID,
|
||||||
Requires: requires,
|
Requires: requires,
|
||||||
|
@ -300,7 +300,7 @@ func fromInfo(info snapshots.Info) *snapshotsapi.Info {
|
|||||||
func fromUsage(usage snapshots.Usage) *snapshotsapi.UsageResponse {
|
func fromUsage(usage snapshots.Usage) *snapshotsapi.UsageResponse {
|
||||||
return &snapshotsapi.UsageResponse{
|
return &snapshotsapi.UsageResponse{
|
||||||
Inodes: usage.Inodes,
|
Inodes: usage.Inodes,
|
||||||
Size_: usage.Size,
|
Size: usage.Size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
|
|||||||
reader, err := l.store.ReaderAt(ctx, ocispec.Descriptor{
|
reader, err := l.store.ReaderAt(ctx, ocispec.Descriptor{
|
||||||
MediaType: r.Checkpoint.MediaType,
|
MediaType: r.Checkpoint.MediaType,
|
||||||
Digest: digest.Digest(r.Checkpoint.Digest),
|
Digest: digest.Digest(r.Checkpoint.Digest),
|
||||||
Size: r.Checkpoint.Size_,
|
Size: r.Checkpoint.Size,
|
||||||
Annotations: r.Checkpoint.Annotations,
|
Annotations: r.Checkpoint.Annotations,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -694,7 +694,7 @@ func (l *local) writeContent(ctx context.Context, mediaType, ref string, r io.Re
|
|||||||
return &types.Descriptor{
|
return &types.Descriptor{
|
||||||
MediaType: mediaType,
|
MediaType: mediaType,
|
||||||
Digest: writer.Digest().String(),
|
Digest: writer.Digest().String(),
|
||||||
Size_: size,
|
Size: size,
|
||||||
Annotations: make(map[string]string),
|
Annotations: make(map[string]string),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ func toInfo(info *snapshotsapi.Info) snapshots.Info {
|
|||||||
func toUsage(resp *snapshotsapi.UsageResponse) snapshots.Usage {
|
func toUsage(resp *snapshotsapi.UsageResponse) snapshots.Usage {
|
||||||
return snapshots.Usage{
|
return snapshots.Usage{
|
||||||
Inodes: resp.Inodes,
|
Inodes: resp.Inodes,
|
||||||
Size: resp.Size_,
|
Size: resp.Size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
task.go
2
task.go
@ -604,7 +604,7 @@ func (t *task) checkpointTask(ctx context.Context, index *v1.Index, request *tas
|
|||||||
for _, d := range response.Descriptors {
|
for _, d := range response.Descriptors {
|
||||||
index.Manifests = append(index.Manifests, v1.Descriptor{
|
index.Manifests = append(index.Manifests, v1.Descriptor{
|
||||||
MediaType: d.MediaType,
|
MediaType: d.MediaType,
|
||||||
Size: d.Size_,
|
Size: d.Size,
|
||||||
Digest: digest.Digest(d.Digest),
|
Digest: digest.Digest(d.Digest),
|
||||||
Platform: &v1.Platform{
|
Platform: &v1.Platform{
|
||||||
OS: goruntime.GOOS,
|
OS: goruntime.GOOS,
|
||||||
|
@ -69,7 +69,7 @@ func WithTaskCheckpoint(im Image) NewTaskOpts {
|
|||||||
if m.MediaType == images.MediaTypeContainerd1Checkpoint {
|
if m.MediaType == images.MediaTypeContainerd1Checkpoint {
|
||||||
info.Checkpoint = &types.Descriptor{
|
info.Checkpoint = &types.Descriptor{
|
||||||
MediaType: m.MediaType,
|
MediaType: m.MediaType,
|
||||||
Size_: m.Size,
|
Size: m.Size,
|
||||||
Digest: m.Digest.String(),
|
Digest: m.Digest.String(),
|
||||||
Annotations: m.Annotations,
|
Annotations: m.Annotations,
|
||||||
}
|
}
|
||||||
|
1
vendor/github.com/containerd/ttrpc/.gitattributes
generated
vendored
Normal file
1
vendor/github.com/containerd/ttrpc/.gitattributes
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.go text eol=lf
|
2
vendor/github.com/containerd/ttrpc/.gitignore
generated
vendored
2
vendor/github.com/containerd/ttrpc/.gitignore
generated
vendored
@ -1,4 +1,5 @@
|
|||||||
# Binaries for programs and plugins
|
# Binaries for programs and plugins
|
||||||
|
/bin/
|
||||||
*.exe
|
*.exe
|
||||||
*.dll
|
*.dll
|
||||||
*.so
|
*.so
|
||||||
@ -9,3 +10,4 @@
|
|||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
*.out
|
*.out
|
||||||
|
coverage.txt
|
||||||
|
54
vendor/github.com/containerd/ttrpc/.golangci.yml
generated
vendored
Normal file
54
vendor/github.com/containerd/ttrpc/.golangci.yml
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- structcheck
|
||||||
|
- varcheck
|
||||||
|
- staticcheck
|
||||||
|
- unconvert
|
||||||
|
- gofmt
|
||||||
|
- goimports
|
||||||
|
- revive
|
||||||
|
- ineffassign
|
||||||
|
- vet
|
||||||
|
- unused
|
||||||
|
- misspell
|
||||||
|
disable:
|
||||||
|
- errcheck
|
||||||
|
|
||||||
|
linters-settings:
|
||||||
|
revive:
|
||||||
|
ignore-generated-headers: true
|
||||||
|
rules:
|
||||||
|
- name: blank-imports
|
||||||
|
- name: context-as-argument
|
||||||
|
- name: context-keys-type
|
||||||
|
- name: dot-imports
|
||||||
|
- name: error-return
|
||||||
|
- name: error-strings
|
||||||
|
- name: error-naming
|
||||||
|
- name: exported
|
||||||
|
- name: if-return
|
||||||
|
- name: increment-decrement
|
||||||
|
- name: var-naming
|
||||||
|
arguments: [["UID", "GID"], []]
|
||||||
|
- name: var-declaration
|
||||||
|
- name: package-comments
|
||||||
|
- name: range
|
||||||
|
- name: receiver-naming
|
||||||
|
- name: time-naming
|
||||||
|
- name: unexported-return
|
||||||
|
- name: indent-error-flow
|
||||||
|
- name: errorf
|
||||||
|
- name: empty-block
|
||||||
|
- name: superfluous-else
|
||||||
|
- name: unused-parameter
|
||||||
|
- name: unreachable-code
|
||||||
|
- name: redefines-builtin-id
|
||||||
|
|
||||||
|
issues:
|
||||||
|
include:
|
||||||
|
- EXC0002
|
||||||
|
|
||||||
|
run:
|
||||||
|
timeout: 8m
|
||||||
|
skip-dirs:
|
||||||
|
- example
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user