Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCNIServer(s grpc.ServiceRegistrar, srv CNIServer)
- type AddResponse
- type CNIArgs
- func (*CNIArgs) Descriptor() ([]byte, []int)deprecated
- func (x *CNIArgs) GetArgs() map[string]string
- func (x *CNIArgs) GetContainerId() string
- func (x *CNIArgs) GetIfname() string
- func (x *CNIArgs) GetNetns() string
- func (x *CNIArgs) GetPath() string
- func (x *CNIArgs) GetStdinData() []byte
- func (*CNIArgs) ProtoMessage()
- func (x *CNIArgs) ProtoReflect() protoreflect.Message
- func (x *CNIArgs) Reset()
- func (x *CNIArgs) String() string
- type CNIClient
- type CNIError
- func (*CNIError) Descriptor() ([]byte, []int)deprecated
- func (x *CNIError) GetCode() ErrorCode
- func (x *CNIError) GetDetails() string
- func (x *CNIError) GetMsg() string
- func (*CNIError) ProtoMessage()
- func (x *CNIError) ProtoReflect() protoreflect.Message
- func (x *CNIError) Reset()
- func (x *CNIError) String() string
- type CNIServer
- type ErrorCode
- type UnimplementedCNIServer
- type UnsafeCNIServer
Constants ¶
const ( CNI_Add_FullMethodName = "/pkg.cnirpc.CNI/Add" CNI_Del_FullMethodName = "/pkg.cnirpc.CNI/Del" CNI_Check_FullMethodName = "/pkg.cnirpc.CNI/Check" )
Variables ¶
var ( ErrorCode_name = map[int32]string{ 0: "UNKNOWN", 1: "INCOMPATIBLE_CNI_VERSION", 2: "UNSUPPORTED_FIELD", 3: "UNKNOWN_CONTAINER", 4: "INVALID_ENVIRONMENT_VARIABLES", 5: "IO_FAILURE", 6: "DECODING_FAILURE", 7: "INVALID_NETWORK_CONFIG", 11: "TRY_AGAIN_LATER", 999: "INTERNAL", } ErrorCode_value = map[string]int32{ "UNKNOWN": 0, "INCOMPATIBLE_CNI_VERSION": 1, "UNSUPPORTED_FIELD": 2, "UNKNOWN_CONTAINER": 3, "INVALID_ENVIRONMENT_VARIABLES": 4, "IO_FAILURE": 5, "DECODING_FAILURE": 6, "INVALID_NETWORK_CONFIG": 7, "TRY_AGAIN_LATER": 11, "INTERNAL": 999, } )
Enum value maps for ErrorCode.
var CNI_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pkg.cnirpc.CNI", HandlerType: (*CNIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Add", Handler: _CNI_Add_Handler, }, { MethodName: "Del", Handler: _CNI_Del_Handler, }, { MethodName: "Check", Handler: _CNI_Check_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/cnirpc/cni.proto", }
CNI_ServiceDesc is the grpc.ServiceDesc for CNI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_pkg_cnirpc_cni_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCNIServer ¶
func RegisterCNIServer(s grpc.ServiceRegistrar, srv CNIServer)
Types ¶
type AddResponse ¶
type AddResponse struct { Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
AddResponse represents the response for ADD command.
`result` is a types.current.Result serialized into JSON. https://pkg.go.dev/github.com/containernetworking/cni@v0.8.0/pkg/types/current?tab=doc#Result
func (*AddResponse) Descriptor
deprecated
func (*AddResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.
func (*AddResponse) GetResult ¶
func (x *AddResponse) GetResult() []byte
func (*AddResponse) ProtoMessage ¶
func (*AddResponse) ProtoMessage()
func (*AddResponse) ProtoReflect ¶
func (x *AddResponse) ProtoReflect() protoreflect.Message
func (*AddResponse) Reset ¶
func (x *AddResponse) Reset()
func (*AddResponse) String ¶
func (x *AddResponse) String() string
type CNIArgs ¶
type CNIArgs struct { ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` Netns string `protobuf:"bytes,2,opt,name=netns,proto3" json:"netns,omitempty"` Ifname string `protobuf:"bytes,3,opt,name=ifname,proto3" json:"ifname,omitempty"` Args map[string]string `` // Key-Value pairs parsed from CNI_ARGS /* 149-byte string literal not displayed */ Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` StdinData []byte `protobuf:"bytes,6,opt,name=stdin_data,json=stdinData,proto3" json:"stdin_data,omitempty"` // contains filtered or unexported fields }
CNIArgs is a mirror of cni.pkg.skel.CmdArgs struct. https://pkg.go.dev/github.com/containernetworking/cni@v0.8.0/pkg/skel?tab=doc#CmdArgs
func (*CNIArgs) Descriptor
deprecated
func (*CNIArgs) GetContainerId ¶
func (*CNIArgs) GetStdinData ¶
func (*CNIArgs) ProtoMessage ¶
func (*CNIArgs) ProtoMessage()
func (*CNIArgs) ProtoReflect ¶
func (x *CNIArgs) ProtoReflect() protoreflect.Message
type CNIClient ¶
type CNIClient interface { Add(ctx context.Context, in *CNIArgs, opts ...grpc.CallOption) (*AddResponse, error) Del(ctx context.Context, in *CNIArgs, opts ...grpc.CallOption) (*emptypb.Empty, error) Check(ctx context.Context, in *CNIArgs, opts ...grpc.CallOption) (*emptypb.Empty, error) }
CNIClient is the client API for CNI 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.
func NewCNIClient ¶
func NewCNIClient(cc grpc.ClientConnInterface) CNIClient
type CNIError ¶
type CNIError struct { Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=pkg.cnirpc.ErrorCode" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Details string `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"` // contains filtered or unexported fields }
CNIError is a mirror of cin.pkg.types.Error struct. https://pkg.go.dev/github.com/containernetworking/cni@v0.8.0/pkg/types?tab=doc#Error
This should be added to *grpc.Status by WithDetails() https://pkg.go.dev/google.golang.org/grpc@v1.31.0/internal/status?tab=doc#Status.WithDetails
func (*CNIError) Descriptor
deprecated
func (*CNIError) GetDetails ¶
func (*CNIError) ProtoMessage ¶
func (*CNIError) ProtoMessage()
func (*CNIError) ProtoReflect ¶
func (x *CNIError) ProtoReflect() protoreflect.Message
type CNIServer ¶
type CNIServer interface { Add(context.Context, *CNIArgs) (*AddResponse, error) Del(context.Context, *CNIArgs) (*emptypb.Empty, error) Check(context.Context, *CNIArgs) (*emptypb.Empty, error) // contains filtered or unexported methods }
CNIServer is the server API for CNI service. All implementations must embed UnimplementedCNIServer for forward compatibility
type ErrorCode ¶
type ErrorCode int32
ErrorCode enumerates errors for CNIError
const ( ErrorCode_UNKNOWN ErrorCode = 0 ErrorCode_INCOMPATIBLE_CNI_VERSION ErrorCode = 1 ErrorCode_UNSUPPORTED_FIELD ErrorCode = 2 ErrorCode_UNKNOWN_CONTAINER ErrorCode = 3 ErrorCode_INVALID_ENVIRONMENT_VARIABLES ErrorCode = 4 ErrorCode_IO_FAILURE ErrorCode = 5 ErrorCode_DECODING_FAILURE ErrorCode = 6 ErrorCode_INVALID_NETWORK_CONFIG ErrorCode = 7 ErrorCode_TRY_AGAIN_LATER ErrorCode = 11 ErrorCode_INTERNAL ErrorCode = 999 )
func (ErrorCode) Descriptor ¶
func (ErrorCode) Descriptor() protoreflect.EnumDescriptor
func (ErrorCode) EnumDescriptor
deprecated
func (ErrorCode) Number ¶
func (x ErrorCode) Number() protoreflect.EnumNumber
func (ErrorCode) Type ¶
func (ErrorCode) Type() protoreflect.EnumType
type UnimplementedCNIServer ¶
type UnimplementedCNIServer struct { }
UnimplementedCNIServer must be embedded to have forward compatible implementations.
func (UnimplementedCNIServer) Add ¶
func (UnimplementedCNIServer) Add(context.Context, *CNIArgs) (*AddResponse, error)
type UnsafeCNIServer ¶
type UnsafeCNIServer interface {
// contains filtered or unexported methods
}
UnsafeCNIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CNIServer will result in compilation errors.