Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Index ¶
- Constants
- Variables
- func RegisterNicServiceServer(s grpc.ServiceRegistrar, srv NicServiceServer)
- type DefaultRoute
- func (DefaultRoute) Descriptor() protoreflect.EnumDescriptor
- func (x DefaultRoute) Enum() *DefaultRoute
- func (DefaultRoute) EnumDescriptor() ([]byte, []int)deprecated
- func (x DefaultRoute) Number() protoreflect.EnumNumber
- func (x DefaultRoute) String() string
- func (DefaultRoute) Type() protoreflect.EnumType
- type NicAddRequest
- func (*NicAddRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NicAddRequest) GetAllowedIp() string
- func (x *NicAddRequest) GetGatewayName() string
- func (x *NicAddRequest) GetListenPort() int32
- func (x *NicAddRequest) GetPodConfig() *PodInfo
- func (x *NicAddRequest) GetPublicKey() string
- func (*NicAddRequest) ProtoMessage()
- func (x *NicAddRequest) ProtoReflect() protoreflect.Message
- func (x *NicAddRequest) Reset()
- func (x *NicAddRequest) String() string
- type NicAddResponse
- func (*NicAddResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NicAddResponse) GetDefaultRoute() DefaultRoute
- func (x *NicAddResponse) GetEndpointIp() string
- func (x *NicAddResponse) GetExceptionCidrs() []string
- func (x *NicAddResponse) GetListenPort() int32
- func (x *NicAddResponse) GetPublicKey() string
- func (*NicAddResponse) ProtoMessage()
- func (x *NicAddResponse) ProtoReflect() protoreflect.Message
- func (x *NicAddResponse) Reset()
- func (x *NicAddResponse) String() string
- type NicDelRequest
- type NicDelResponse
- type NicServiceClient
- type NicServiceServer
- type PodInfo
- type PodRetrieveRequest
- func (*PodRetrieveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PodRetrieveRequest) GetPodConfig() *PodInfo
- func (*PodRetrieveRequest) ProtoMessage()
- func (x *PodRetrieveRequest) ProtoReflect() protoreflect.Message
- func (x *PodRetrieveRequest) Reset()
- func (x *PodRetrieveRequest) String() string
- type PodRetrieveResponse
- func (*PodRetrieveResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PodRetrieveResponse) GetAnnotations() map[string]string
- func (*PodRetrieveResponse) ProtoMessage()
- func (x *PodRetrieveResponse) ProtoReflect() protoreflect.Message
- func (x *PodRetrieveResponse) Reset()
- func (x *PodRetrieveResponse) String() string
- type TestServer
- func (s *TestServer) GracefulStop()
- func (s *TestServer) NicAdd(ctx context.Context, in *NicAddRequest) (*NicAddResponse, error)
- func (s *TestServer) NicDel(ctx context.Context, in *NicDelRequest) (*NicDelResponse, error)
- func (s *TestServer) PodRetrieve(ctx context.Context, in *PodRetrieveRequest) (*PodRetrieveResponse, error)
- type UnimplementedNicServiceServer
- func (UnimplementedNicServiceServer) NicAdd(context.Context, *NicAddRequest) (*NicAddResponse, error)
- func (UnimplementedNicServiceServer) NicDel(context.Context, *NicDelRequest) (*NicDelResponse, error)
- func (UnimplementedNicServiceServer) PodRetrieve(context.Context, *PodRetrieveRequest) (*PodRetrieveResponse, error)
- type UnsafeNicServiceServer
Constants ¶
const ( NicService_NicAdd_FullMethodName = "/pkg.cniprotocol.v1.NicService/NicAdd" NicService_NicDel_FullMethodName = "/pkg.cniprotocol.v1.NicService/NicDel" NicService_PodRetrieve_FullMethodName = "/pkg.cniprotocol.v1.NicService/PodRetrieve" )
const ( TEST_SERVER_WIREGUARD_SERVER_IP = "10.2.0.4" TEST_SERVER_WIREGUARD_SERVER_PORT int32 = 6000 TEST_SERVER_WIREGUARD_PUBLIC_KEY = "aPxGwq8zERHQ3Q1cOZFdJ+cvJX5Ka4mLN38AyYKYF10=" TEST_SERVER_WIREGUARD_PRIVATE_KEY = "GHuMwljFfqd2a7cs6BaUOmHflK23zME8VNvC5B37S3k=" )
Variables ¶
var ( DefaultRoute_name = map[int32]string{ 0: "DEFAULT_ROUTE_UNSPECIFIED", 1: "DEFAULT_ROUTE_STATIC_EGRESS_GATEWAY", 2: "DEFAULT_ROUTE_AZURE_NETWORKING", } DefaultRoute_value = map[string]int32{ "DEFAULT_ROUTE_UNSPECIFIED": 0, "DEFAULT_ROUTE_STATIC_EGRESS_GATEWAY": 1, "DEFAULT_ROUTE_AZURE_NETWORKING": 2, } )
Enum value maps for DefaultRoute.
var File_pkg_cniprotocol_v1_cni_proto protoreflect.FileDescriptor
var NicService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pkg.cniprotocol.v1.NicService", HandlerType: (*NicServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "NicAdd", Handler: _NicService_NicAdd_Handler, }, { MethodName: "NicDel", Handler: _NicService_NicDel_Handler, }, { MethodName: "PodRetrieve", Handler: _NicService_PodRetrieve_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/cniprotocol/v1/cni.proto", }
NicService_ServiceDesc is the grpc.ServiceDesc for NicService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNicServiceServer ¶
func RegisterNicServiceServer(s grpc.ServiceRegistrar, srv NicServiceServer)
Types ¶
type DefaultRoute ¶
type DefaultRoute int32
const ( DefaultRoute_DEFAULT_ROUTE_UNSPECIFIED DefaultRoute = 0 DefaultRoute_DEFAULT_ROUTE_STATIC_EGRESS_GATEWAY DefaultRoute = 1 DefaultRoute_DEFAULT_ROUTE_AZURE_NETWORKING DefaultRoute = 2 )
func (DefaultRoute) Descriptor ¶
func (DefaultRoute) Descriptor() protoreflect.EnumDescriptor
func (DefaultRoute) Enum ¶
func (x DefaultRoute) Enum() *DefaultRoute
func (DefaultRoute) EnumDescriptor
deprecated
func (DefaultRoute) EnumDescriptor() ([]byte, []int)
Deprecated: Use DefaultRoute.Descriptor instead.
func (DefaultRoute) Number ¶
func (x DefaultRoute) Number() protoreflect.EnumNumber
func (DefaultRoute) String ¶
func (x DefaultRoute) String() string
func (DefaultRoute) Type ¶
func (DefaultRoute) Type() protoreflect.EnumType
type NicAddRequest ¶
type NicAddRequest struct { PodConfig *PodInfo `protobuf:"bytes,1,opt,name=pod_config,json=podConfig,proto3" json:"pod_config,omitempty"` ListenPort int32 `protobuf:"varint,2,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` AllowedIp string `protobuf:"bytes,3,opt,name=allowed_ip,json=allowedIp,proto3" json:"allowed_ip,omitempty"` PublicKey string `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` GatewayName string `protobuf:"bytes,5,opt,name=gateway_name,json=gatewayName,proto3" json:"gateway_name,omitempty"` // contains filtered or unexported fields }
CNIAddRequest is the request for cni add function.
func (*NicAddRequest) Descriptor
deprecated
func (*NicAddRequest) Descriptor() ([]byte, []int)
Deprecated: Use NicAddRequest.ProtoReflect.Descriptor instead.
func (*NicAddRequest) GetAllowedIp ¶
func (x *NicAddRequest) GetAllowedIp() string
func (*NicAddRequest) GetGatewayName ¶
func (x *NicAddRequest) GetGatewayName() string
func (*NicAddRequest) GetListenPort ¶
func (x *NicAddRequest) GetListenPort() int32
func (*NicAddRequest) GetPodConfig ¶
func (x *NicAddRequest) GetPodConfig() *PodInfo
func (*NicAddRequest) GetPublicKey ¶
func (x *NicAddRequest) GetPublicKey() string
func (*NicAddRequest) ProtoMessage ¶
func (*NicAddRequest) ProtoMessage()
func (*NicAddRequest) ProtoReflect ¶
func (x *NicAddRequest) ProtoReflect() protoreflect.Message
func (*NicAddRequest) Reset ¶
func (x *NicAddRequest) Reset()
func (*NicAddRequest) String ¶
func (x *NicAddRequest) String() string
type NicAddResponse ¶
type NicAddResponse struct { EndpointIp string `protobuf:"bytes,1,opt,name=endpoint_ip,json=endpointIp,proto3" json:"endpoint_ip,omitempty"` ListenPort int32 `protobuf:"varint,2,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` ExceptionCidrs []string `protobuf:"bytes,4,rep,name=exception_cidrs,json=exceptionCidrs,proto3" json:"exception_cidrs,omitempty"` DefaultRoute DefaultRoute `` /* 135-byte string literal not displayed */ // contains filtered or unexported fields }
CNIAddResponse is the response for cni add function.
func (*NicAddResponse) Descriptor
deprecated
func (*NicAddResponse) Descriptor() ([]byte, []int)
Deprecated: Use NicAddResponse.ProtoReflect.Descriptor instead.
func (*NicAddResponse) GetDefaultRoute ¶
func (x *NicAddResponse) GetDefaultRoute() DefaultRoute
func (*NicAddResponse) GetEndpointIp ¶
func (x *NicAddResponse) GetEndpointIp() string
func (*NicAddResponse) GetExceptionCidrs ¶
func (x *NicAddResponse) GetExceptionCidrs() []string
func (*NicAddResponse) GetListenPort ¶
func (x *NicAddResponse) GetListenPort() int32
func (*NicAddResponse) GetPublicKey ¶
func (x *NicAddResponse) GetPublicKey() string
func (*NicAddResponse) ProtoMessage ¶
func (*NicAddResponse) ProtoMessage()
func (*NicAddResponse) ProtoReflect ¶
func (x *NicAddResponse) ProtoReflect() protoreflect.Message
func (*NicAddResponse) Reset ¶
func (x *NicAddResponse) Reset()
func (*NicAddResponse) String ¶
func (x *NicAddResponse) String() string
type NicDelRequest ¶
type NicDelRequest struct { PodConfig *PodInfo `protobuf:"bytes,1,opt,name=pod_config,json=podConfig,proto3" json:"pod_config,omitempty"` // contains filtered or unexported fields }
CNIDeleteRequest is the request for cni del function.
func (*NicDelRequest) Descriptor
deprecated
func (*NicDelRequest) Descriptor() ([]byte, []int)
Deprecated: Use NicDelRequest.ProtoReflect.Descriptor instead.
func (*NicDelRequest) GetPodConfig ¶
func (x *NicDelRequest) GetPodConfig() *PodInfo
func (*NicDelRequest) ProtoMessage ¶
func (*NicDelRequest) ProtoMessage()
func (*NicDelRequest) ProtoReflect ¶
func (x *NicDelRequest) ProtoReflect() protoreflect.Message
func (*NicDelRequest) Reset ¶
func (x *NicDelRequest) Reset()
func (*NicDelRequest) String ¶
func (x *NicDelRequest) String() string
type NicDelResponse ¶
type NicDelResponse struct {
// contains filtered or unexported fields
}
CNIDeleteResponse is the response for cni del function.
func (*NicDelResponse) Descriptor
deprecated
func (*NicDelResponse) Descriptor() ([]byte, []int)
Deprecated: Use NicDelResponse.ProtoReflect.Descriptor instead.
func (*NicDelResponse) ProtoMessage ¶
func (*NicDelResponse) ProtoMessage()
func (*NicDelResponse) ProtoReflect ¶
func (x *NicDelResponse) ProtoReflect() protoreflect.Message
func (*NicDelResponse) Reset ¶
func (x *NicDelResponse) Reset()
func (*NicDelResponse) String ¶
func (x *NicDelResponse) String() string
type NicServiceClient ¶
type NicServiceClient interface { // NicAdd: send pod public key and return gateway public key and endpoint ip NicAdd(ctx context.Context, in *NicAddRequest, opts ...grpc.CallOption) (*NicAddResponse, error) // NicDel: delete pod endpoint resource NicDel(ctx context.Context, in *NicDelRequest, opts ...grpc.CallOption) (*NicDelResponse, error) // PodRetrieve: send pod information and return pod information PodRetrieve(ctx context.Context, in *PodRetrieveRequest, opts ...grpc.CallOption) (*PodRetrieveResponse, error) }
NicServiceClient is the client API for NicService 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.
NicService is the nic management service.
func NewNicServiceClient ¶
func NewNicServiceClient(cc grpc.ClientConnInterface) NicServiceClient
type NicServiceServer ¶
type NicServiceServer interface { // NicAdd: send pod public key and return gateway public key and endpoint ip NicAdd(context.Context, *NicAddRequest) (*NicAddResponse, error) // NicDel: delete pod endpoint resource NicDel(context.Context, *NicDelRequest) (*NicDelResponse, error) // PodRetrieve: send pod information and return pod information PodRetrieve(context.Context, *PodRetrieveRequest) (*PodRetrieveResponse, error) // contains filtered or unexported methods }
NicServiceServer is the server API for NicService service. All implementations must embed UnimplementedNicServiceServer for forward compatibility.
NicService is the nic management service.
type PodInfo ¶
type PodInfo struct { PodName string `protobuf:"bytes,1,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` PodNamespace string `protobuf:"bytes,2,opt,name=pod_namespace,json=podNamespace,proto3" json:"pod_namespace,omitempty"` // contains filtered or unexported fields }
func (*PodInfo) Descriptor
deprecated
func (*PodInfo) GetPodName ¶
func (*PodInfo) GetPodNamespace ¶
func (*PodInfo) ProtoMessage ¶
func (*PodInfo) ProtoMessage()
func (*PodInfo) ProtoReflect ¶
func (x *PodInfo) ProtoReflect() protoreflect.Message
type PodRetrieveRequest ¶
type PodRetrieveRequest struct { PodConfig *PodInfo `protobuf:"bytes,1,opt,name=pod_config,json=podConfig,proto3" json:"pod_config,omitempty"` // contains filtered or unexported fields }
PodRetrieveRequest is the request for retrieving pod function.
func (*PodRetrieveRequest) Descriptor
deprecated
func (*PodRetrieveRequest) Descriptor() ([]byte, []int)
Deprecated: Use PodRetrieveRequest.ProtoReflect.Descriptor instead.
func (*PodRetrieveRequest) GetPodConfig ¶
func (x *PodRetrieveRequest) GetPodConfig() *PodInfo
func (*PodRetrieveRequest) ProtoMessage ¶
func (*PodRetrieveRequest) ProtoMessage()
func (*PodRetrieveRequest) ProtoReflect ¶
func (x *PodRetrieveRequest) ProtoReflect() protoreflect.Message
func (*PodRetrieveRequest) Reset ¶
func (x *PodRetrieveRequest) Reset()
func (*PodRetrieveRequest) String ¶
func (x *PodRetrieveRequest) String() string
type PodRetrieveResponse ¶
type PodRetrieveResponse struct { Annotations map[string]string `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
PodRetrieveResponse is the response for retrieving pod function.
func (*PodRetrieveResponse) Descriptor
deprecated
func (*PodRetrieveResponse) Descriptor() ([]byte, []int)
Deprecated: Use PodRetrieveResponse.ProtoReflect.Descriptor instead.
func (*PodRetrieveResponse) GetAnnotations ¶
func (x *PodRetrieveResponse) GetAnnotations() map[string]string
func (*PodRetrieveResponse) ProtoMessage ¶
func (*PodRetrieveResponse) ProtoMessage()
func (*PodRetrieveResponse) ProtoReflect ¶
func (x *PodRetrieveResponse) ProtoReflect() protoreflect.Message
func (*PodRetrieveResponse) Reset ¶
func (x *PodRetrieveResponse) Reset()
func (*PodRetrieveResponse) String ¶
func (x *PodRetrieveResponse) String() string
type TestServer ¶
type TestServer struct { Received chan interface{} UnimplementedNicServiceServer // contains filtered or unexported fields }
func StartTestServer ¶
func (*TestServer) GracefulStop ¶
func (s *TestServer) GracefulStop()
func (*TestServer) NicAdd ¶
func (s *TestServer) NicAdd(ctx context.Context, in *NicAddRequest) (*NicAddResponse, error)
func (*TestServer) NicDel ¶
func (s *TestServer) NicDel(ctx context.Context, in *NicDelRequest) (*NicDelResponse, error)
func (*TestServer) PodRetrieve ¶
func (s *TestServer) PodRetrieve(ctx context.Context, in *PodRetrieveRequest) (*PodRetrieveResponse, error)
type UnimplementedNicServiceServer ¶
type UnimplementedNicServiceServer struct{}
UnimplementedNicServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedNicServiceServer) NicAdd ¶
func (UnimplementedNicServiceServer) NicAdd(context.Context, *NicAddRequest) (*NicAddResponse, error)
func (UnimplementedNicServiceServer) NicDel ¶
func (UnimplementedNicServiceServer) NicDel(context.Context, *NicDelRequest) (*NicDelResponse, error)
func (UnimplementedNicServiceServer) PodRetrieve ¶
func (UnimplementedNicServiceServer) PodRetrieve(context.Context, *PodRetrieveRequest) (*PodRetrieveResponse, error)
type UnsafeNicServiceServer ¶
type UnsafeNicServiceServer interface {
// contains filtered or unexported methods
}
UnsafeNicServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NicServiceServer will result in compilation errors.