From e8ec0718cffc35dca3f20ff93219df90ff5494a1 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 8 Dec 2020 17:59:04 +0800 Subject: [PATCH] feat(host): go generate forwarder api --- go.mod | 1 + .../guestman/forwarder/api/forwarder.pb.go | 661 ++++++++++++++++++ .../forwarder/api/forwarder_grpc.pb.go | 162 +++++ 3 files changed, 824 insertions(+) create mode 100644 pkg/hostman/guestman/forwarder/api/forwarder.pb.go create mode 100644 pkg/hostman/guestman/forwarder/api/forwarder_grpc.pb.go diff --git a/go.mod b/go.mod index f61fa48e88..ea2eae0b9c 100644 --- a/go.mod +++ b/go.mod @@ -130,6 +130,7 @@ require ( golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 google.golang.org/grpc v1.27.0 + google.golang.org/protobuf v1.24.0 gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect gopkg.in/fatih/set.v0 v0.2.1 gopkg.in/ini.v1 v1.44.0 // indirect diff --git a/pkg/hostman/guestman/forwarder/api/forwarder.pb.go b/pkg/hostman/guestman/forwarder/api/forwarder.pb.go new file mode 100644 index 0000000000..b964fbf567 --- /dev/null +++ b/pkg/hostman/guestman/forwarder/api/forwarder.pb.go @@ -0,0 +1,661 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.13.0 +// source: forwarder.proto + +package api + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type OpenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetId string `protobuf:"bytes,1,opt,name=netId,proto3" json:"netId,omitempty"` + Proto string `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` + BindAddr string `protobuf:"bytes,3,opt,name=bindAddr,proto3" json:"bindAddr,omitempty"` + BindPort uint32 `protobuf:"varint,4,opt,name=bindPort,proto3" json:"bindPort,omitempty"` + RemoteAddr string `protobuf:"bytes,5,opt,name=remoteAddr,proto3" json:"remoteAddr,omitempty"` + RemotePort uint32 `protobuf:"varint,6,opt,name=remotePort,proto3" json:"remotePort,omitempty"` +} + +func (x *OpenRequest) Reset() { + *x = OpenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_forwarder_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OpenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpenRequest) ProtoMessage() {} + +func (x *OpenRequest) ProtoReflect() protoreflect.Message { + mi := &file_forwarder_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 OpenRequest.ProtoReflect.Descriptor instead. +func (*OpenRequest) Descriptor() ([]byte, []int) { + return file_forwarder_proto_rawDescGZIP(), []int{0} +} + +func (x *OpenRequest) GetNetId() string { + if x != nil { + return x.NetId + } + return "" +} + +func (x *OpenRequest) GetProto() string { + if x != nil { + return x.Proto + } + return "" +} + +func (x *OpenRequest) GetBindAddr() string { + if x != nil { + return x.BindAddr + } + return "" +} + +func (x *OpenRequest) GetBindPort() uint32 { + if x != nil { + return x.BindPort + } + return 0 +} + +func (x *OpenRequest) GetRemoteAddr() string { + if x != nil { + return x.RemoteAddr + } + return "" +} + +func (x *OpenRequest) GetRemotePort() uint32 { + if x != nil { + return x.RemotePort + } + return 0 +} + +type OpenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetId string `protobuf:"bytes,1,opt,name=netId,proto3" json:"netId,omitempty"` + Proto string `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` + BindAddr string `protobuf:"bytes,3,opt,name=bindAddr,proto3" json:"bindAddr,omitempty"` + BindPort uint32 `protobuf:"varint,4,opt,name=bindPort,proto3" json:"bindPort,omitempty"` + RemoteAddr string `protobuf:"bytes,5,opt,name=remoteAddr,proto3" json:"remoteAddr,omitempty"` + RemotePort uint32 `protobuf:"varint,6,opt,name=remotePort,proto3" json:"remotePort,omitempty"` +} + +func (x *OpenResponse) Reset() { + *x = OpenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_forwarder_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OpenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpenResponse) ProtoMessage() {} + +func (x *OpenResponse) ProtoReflect() protoreflect.Message { + mi := &file_forwarder_proto_msgTypes[1] + 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 OpenResponse.ProtoReflect.Descriptor instead. +func (*OpenResponse) Descriptor() ([]byte, []int) { + return file_forwarder_proto_rawDescGZIP(), []int{1} +} + +func (x *OpenResponse) GetNetId() string { + if x != nil { + return x.NetId + } + return "" +} + +func (x *OpenResponse) GetProto() string { + if x != nil { + return x.Proto + } + return "" +} + +func (x *OpenResponse) GetBindAddr() string { + if x != nil { + return x.BindAddr + } + return "" +} + +func (x *OpenResponse) GetBindPort() uint32 { + if x != nil { + return x.BindPort + } + return 0 +} + +func (x *OpenResponse) GetRemoteAddr() string { + if x != nil { + return x.RemoteAddr + } + return "" +} + +func (x *OpenResponse) GetRemotePort() uint32 { + if x != nil { + return x.RemotePort + } + return 0 +} + +type CloseRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetId string `protobuf:"bytes,1,opt,name=netId,proto3" json:"netId,omitempty"` + Proto string `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` + BindAddr string `protobuf:"bytes,3,opt,name=bindAddr,proto3" json:"bindAddr,omitempty"` + BindPort uint32 `protobuf:"varint,4,opt,name=bindPort,proto3" json:"bindPort,omitempty"` +} + +func (x *CloseRequest) Reset() { + *x = CloseRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_forwarder_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloseRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseRequest) ProtoMessage() {} + +func (x *CloseRequest) ProtoReflect() protoreflect.Message { + mi := &file_forwarder_proto_msgTypes[2] + 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 CloseRequest.ProtoReflect.Descriptor instead. +func (*CloseRequest) Descriptor() ([]byte, []int) { + return file_forwarder_proto_rawDescGZIP(), []int{2} +} + +func (x *CloseRequest) GetNetId() string { + if x != nil { + return x.NetId + } + return "" +} + +func (x *CloseRequest) GetProto() string { + if x != nil { + return x.Proto + } + return "" +} + +func (x *CloseRequest) GetBindAddr() string { + if x != nil { + return x.BindAddr + } + return "" +} + +func (x *CloseRequest) GetBindPort() uint32 { + if x != nil { + return x.BindPort + } + return 0 +} + +type CloseResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetId string `protobuf:"bytes,1,opt,name=netId,proto3" json:"netId,omitempty"` + Proto string `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` + BindAddr string `protobuf:"bytes,3,opt,name=bindAddr,proto3" json:"bindAddr,omitempty"` + BindPort uint32 `protobuf:"varint,4,opt,name=bindPort,proto3" json:"bindPort,omitempty"` +} + +func (x *CloseResponse) Reset() { + *x = CloseResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_forwarder_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloseResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseResponse) ProtoMessage() {} + +func (x *CloseResponse) ProtoReflect() protoreflect.Message { + mi := &file_forwarder_proto_msgTypes[3] + 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 CloseResponse.ProtoReflect.Descriptor instead. +func (*CloseResponse) Descriptor() ([]byte, []int) { + return file_forwarder_proto_rawDescGZIP(), []int{3} +} + +func (x *CloseResponse) GetNetId() string { + if x != nil { + return x.NetId + } + return "" +} + +func (x *CloseResponse) GetProto() string { + if x != nil { + return x.Proto + } + return "" +} + +func (x *CloseResponse) GetBindAddr() string { + if x != nil { + return x.BindAddr + } + return "" +} + +func (x *CloseResponse) GetBindPort() uint32 { + if x != nil { + return x.BindPort + } + return 0 +} + +type ListByRemoteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetId string `protobuf:"bytes,1,opt,name=netId,proto3" json:"netId,omitempty"` + Proto string `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"` + RemoteAddr string `protobuf:"bytes,3,opt,name=remoteAddr,proto3" json:"remoteAddr,omitempty"` + RemotePort uint32 `protobuf:"varint,4,opt,name=remotePort,proto3" json:"remotePort,omitempty"` +} + +func (x *ListByRemoteRequest) Reset() { + *x = ListByRemoteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_forwarder_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListByRemoteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListByRemoteRequest) ProtoMessage() {} + +func (x *ListByRemoteRequest) ProtoReflect() protoreflect.Message { + mi := &file_forwarder_proto_msgTypes[4] + 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 ListByRemoteRequest.ProtoReflect.Descriptor instead. +func (*ListByRemoteRequest) Descriptor() ([]byte, []int) { + return file_forwarder_proto_rawDescGZIP(), []int{4} +} + +func (x *ListByRemoteRequest) GetNetId() string { + if x != nil { + return x.NetId + } + return "" +} + +func (x *ListByRemoteRequest) GetProto() string { + if x != nil { + return x.Proto + } + return "" +} + +func (x *ListByRemoteRequest) GetRemoteAddr() string { + if x != nil { + return x.RemoteAddr + } + return "" +} + +func (x *ListByRemoteRequest) GetRemotePort() uint32 { + if x != nil { + return x.RemotePort + } + return 0 +} + +type ListByRemoteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Forwards []*OpenResponse `protobuf:"bytes,1,rep,name=Forwards,proto3" json:"Forwards,omitempty"` +} + +func (x *ListByRemoteResponse) Reset() { + *x = ListByRemoteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_forwarder_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListByRemoteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListByRemoteResponse) ProtoMessage() {} + +func (x *ListByRemoteResponse) ProtoReflect() protoreflect.Message { + mi := &file_forwarder_proto_msgTypes[5] + 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 ListByRemoteResponse.ProtoReflect.Descriptor instead. +func (*ListByRemoteResponse) Descriptor() ([]byte, []int) { + return file_forwarder_proto_rawDescGZIP(), []int{5} +} + +func (x *ListByRemoteResponse) GetForwards() []*OpenResponse { + if x != nil { + return x.Forwards + } + return nil +} + +var File_forwarder_proto protoreflect.FileDescriptor + +var file_forwarder_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, + 0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x22, 0xb2, 0x01, 0x0a, 0x0c, 0x4f, 0x70, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x65, + 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x65, 0x74, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, + 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, + 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1e, + 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1e, + 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x72, + 0x0a, 0x0c, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, + 0x65, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, + 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x69, + 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, + 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, + 0x72, 0x74, 0x22, 0x73, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x62, + 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, + 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, + 0x42, 0x79, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x44, 0x0a, 0x14, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x79, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x32, 0xa7, 0x01, 0x0a, 0x09, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x12, + 0x29, 0x0a, 0x04, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x65, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x70, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x43, 0x6c, + 0x6f, 0x73, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x42, 0x79, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x42, 0x79, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x39, 0x5a, 0x37, 0x79, + 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x6f, 0x6e, 0x65, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x6d, 0x61, 0x6e, 0x2f, + 0x67, 0x75, 0x65, 0x73, 0x74, 0x6d, 0x61, 0x6e, 0x2f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_forwarder_proto_rawDescOnce sync.Once + file_forwarder_proto_rawDescData = file_forwarder_proto_rawDesc +) + +func file_forwarder_proto_rawDescGZIP() []byte { + file_forwarder_proto_rawDescOnce.Do(func() { + file_forwarder_proto_rawDescData = protoimpl.X.CompressGZIP(file_forwarder_proto_rawDescData) + }) + return file_forwarder_proto_rawDescData +} + +var file_forwarder_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_forwarder_proto_goTypes = []interface{}{ + (*OpenRequest)(nil), // 0: pb.OpenRequest + (*OpenResponse)(nil), // 1: pb.OpenResponse + (*CloseRequest)(nil), // 2: pb.CloseRequest + (*CloseResponse)(nil), // 3: pb.CloseResponse + (*ListByRemoteRequest)(nil), // 4: pb.ListByRemoteRequest + (*ListByRemoteResponse)(nil), // 5: pb.ListByRemoteResponse +} +var file_forwarder_proto_depIdxs = []int32{ + 1, // 0: pb.ListByRemoteResponse.Forwards:type_name -> pb.OpenResponse + 0, // 1: pb.Forwarder.Open:input_type -> pb.OpenRequest + 2, // 2: pb.Forwarder.Close:input_type -> pb.CloseRequest + 4, // 3: pb.Forwarder.ListByRemote:input_type -> pb.ListByRemoteRequest + 1, // 4: pb.Forwarder.Open:output_type -> pb.OpenResponse + 3, // 5: pb.Forwarder.Close:output_type -> pb.CloseResponse + 5, // 6: pb.Forwarder.ListByRemote:output_type -> pb.ListByRemoteResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] 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_forwarder_proto_init() } +func file_forwarder_proto_init() { + if File_forwarder_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_forwarder_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OpenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_forwarder_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OpenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_forwarder_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloseRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_forwarder_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloseResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_forwarder_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListByRemoteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_forwarder_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListByRemoteResponse); 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_forwarder_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_forwarder_proto_goTypes, + DependencyIndexes: file_forwarder_proto_depIdxs, + MessageInfos: file_forwarder_proto_msgTypes, + }.Build() + File_forwarder_proto = out.File + file_forwarder_proto_rawDesc = nil + file_forwarder_proto_goTypes = nil + file_forwarder_proto_depIdxs = nil +} diff --git a/pkg/hostman/guestman/forwarder/api/forwarder_grpc.pb.go b/pkg/hostman/guestman/forwarder/api/forwarder_grpc.pb.go new file mode 100644 index 0000000000..0e9c59f837 --- /dev/null +++ b/pkg/hostman/guestman/forwarder/api/forwarder_grpc.pb.go @@ -0,0 +1,162 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api + +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. +const _ = grpc.SupportPackageIsVersion6 + +// ForwarderClient is the client API for Forwarder 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 ForwarderClient interface { + Open(ctx context.Context, in *OpenRequest, opts ...grpc.CallOption) (*OpenResponse, error) + Close(ctx context.Context, in *CloseRequest, opts ...grpc.CallOption) (*CloseResponse, error) + ListByRemote(ctx context.Context, in *ListByRemoteRequest, opts ...grpc.CallOption) (*ListByRemoteResponse, error) +} + +type forwarderClient struct { + cc grpc.ClientConnInterface +} + +func NewForwarderClient(cc grpc.ClientConnInterface) ForwarderClient { + return &forwarderClient{cc} +} + +func (c *forwarderClient) Open(ctx context.Context, in *OpenRequest, opts ...grpc.CallOption) (*OpenResponse, error) { + out := new(OpenResponse) + err := c.cc.Invoke(ctx, "/pb.Forwarder/Open", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *forwarderClient) Close(ctx context.Context, in *CloseRequest, opts ...grpc.CallOption) (*CloseResponse, error) { + out := new(CloseResponse) + err := c.cc.Invoke(ctx, "/pb.Forwarder/Close", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *forwarderClient) ListByRemote(ctx context.Context, in *ListByRemoteRequest, opts ...grpc.CallOption) (*ListByRemoteResponse, error) { + out := new(ListByRemoteResponse) + err := c.cc.Invoke(ctx, "/pb.Forwarder/ListByRemote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ForwarderServer is the server API for Forwarder service. +// All implementations must embed UnimplementedForwarderServer +// for forward compatibility +type ForwarderServer interface { + Open(context.Context, *OpenRequest) (*OpenResponse, error) + Close(context.Context, *CloseRequest) (*CloseResponse, error) + ListByRemote(context.Context, *ListByRemoteRequest) (*ListByRemoteResponse, error) + mustEmbedUnimplementedForwarderServer() +} + +// UnimplementedForwarderServer must be embedded to have forward compatible implementations. +type UnimplementedForwarderServer struct { +} + +func (*UnimplementedForwarderServer) Open(context.Context, *OpenRequest) (*OpenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Open not implemented") +} +func (*UnimplementedForwarderServer) Close(context.Context, *CloseRequest) (*CloseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Close not implemented") +} +func (*UnimplementedForwarderServer) ListByRemote(context.Context, *ListByRemoteRequest) (*ListByRemoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListByRemote not implemented") +} +func (*UnimplementedForwarderServer) mustEmbedUnimplementedForwarderServer() {} + +func RegisterForwarderServer(s *grpc.Server, srv ForwarderServer) { + s.RegisterService(&_Forwarder_serviceDesc, srv) +} + +func _Forwarder_Open_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OpenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ForwarderServer).Open(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Forwarder/Open", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ForwarderServer).Open(ctx, req.(*OpenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Forwarder_Close_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CloseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ForwarderServer).Close(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Forwarder/Close", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ForwarderServer).Close(ctx, req.(*CloseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Forwarder_ListByRemote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListByRemoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ForwarderServer).ListByRemote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Forwarder/ListByRemote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ForwarderServer).ListByRemote(ctx, req.(*ListByRemoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Forwarder_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.Forwarder", + HandlerType: (*ForwarderServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Open", + Handler: _Forwarder_Open_Handler, + }, + { + MethodName: "Close", + Handler: _Forwarder_Close_Handler, + }, + { + MethodName: "ListByRemote", + Handler: _Forwarder_ListByRemote_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "forwarder.proto", +}