Initial commit

This commit is contained in:
elisaveta9
2025-12-23 16:38:32 +03:00
commit b8f8e5607c
54 changed files with 2525 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
syntax = "proto3";
package control;
option go_package = "relay/proto/control;controlpb";
option java_package = "com.projects.httpsserverapp.control.v1";
option java_multiple_files = true;
service ControlService {
// Регистрация устройства и доменов
rpc RegisterDevice(RegisterRequest)
returns (RegisterResponse);
// Получить список доменов
rpc ListDomains(ListDomainsRequest)
returns (ListDomainsResponse);
// Отвязать домен
rpc UnregisterDomain(UnregisterDomainRequest)
returns (UnregisterDomainResponse);
}
message RegisterRequest {
string device_id = 1;
repeated string domains = 2;
}
message RegisterResponse {
bool success = 1;
string message = 2;
}
message ListDomainsRequest {}
message ListDomainsResponse {
repeated string domains = 1;
}
message UnregisterDomainRequest {
string domain = 1;
}
message UnregisterDomainResponse {
bool success = 1;
}
+492
View File
@@ -0,0 +1,492 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v6.33.1
// source: control.proto
package controlpb
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 RegisterRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
Domains []string `protobuf:"bytes,2,rep,name=domains,proto3" json:"domains,omitempty"`
}
func (x *RegisterRequest) Reset() {
*x = RegisterRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_control_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegisterRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegisterRequest) ProtoMessage() {}
func (x *RegisterRequest) ProtoReflect() protoreflect.Message {
mi := &file_control_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 RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) Descriptor() ([]byte, []int) {
return file_control_proto_rawDescGZIP(), []int{0}
}
func (x *RegisterRequest) GetDeviceId() string {
if x != nil {
return x.DeviceId
}
return ""
}
func (x *RegisterRequest) GetDomains() []string {
if x != nil {
return x.Domains
}
return nil
}
type RegisterResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}
func (x *RegisterResponse) Reset() {
*x = RegisterResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_control_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegisterResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegisterResponse) ProtoMessage() {}
func (x *RegisterResponse) ProtoReflect() protoreflect.Message {
mi := &file_control_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 RegisterResponse.ProtoReflect.Descriptor instead.
func (*RegisterResponse) Descriptor() ([]byte, []int) {
return file_control_proto_rawDescGZIP(), []int{1}
}
func (x *RegisterResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *RegisterResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
type ListDomainsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ListDomainsRequest) Reset() {
*x = ListDomainsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_control_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListDomainsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListDomainsRequest) ProtoMessage() {}
func (x *ListDomainsRequest) ProtoReflect() protoreflect.Message {
mi := &file_control_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 ListDomainsRequest.ProtoReflect.Descriptor instead.
func (*ListDomainsRequest) Descriptor() ([]byte, []int) {
return file_control_proto_rawDescGZIP(), []int{2}
}
type ListDomainsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Domains []string `protobuf:"bytes,1,rep,name=domains,proto3" json:"domains,omitempty"`
}
func (x *ListDomainsResponse) Reset() {
*x = ListDomainsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_control_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListDomainsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListDomainsResponse) ProtoMessage() {}
func (x *ListDomainsResponse) ProtoReflect() protoreflect.Message {
mi := &file_control_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 ListDomainsResponse.ProtoReflect.Descriptor instead.
func (*ListDomainsResponse) Descriptor() ([]byte, []int) {
return file_control_proto_rawDescGZIP(), []int{3}
}
func (x *ListDomainsResponse) GetDomains() []string {
if x != nil {
return x.Domains
}
return nil
}
type UnregisterDomainRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
}
func (x *UnregisterDomainRequest) Reset() {
*x = UnregisterDomainRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_control_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UnregisterDomainRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnregisterDomainRequest) ProtoMessage() {}
func (x *UnregisterDomainRequest) ProtoReflect() protoreflect.Message {
mi := &file_control_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 UnregisterDomainRequest.ProtoReflect.Descriptor instead.
func (*UnregisterDomainRequest) Descriptor() ([]byte, []int) {
return file_control_proto_rawDescGZIP(), []int{4}
}
func (x *UnregisterDomainRequest) GetDomain() string {
if x != nil {
return x.Domain
}
return ""
}
type UnregisterDomainResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
}
func (x *UnregisterDomainResponse) Reset() {
*x = UnregisterDomainResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_control_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UnregisterDomainResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UnregisterDomainResponse) ProtoMessage() {}
func (x *UnregisterDomainResponse) ProtoReflect() protoreflect.Message {
mi := &file_control_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 UnregisterDomainResponse.ProtoReflect.Descriptor instead.
func (*UnregisterDomainResponse) Descriptor() ([]byte, []int) {
return file_control_proto_rawDescGZIP(), []int{5}
}
func (x *UnregisterDomainResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
var File_control_proto protoreflect.FileDescriptor
var file_control_proto_rawDesc = []byte{
0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x48, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64,
0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x73, 0x22, 0x46, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69,
0x73, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x22, 0x2f, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
0x73, 0x22, 0x31, 0x0a, 0x17, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44,
0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06,
0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f,
0x6d, 0x61, 0x69, 0x6e, 0x22, 0x34, 0x0a, 0x18, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74,
0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xfa, 0x01, 0x0a, 0x0e, 0x43,
0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a,
0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12,
0x18, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
0x72, 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4c, 0x69,
0x73, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x1c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44,
0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57,
0x0a, 0x10, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x55, 0x6e, 0x72,
0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x55,
0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x49, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x70,
0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x61, 0x70, 0x70, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x76,
0x31, 0x50, 0x01, 0x5a, 0x1d, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_control_proto_rawDescOnce sync.Once
file_control_proto_rawDescData = file_control_proto_rawDesc
)
func file_control_proto_rawDescGZIP() []byte {
file_control_proto_rawDescOnce.Do(func() {
file_control_proto_rawDescData = protoimpl.X.CompressGZIP(file_control_proto_rawDescData)
})
return file_control_proto_rawDescData
}
var file_control_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_control_proto_goTypes = []interface{}{
(*RegisterRequest)(nil), // 0: control.RegisterRequest
(*RegisterResponse)(nil), // 1: control.RegisterResponse
(*ListDomainsRequest)(nil), // 2: control.ListDomainsRequest
(*ListDomainsResponse)(nil), // 3: control.ListDomainsResponse
(*UnregisterDomainRequest)(nil), // 4: control.UnregisterDomainRequest
(*UnregisterDomainResponse)(nil), // 5: control.UnregisterDomainResponse
}
var file_control_proto_depIdxs = []int32{
0, // 0: control.ControlService.RegisterDevice:input_type -> control.RegisterRequest
2, // 1: control.ControlService.ListDomains:input_type -> control.ListDomainsRequest
4, // 2: control.ControlService.UnregisterDomain:input_type -> control.UnregisterDomainRequest
1, // 3: control.ControlService.RegisterDevice:output_type -> control.RegisterResponse
3, // 4: control.ControlService.ListDomains:output_type -> control.ListDomainsResponse
5, // 5: control.ControlService.UnregisterDomain:output_type -> control.UnregisterDomainResponse
3, // [3:6] is the sub-list for method output_type
0, // [0:3] 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_control_proto_init() }
func file_control_proto_init() {
if File_control_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_control_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_control_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_control_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListDomainsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_control_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListDomainsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_control_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UnregisterDomainRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_control_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UnregisterDomainResponse); 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_control_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_control_proto_goTypes,
DependencyIndexes: file_control_proto_depIdxs,
MessageInfos: file_control_proto_msgTypes,
}.Build()
File_control_proto = out.File
file_control_proto_rawDesc = nil
file_control_proto_goTypes = nil
file_control_proto_depIdxs = nil
}
+189
View File
@@ -0,0 +1,189 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v6.33.1
// source: control.proto
package controlpb
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
const (
ControlService_RegisterDevice_FullMethodName = "/control.ControlService/RegisterDevice"
ControlService_ListDomains_FullMethodName = "/control.ControlService/ListDomains"
ControlService_UnregisterDomain_FullMethodName = "/control.ControlService/UnregisterDomain"
)
// ControlServiceClient is the client API for ControlService 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 ControlServiceClient interface {
// Регистрация устройства и доменов
RegisterDevice(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
// Получить список доменов
ListDomains(ctx context.Context, in *ListDomainsRequest, opts ...grpc.CallOption) (*ListDomainsResponse, error)
// Отвязать домен
UnregisterDomain(ctx context.Context, in *UnregisterDomainRequest, opts ...grpc.CallOption) (*UnregisterDomainResponse, error)
}
type controlServiceClient struct {
cc grpc.ClientConnInterface
}
func NewControlServiceClient(cc grpc.ClientConnInterface) ControlServiceClient {
return &controlServiceClient{cc}
}
func (c *controlServiceClient) RegisterDevice(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
out := new(RegisterResponse)
err := c.cc.Invoke(ctx, ControlService_RegisterDevice_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *controlServiceClient) ListDomains(ctx context.Context, in *ListDomainsRequest, opts ...grpc.CallOption) (*ListDomainsResponse, error) {
out := new(ListDomainsResponse)
err := c.cc.Invoke(ctx, ControlService_ListDomains_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *controlServiceClient) UnregisterDomain(ctx context.Context, in *UnregisterDomainRequest, opts ...grpc.CallOption) (*UnregisterDomainResponse, error) {
out := new(UnregisterDomainResponse)
err := c.cc.Invoke(ctx, ControlService_UnregisterDomain_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ControlServiceServer is the server API for ControlService service.
// All implementations must embed UnimplementedControlServiceServer
// for forward compatibility
type ControlServiceServer interface {
// Регистрация устройства и доменов
RegisterDevice(context.Context, *RegisterRequest) (*RegisterResponse, error)
// Получить список доменов
ListDomains(context.Context, *ListDomainsRequest) (*ListDomainsResponse, error)
// Отвязать домен
UnregisterDomain(context.Context, *UnregisterDomainRequest) (*UnregisterDomainResponse, error)
mustEmbedUnimplementedControlServiceServer()
}
// UnimplementedControlServiceServer must be embedded to have forward compatible implementations.
type UnimplementedControlServiceServer struct {
}
func (UnimplementedControlServiceServer) RegisterDevice(context.Context, *RegisterRequest) (*RegisterResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterDevice not implemented")
}
func (UnimplementedControlServiceServer) ListDomains(context.Context, *ListDomainsRequest) (*ListDomainsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListDomains not implemented")
}
func (UnimplementedControlServiceServer) UnregisterDomain(context.Context, *UnregisterDomainRequest) (*UnregisterDomainResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnregisterDomain not implemented")
}
func (UnimplementedControlServiceServer) mustEmbedUnimplementedControlServiceServer() {}
// UnsafeControlServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ControlServiceServer will
// result in compilation errors.
type UnsafeControlServiceServer interface {
mustEmbedUnimplementedControlServiceServer()
}
func RegisterControlServiceServer(s grpc.ServiceRegistrar, srv ControlServiceServer) {
s.RegisterService(&ControlService_ServiceDesc, srv)
}
func _ControlService_RegisterDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ControlServiceServer).RegisterDevice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ControlService_RegisterDevice_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ControlServiceServer).RegisterDevice(ctx, req.(*RegisterRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ControlService_ListDomains_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListDomainsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ControlServiceServer).ListDomains(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ControlService_ListDomains_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ControlServiceServer).ListDomains(ctx, req.(*ListDomainsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ControlService_UnregisterDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnregisterDomainRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ControlServiceServer).UnregisterDomain(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ControlService_UnregisterDomain_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ControlServiceServer).UnregisterDomain(ctx, req.(*UnregisterDomainRequest))
}
return interceptor(ctx, in, info, handler)
}
// ControlService_ServiceDesc is the grpc.ServiceDesc for ControlService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ControlService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "control.ControlService",
HandlerType: (*ControlServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RegisterDevice",
Handler: _ControlService_RegisterDevice_Handler,
},
{
MethodName: "ListDomains",
Handler: _ControlService_ListDomains_Handler,
},
{
MethodName: "UnregisterDomain",
Handler: _ControlService_UnregisterDomain_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "control.proto",
}
+32
View File
@@ -0,0 +1,32 @@
syntax = "proto3";
package tunnel;
option go_package = "relay/proto/tunnel;tunnelpb";
option java_package = "com.projects.httpsserverapp.tunnel.v1";
option java_multiple_files = true;
service TunnelService {
rpc Tunnel(stream Frame) returns (stream Frame);
}
enum FrameType {
FRAME_UNSPECIFIED = 0;
FRAME_OPEN = 1; // открыть TCP stream
FRAME_DATA = 2;
FRAME_CLOSE = 3;
FRAME_PING = 4;
FRAME_PONG = 5;
FRAME_BIND_REQUEST = 10; // device → relay
FRAME_BIND_OK = 11; // relay → device
FRAME_BIND_REJECTED = 12; // relay → device
}
message Frame {
FrameType type = 1;
uint32 stream_id = 2;
bytes payload = 3;
}
+254
View File
@@ -0,0 +1,254 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v6.33.1
// source: tunnel.proto
package tunnelpb
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 FrameType int32
const (
FrameType_FRAME_UNSPECIFIED FrameType = 0
FrameType_FRAME_OPEN FrameType = 1 // открыть TCP stream
FrameType_FRAME_DATA FrameType = 2
FrameType_FRAME_CLOSE FrameType = 3
FrameType_FRAME_PING FrameType = 4
FrameType_FRAME_PONG FrameType = 5
FrameType_FRAME_BIND_REQUEST FrameType = 10 // device → relay
FrameType_FRAME_BIND_OK FrameType = 11 // relay → device
FrameType_FRAME_BIND_REJECTED FrameType = 12 // relay → device
)
// Enum value maps for FrameType.
var (
FrameType_name = map[int32]string{
0: "FRAME_UNSPECIFIED",
1: "FRAME_OPEN",
2: "FRAME_DATA",
3: "FRAME_CLOSE",
4: "FRAME_PING",
5: "FRAME_PONG",
10: "FRAME_BIND_REQUEST",
11: "FRAME_BIND_OK",
12: "FRAME_BIND_REJECTED",
}
FrameType_value = map[string]int32{
"FRAME_UNSPECIFIED": 0,
"FRAME_OPEN": 1,
"FRAME_DATA": 2,
"FRAME_CLOSE": 3,
"FRAME_PING": 4,
"FRAME_PONG": 5,
"FRAME_BIND_REQUEST": 10,
"FRAME_BIND_OK": 11,
"FRAME_BIND_REJECTED": 12,
}
)
func (x FrameType) Enum() *FrameType {
p := new(FrameType)
*p = x
return p
}
func (x FrameType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (FrameType) Descriptor() protoreflect.EnumDescriptor {
return file_tunnel_proto_enumTypes[0].Descriptor()
}
func (FrameType) Type() protoreflect.EnumType {
return &file_tunnel_proto_enumTypes[0]
}
func (x FrameType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use FrameType.Descriptor instead.
func (FrameType) EnumDescriptor() ([]byte, []int) {
return file_tunnel_proto_rawDescGZIP(), []int{0}
}
type Frame struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type FrameType `protobuf:"varint,1,opt,name=type,proto3,enum=tunnel.FrameType" json:"type,omitempty"`
StreamId uint32 `protobuf:"varint,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (x *Frame) Reset() {
*x = Frame{}
if protoimpl.UnsafeEnabled {
mi := &file_tunnel_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Frame) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Frame) ProtoMessage() {}
func (x *Frame) ProtoReflect() protoreflect.Message {
mi := &file_tunnel_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 Frame.ProtoReflect.Descriptor instead.
func (*Frame) Descriptor() ([]byte, []int) {
return file_tunnel_proto_rawDescGZIP(), []int{0}
}
func (x *Frame) GetType() FrameType {
if x != nil {
return x.Type
}
return FrameType_FRAME_UNSPECIFIED
}
func (x *Frame) GetStreamId() uint32 {
if x != nil {
return x.StreamId
}
return 0
}
func (x *Frame) GetPayload() []byte {
if x != nil {
return x.Payload
}
return nil
}
var File_tunnel_proto protoreflect.FileDescriptor
var file_tunnel_proto_rawDesc = []byte{
0x0a, 0x0c, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x65, 0x0a, 0x05, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12,
0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e,
0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65,
0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0xb7, 0x01,
0x0a, 0x09, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x46,
0x52, 0x41, 0x4d, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x4f, 0x50, 0x45, 0x4e,
0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41,
0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x43, 0x4c, 0x4f, 0x53,
0x45, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x50, 0x49, 0x4e,
0x47, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x50, 0x4f, 0x4e,
0x47, 0x10, 0x05, 0x12, 0x16, 0x0a, 0x12, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x42, 0x49, 0x4e,
0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0d, 0x46,
0x52, 0x41, 0x4d, 0x45, 0x5f, 0x42, 0x49, 0x4e, 0x44, 0x5f, 0x4f, 0x4b, 0x10, 0x0b, 0x12, 0x17,
0x0a, 0x13, 0x46, 0x52, 0x41, 0x4d, 0x45, 0x5f, 0x42, 0x49, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x4a,
0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x0c, 0x32, 0x3b, 0x0a, 0x0d, 0x54, 0x75, 0x6e, 0x6e, 0x65,
0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x54, 0x75, 0x6e, 0x6e,
0x65, 0x6c, 0x12, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x46, 0x72, 0x61, 0x6d,
0x65, 0x1a, 0x0d, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65,
0x28, 0x01, 0x30, 0x01, 0x42, 0x46, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x61, 0x70, 0x70, 0x2e, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x50, 0x01, 0x5a,
0x1b, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x75, 0x6e,
0x6e, 0x65, 0x6c, 0x3b, 0x74, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_tunnel_proto_rawDescOnce sync.Once
file_tunnel_proto_rawDescData = file_tunnel_proto_rawDesc
)
func file_tunnel_proto_rawDescGZIP() []byte {
file_tunnel_proto_rawDescOnce.Do(func() {
file_tunnel_proto_rawDescData = protoimpl.X.CompressGZIP(file_tunnel_proto_rawDescData)
})
return file_tunnel_proto_rawDescData
}
var file_tunnel_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_tunnel_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_tunnel_proto_goTypes = []interface{}{
(FrameType)(0), // 0: tunnel.FrameType
(*Frame)(nil), // 1: tunnel.Frame
}
var file_tunnel_proto_depIdxs = []int32{
0, // 0: tunnel.Frame.type:type_name -> tunnel.FrameType
1, // 1: tunnel.TunnelService.Tunnel:input_type -> tunnel.Frame
1, // 2: tunnel.TunnelService.Tunnel:output_type -> tunnel.Frame
2, // [2:3] is the sub-list for method output_type
1, // [1:2] 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_tunnel_proto_init() }
func file_tunnel_proto_init() {
if File_tunnel_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_tunnel_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Frame); 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_tunnel_proto_rawDesc,
NumEnums: 1,
NumMessages: 1,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_tunnel_proto_goTypes,
DependencyIndexes: file_tunnel_proto_depIdxs,
EnumInfos: file_tunnel_proto_enumTypes,
MessageInfos: file_tunnel_proto_msgTypes,
}.Build()
File_tunnel_proto = out.File
file_tunnel_proto_rawDesc = nil
file_tunnel_proto_goTypes = nil
file_tunnel_proto_depIdxs = nil
}
+141
View File
@@ -0,0 +1,141 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v6.33.1
// source: tunnel.proto
package tunnelpb
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
const (
TunnelService_Tunnel_FullMethodName = "/tunnel.TunnelService/Tunnel"
)
// TunnelServiceClient is the client API for TunnelService 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 TunnelServiceClient interface {
Tunnel(ctx context.Context, opts ...grpc.CallOption) (TunnelService_TunnelClient, error)
}
type tunnelServiceClient struct {
cc grpc.ClientConnInterface
}
func NewTunnelServiceClient(cc grpc.ClientConnInterface) TunnelServiceClient {
return &tunnelServiceClient{cc}
}
func (c *tunnelServiceClient) Tunnel(ctx context.Context, opts ...grpc.CallOption) (TunnelService_TunnelClient, error) {
stream, err := c.cc.NewStream(ctx, &TunnelService_ServiceDesc.Streams[0], TunnelService_Tunnel_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &tunnelServiceTunnelClient{stream}
return x, nil
}
type TunnelService_TunnelClient interface {
Send(*Frame) error
Recv() (*Frame, error)
grpc.ClientStream
}
type tunnelServiceTunnelClient struct {
grpc.ClientStream
}
func (x *tunnelServiceTunnelClient) Send(m *Frame) error {
return x.ClientStream.SendMsg(m)
}
func (x *tunnelServiceTunnelClient) Recv() (*Frame, error) {
m := new(Frame)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// TunnelServiceServer is the server API for TunnelService service.
// All implementations must embed UnimplementedTunnelServiceServer
// for forward compatibility
type TunnelServiceServer interface {
Tunnel(TunnelService_TunnelServer) error
mustEmbedUnimplementedTunnelServiceServer()
}
// UnimplementedTunnelServiceServer must be embedded to have forward compatible implementations.
type UnimplementedTunnelServiceServer struct {
}
func (UnimplementedTunnelServiceServer) Tunnel(TunnelService_TunnelServer) error {
return status.Errorf(codes.Unimplemented, "method Tunnel not implemented")
}
func (UnimplementedTunnelServiceServer) mustEmbedUnimplementedTunnelServiceServer() {}
// UnsafeTunnelServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TunnelServiceServer will
// result in compilation errors.
type UnsafeTunnelServiceServer interface {
mustEmbedUnimplementedTunnelServiceServer()
}
func RegisterTunnelServiceServer(s grpc.ServiceRegistrar, srv TunnelServiceServer) {
s.RegisterService(&TunnelService_ServiceDesc, srv)
}
func _TunnelService_Tunnel_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(TunnelServiceServer).Tunnel(&tunnelServiceTunnelServer{stream})
}
type TunnelService_TunnelServer interface {
Send(*Frame) error
Recv() (*Frame, error)
grpc.ServerStream
}
type tunnelServiceTunnelServer struct {
grpc.ServerStream
}
func (x *tunnelServiceTunnelServer) Send(m *Frame) error {
return x.ServerStream.SendMsg(m)
}
func (x *tunnelServiceTunnelServer) Recv() (*Frame, error) {
m := new(Frame)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// TunnelService_ServiceDesc is the grpc.ServiceDesc for TunnelService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TunnelService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "tunnel.TunnelService",
HandlerType: (*TunnelServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Tunnel",
Handler: _TunnelService_Tunnel_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "tunnel.proto",
}