working commit

This commit is contained in:
2026-03-24 23:18:34 +02:00
parent 8efe7090be
commit 1f5b4a71f1
28 changed files with 1623 additions and 51 deletions

View File

@@ -101,6 +101,366 @@ func (x *GetHelloResult) GetMessage() string {
return ""
}
type Forwarder struct {
state protoimpl.MessageState `protogen:"open.v1"`
Lport uint32 `protobuf:"varint,1,opt,name=lport,proto3" json:"lport,omitempty"`
Dport uint32 `protobuf:"varint,2,opt,name=dport,proto3" json:"dport,omitempty"`
Destinations []*Destination `protobuf:"bytes,3,rep,name=destinations,proto3" json:"destinations,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Forwarder) Reset() {
*x = Forwarder{}
mi := &file_mlbctl_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Forwarder) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Forwarder) ProtoMessage() {}
func (x *Forwarder) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Forwarder.ProtoReflect.Descriptor instead.
func (*Forwarder) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{2}
}
func (x *Forwarder) GetLport() uint32 {
if x != nil {
return x.Lport
}
return 0
}
func (x *Forwarder) GetDport() uint32 {
if x != nil {
return x.Dport
}
return 0
}
func (x *Forwarder) GetDestinations() []*Destination {
if x != nil {
return x.Destinations
}
return nil
}
type Destination struct {
state protoimpl.MessageState `protogen:"open.v1"`
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Destination) Reset() {
*x = Destination{}
mi := &file_mlbctl_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Destination) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Destination) ProtoMessage() {}
func (x *Destination) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Destination.ProtoReflect.Descriptor instead.
func (*Destination) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{3}
}
func (x *Destination) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
type ListForwardersParams struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListForwardersParams) Reset() {
*x = ListForwardersParams{}
mi := &file_mlbctl_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListForwardersParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListForwardersParams) ProtoMessage() {}
func (x *ListForwardersParams) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListForwardersParams.ProtoReflect.Descriptor instead.
func (*ListForwardersParams) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{4}
}
type ListForwardersResult struct {
state protoimpl.MessageState `protogen:"open.v1"`
Forwarders []*Forwarder `protobuf:"bytes,1,rep,name=forwarders,proto3" json:"forwarders,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListForwardersResult) Reset() {
*x = ListForwardersResult{}
mi := &file_mlbctl_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListForwardersResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListForwardersResult) ProtoMessage() {}
func (x *ListForwardersResult) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListForwardersResult.ProtoReflect.Descriptor instead.
func (*ListForwardersResult) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{5}
}
func (x *ListForwardersResult) GetForwarders() []*Forwarder {
if x != nil {
return x.Forwarders
}
return nil
}
type CreateForwarderParams struct {
state protoimpl.MessageState `protogen:"open.v1"`
Lport uint32 `protobuf:"varint,1,opt,name=lport,proto3" json:"lport,omitempty"`
Dport uint32 `protobuf:"varint,2,opt,name=dport,proto3" json:"dport,omitempty"`
Destinations []string `protobuf:"bytes,3,rep,name=destinations,proto3" json:"destinations,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateForwarderParams) Reset() {
*x = CreateForwarderParams{}
mi := &file_mlbctl_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateForwarderParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateForwarderParams) ProtoMessage() {}
func (x *CreateForwarderParams) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateForwarderParams.ProtoReflect.Descriptor instead.
func (*CreateForwarderParams) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{6}
}
func (x *CreateForwarderParams) GetLport() uint32 {
if x != nil {
return x.Lport
}
return 0
}
func (x *CreateForwarderParams) GetDport() uint32 {
if x != nil {
return x.Dport
}
return 0
}
func (x *CreateForwarderParams) GetDestinations() []string {
if x != nil {
return x.Destinations
}
return nil
}
type CreateForwarderResult struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateForwarderResult) Reset() {
*x = CreateForwarderResult{}
mi := &file_mlbctl_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateForwarderResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateForwarderResult) ProtoMessage() {}
func (x *CreateForwarderResult) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateForwarderResult.ProtoReflect.Descriptor instead.
func (*CreateForwarderResult) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{7}
}
type DeleteForwarderParams struct {
state protoimpl.MessageState `protogen:"open.v1"`
Lport uint32 `protobuf:"varint,1,opt,name=lport,proto3" json:"lport,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteForwarderParams) Reset() {
*x = DeleteForwarderParams{}
mi := &file_mlbctl_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteForwarderParams) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteForwarderParams) ProtoMessage() {}
func (x *DeleteForwarderParams) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteForwarderParams.ProtoReflect.Descriptor instead.
func (*DeleteForwarderParams) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{8}
}
func (x *DeleteForwarderParams) GetLport() uint32 {
if x != nil {
return x.Lport
}
return 0
}
type DeleteForwarderResult struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteForwarderResult) Reset() {
*x = DeleteForwarderResult{}
mi := &file_mlbctl_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteForwarderResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteForwarderResult) ProtoMessage() {}
func (x *DeleteForwarderResult) ProtoReflect() protoreflect.Message {
mi := &file_mlbctl_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteForwarderResult.ProtoReflect.Descriptor instead.
func (*DeleteForwarderResult) Descriptor() ([]byte, []int) {
return file_mlbctl_proto_rawDescGZIP(), []int{9}
}
var File_mlbctl_proto protoreflect.FileDescriptor
var file_mlbctl_proto_rawDesc = string([]byte{
@@ -109,13 +469,56 @@ var file_mlbctl_proto_rawDesc = string([]byte{
0x6c, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x2a, 0x0a, 0x0e, 0x67, 0x65, 0x74, 0x48,
0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x32, 0x47, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12,
0x3c, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x16, 0x2e, 0x6d, 0x6c,
0x62, 0x63, 0x74, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x73, 0x1a, 0x16, 0x2e, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x67, 0x65, 0x74,
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42, 0x0a, 0x5a,
0x08, 0x2e, 0x3b, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x73, 0x61, 0x67, 0x65, 0x22, 0x70, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65,
0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x05, 0x6c, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x70, 0x6f, 0x72, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x64, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x37, 0x0a,
0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x64, 0x65, 0x73,
0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x27, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22,
0x16, 0x0a, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72,
0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x49, 0x0a, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x46,
0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
0x31, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x66, 0x6f, 0x72,
0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65,
0x72, 0x73, 0x22, 0x67, 0x0a, 0x15, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x77,
0x61, 0x72, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c,
0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x70, 0x6f, 0x72,
0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x05, 0x64, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69,
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64,
0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x63,
0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x22, 0x2d, 0x0a, 0x15, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x6f,
0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x0a,
0x05, 0x6c, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x70,
0x6f, 0x72, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x6f, 0x72,
0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x32, 0xbd, 0x02, 0x0a,
0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x3c, 0x0a, 0x08, 0x67, 0x65, 0x74, 0x48,
0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x16, 0x2e, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x67, 0x65,
0x74, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x16, 0x2e, 0x6d,
0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x6d, 0x6c, 0x62, 0x63,
0x74, 0x6c, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64,
0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1d, 0x2e, 0x6d, 0x6c, 0x62, 0x63, 0x74,
0x6c, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65,
0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0e, 0x6c, 0x69, 0x73,
0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x6c,
0x62, 0x63, 0x74, 0x6c, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64,
0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1c, 0x2e, 0x6d, 0x6c, 0x62, 0x63,
0x74, 0x6c, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72,
0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0f, 0x64, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x6d,
0x6c, 0x62, 0x63, 0x74, 0x6c, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x77,
0x61, 0x72, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1d, 0x2e, 0x6d, 0x6c,
0x62, 0x63, 0x74, 0x6c, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x77, 0x61,
0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08,
0x2e, 0x3b, 0x6d, 0x6c, 0x62, 0x63, 0x74, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var (
@@ -130,19 +533,35 @@ func file_mlbctl_proto_rawDescGZIP() []byte {
return file_mlbctl_proto_rawDescData
}
var file_mlbctl_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_mlbctl_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_mlbctl_proto_goTypes = []any{
(*GetHelloParams)(nil), // 0: mlbctl.getHelloParams
(*GetHelloResult)(nil), // 1: mlbctl.getHelloResult
(*GetHelloParams)(nil), // 0: mlbctl.getHelloParams
(*GetHelloResult)(nil), // 1: mlbctl.getHelloResult
(*Forwarder)(nil), // 2: mlbctl.forwarder
(*Destination)(nil), // 3: mlbctl.destination
(*ListForwardersParams)(nil), // 4: mlbctl.listForwardersParams
(*ListForwardersResult)(nil), // 5: mlbctl.listForwardersResult
(*CreateForwarderParams)(nil), // 6: mlbctl.createForwarderParams
(*CreateForwarderResult)(nil), // 7: mlbctl.createForwarderResult
(*DeleteForwarderParams)(nil), // 8: mlbctl.deleteForwarderParams
(*DeleteForwarderResult)(nil), // 9: mlbctl.deleteForwarderResult
}
var file_mlbctl_proto_depIdxs = []int32{
0, // 0: mlbctl.Control.getHello:input_type -> mlbctl.getHelloParams
1, // 1: mlbctl.Control.getHello:output_type -> mlbctl.getHelloResult
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
3, // 0: mlbctl.forwarder.destinations:type_name -> mlbctl.destination
2, // 1: mlbctl.listForwardersResult.forwarders:type_name -> mlbctl.forwarder
0, // 2: mlbctl.Control.getHello:input_type -> mlbctl.getHelloParams
6, // 3: mlbctl.Control.createForwarder:input_type -> mlbctl.createForwarderParams
4, // 4: mlbctl.Control.listForwarders:input_type -> mlbctl.listForwardersParams
8, // 5: mlbctl.Control.deleteForwarder:input_type -> mlbctl.deleteForwarderParams
1, // 6: mlbctl.Control.getHello:output_type -> mlbctl.getHelloResult
7, // 7: mlbctl.Control.createForwarder:output_type -> mlbctl.createForwarderResult
5, // 8: mlbctl.Control.listForwarders:output_type -> mlbctl.listForwardersResult
9, // 9: mlbctl.Control.deleteForwarder:output_type -> mlbctl.deleteForwarderResult
6, // [6:10] is the sub-list for method output_type
2, // [2:6] 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_mlbctl_proto_init() }
@@ -156,7 +575,7 @@ func file_mlbctl_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_mlbctl_proto_rawDesc), len(file_mlbctl_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
},

View File

@@ -19,7 +19,10 @@ import (
const _ = grpc.SupportPackageIsVersion8
const (
Control_GetHello_FullMethodName = "/mlbctl.Control/getHello"
Control_GetHello_FullMethodName = "/mlbctl.Control/getHello"
Control_CreateForwarder_FullMethodName = "/mlbctl.Control/createForwarder"
Control_ListForwarders_FullMethodName = "/mlbctl.Control/listForwarders"
Control_DeleteForwarder_FullMethodName = "/mlbctl.Control/deleteForwarder"
)
// ControlClient is the client API for Control service.
@@ -27,6 +30,9 @@ const (
// 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 ControlClient interface {
GetHello(ctx context.Context, in *GetHelloParams, opts ...grpc.CallOption) (*GetHelloResult, error)
CreateForwarder(ctx context.Context, in *CreateForwarderParams, opts ...grpc.CallOption) (*CreateForwarderResult, error)
ListForwarders(ctx context.Context, in *ListForwardersParams, opts ...grpc.CallOption) (*ListForwardersResult, error)
DeleteForwarder(ctx context.Context, in *DeleteForwarderParams, opts ...grpc.CallOption) (*DeleteForwarderResult, error)
}
type controlClient struct {
@@ -47,11 +53,44 @@ func (c *controlClient) GetHello(ctx context.Context, in *GetHelloParams, opts .
return out, nil
}
func (c *controlClient) CreateForwarder(ctx context.Context, in *CreateForwarderParams, opts ...grpc.CallOption) (*CreateForwarderResult, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateForwarderResult)
err := c.cc.Invoke(ctx, Control_CreateForwarder_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *controlClient) ListForwarders(ctx context.Context, in *ListForwardersParams, opts ...grpc.CallOption) (*ListForwardersResult, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListForwardersResult)
err := c.cc.Invoke(ctx, Control_ListForwarders_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *controlClient) DeleteForwarder(ctx context.Context, in *DeleteForwarderParams, opts ...grpc.CallOption) (*DeleteForwarderResult, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteForwarderResult)
err := c.cc.Invoke(ctx, Control_DeleteForwarder_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ControlServer is the server API for Control service.
// All implementations must embed UnimplementedControlServer
// for forward compatibility
type ControlServer interface {
GetHello(context.Context, *GetHelloParams) (*GetHelloResult, error)
CreateForwarder(context.Context, *CreateForwarderParams) (*CreateForwarderResult, error)
ListForwarders(context.Context, *ListForwardersParams) (*ListForwardersResult, error)
DeleteForwarder(context.Context, *DeleteForwarderParams) (*DeleteForwarderResult, error)
mustEmbedUnimplementedControlServer()
}
@@ -62,6 +101,15 @@ type UnimplementedControlServer struct {
func (UnimplementedControlServer) GetHello(context.Context, *GetHelloParams) (*GetHelloResult, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetHello not implemented")
}
func (UnimplementedControlServer) CreateForwarder(context.Context, *CreateForwarderParams) (*CreateForwarderResult, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateForwarder not implemented")
}
func (UnimplementedControlServer) ListForwarders(context.Context, *ListForwardersParams) (*ListForwardersResult, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListForwarders not implemented")
}
func (UnimplementedControlServer) DeleteForwarder(context.Context, *DeleteForwarderParams) (*DeleteForwarderResult, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteForwarder not implemented")
}
func (UnimplementedControlServer) mustEmbedUnimplementedControlServer() {}
// UnsafeControlServer may be embedded to opt out of forward compatibility for this service.
@@ -93,6 +141,60 @@ func _Control_GetHello_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
func _Control_CreateForwarder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateForwarderParams)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ControlServer).CreateForwarder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Control_CreateForwarder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ControlServer).CreateForwarder(ctx, req.(*CreateForwarderParams))
}
return interceptor(ctx, in, info, handler)
}
func _Control_ListForwarders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListForwardersParams)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ControlServer).ListForwarders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Control_ListForwarders_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ControlServer).ListForwarders(ctx, req.(*ListForwardersParams))
}
return interceptor(ctx, in, info, handler)
}
func _Control_DeleteForwarder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteForwarderParams)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ControlServer).DeleteForwarder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Control_DeleteForwarder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ControlServer).DeleteForwarder(ctx, req.(*DeleteForwarderParams))
}
return interceptor(ctx, in, info, handler)
}
// Control_ServiceDesc is the grpc.ServiceDesc for Control service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -104,6 +206,18 @@ var Control_ServiceDesc = grpc.ServiceDesc{
MethodName: "getHello",
Handler: _Control_GetHello_Handler,
},
{
MethodName: "createForwarder",
Handler: _Control_CreateForwarder_Handler,
},
{
MethodName: "listForwarders",
Handler: _Control_ListForwarders_Handler,
},
{
MethodName: "deleteForwarder",
Handler: _Control_DeleteForwarder_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "mlbctl.proto",