// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.6.1 // source: service.proto package network import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" 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 ControlDataType int32 const ( ControlData_come ControlDataType = 0 ControlData_connect_req ControlDataType = 1 ControlData_connect_rep ControlDataType = 2 ControlData_disconnect ControlDataType = 3 ControlData_keepalive ControlDataType = 4 ) // Enum value maps for ControlDataType. var ( ControlDataType_name = map[int32]string{ 0: "come", 1: "connect_req", 2: "connect_rep", 3: "disconnect", 4: "keepalive", } ControlDataType_value = map[string]int32{ "come": 0, "connect_req": 1, "connect_rep": 2, "disconnect": 3, "keepalive": 4, } ) func (x ControlDataType) Enum() *ControlDataType { p := new(ControlDataType) *p = x return p } func (x ControlDataType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ControlDataType) Descriptor() protoreflect.EnumDescriptor { return file_service_proto_enumTypes[0].Descriptor() } func (ControlDataType) Type() protoreflect.EnumType { return &file_service_proto_enumTypes[0] } func (x ControlDataType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ControlDataType.Descriptor instead. func (ControlDataType) EnumDescriptor() ([]byte, []int) { return file_service_proto_rawDescGZIP(), []int{0, 0} } type ControlData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields XType ControlDataType `protobuf:"varint,1,opt,name=_type,json=Type,proto3,enum=network.ControlDataType" json:"_type,omitempty"` From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` // Types that are assignable to Payload: // *ControlData_Creq // *ControlData_Crep Payload isControlData_Payload `protobuf_oneof:"payload"` } func (x *ControlData) Reset() { *x = ControlData{} if protoimpl.UnsafeEnabled { mi := &file_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ControlData) String() string { return protoimpl.X.MessageStringOf(x) } func (*ControlData) ProtoMessage() {} func (x *ControlData) ProtoReflect() protoreflect.Message { mi := &file_service_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 ControlData.ProtoReflect.Descriptor instead. func (*ControlData) Descriptor() ([]byte, []int) { return file_service_proto_rawDescGZIP(), []int{0} } func (x *ControlData) GetXType() ControlDataType { if x != nil { return x.XType } return ControlData_come } func (x *ControlData) GetFrom() string { if x != nil { return x.From } return "" } func (x *ControlData) GetTo() string { if x != nil { return x.To } return "" } func (m *ControlData) GetPayload() isControlData_Payload { if m != nil { return m.Payload } return nil } func (x *ControlData) GetCreq() *ConnectRequest { if x, ok := x.GetPayload().(*ControlData_Creq); ok { return x.Creq } return nil } func (x *ControlData) GetCrep() *ConnectResponse { if x, ok := x.GetPayload().(*ControlData_Crep); ok { return x.Crep } return nil } type isControlData_Payload interface { isControlData_Payload() } type ControlData_Creq struct { Creq *ConnectRequest `protobuf:"bytes,10,opt,name=creq,proto3,oneof"` } type ControlData_Crep struct { Crep *ConnectResponse `protobuf:"bytes,11,opt,name=crep,proto3,oneof"` } func (*ControlData_Creq) isControlData_Payload() {} func (*ControlData_Crep) isControlData_Payload() {} type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` Cid string `protobuf:"bytes,3,opt,name=cid,proto3" json:"cid,omitempty"` Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` } func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_service_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 Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { return file_service_proto_rawDescGZIP(), []int{1} } func (x *Data) GetFrom() string { if x != nil { return x.From } return "" } func (x *Data) GetTo() string { if x != nil { return x.To } return "" } func (x *Data) GetCid() string { if x != nil { return x.Cid } return "" } func (x *Data) GetData() []byte { if x != nil { return x.Data } return nil } var File_service_proto protoreflect.FileDescriptor var file_service_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x1a, 0x0d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x02, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x05, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x72, 0x65, 0x71, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x63, 0x72, 0x65, 0x71, 0x12, 0x2f, 0x0a, 0x04, 0x63, 0x72, 0x65, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x63, 0x72, 0x65, 0x70, 0x22, 0x51, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x63, 0x6f, 0x6d, 0x65, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x6b, 0x65, 0x65, 0x70, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x10, 0x04, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x50, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x73, 0x0a, 0x07, 0x6e, 0x61, 0x74, 0x70, 0x61, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x15, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x15, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x12, 0x2b, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0d, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x0d, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x3b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_service_proto_rawDescOnce sync.Once file_service_proto_rawDescData = file_service_proto_rawDesc ) func file_service_proto_rawDescGZIP() []byte { file_service_proto_rawDescOnce.Do(func() { file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_proto_rawDescData) }) return file_service_proto_rawDescData } var file_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_service_proto_goTypes = []interface{}{ (ControlDataType)(0), // 0: network.control_data.type (*ControlData)(nil), // 1: network.control_data (*Data)(nil), // 2: network.data (*ConnectRequest)(nil), // 3: network.connect_request (*ConnectResponse)(nil), // 4: network.connect_response } var file_service_proto_depIdxs = []int32{ 0, // 0: network.control_data._type:type_name -> network.control_data.type 3, // 1: network.control_data.creq:type_name -> network.connect_request 4, // 2: network.control_data.crep:type_name -> network.connect_response 1, // 3: network.natpass.control:input_type -> network.control_data 2, // 4: network.natpass.forward:input_type -> network.data 1, // 5: network.natpass.control:output_type -> network.control_data 2, // 6: network.natpass.forward:output_type -> network.data 5, // [5:7] is the sub-list for method output_type 3, // [3:5] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name 3, // [3:3] is the sub-list for extension extendee 0, // [0:3] is the sub-list for field type_name } func init() { file_service_proto_init() } func file_service_proto_init() { if File_service_proto != nil { return } file_connect_proto_init() if !protoimpl.UnsafeEnabled { file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ControlData); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } file_service_proto_msgTypes[0].OneofWrappers = []interface{}{ (*ControlData_Creq)(nil), (*ControlData_Crep)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_proto_rawDesc, NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, GoTypes: file_service_proto_goTypes, DependencyIndexes: file_service_proto_depIdxs, EnumInfos: file_service_proto_enumTypes, MessageInfos: file_service_proto_msgTypes, }.Build() File_service_proto = out.File file_service_proto_rawDesc = nil file_service_proto_goTypes = nil file_service_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConnInterface // 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 // NatpassClient is the client API for Natpass service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type NatpassClient interface { Control(ctx context.Context, opts ...grpc.CallOption) (Natpass_ControlClient, error) Forward(ctx context.Context, opts ...grpc.CallOption) (Natpass_ForwardClient, error) } type natpassClient struct { cc grpc.ClientConnInterface } func NewNatpassClient(cc grpc.ClientConnInterface) NatpassClient { return &natpassClient{cc} } func (c *natpassClient) Control(ctx context.Context, opts ...grpc.CallOption) (Natpass_ControlClient, error) { stream, err := c.cc.NewStream(ctx, &_Natpass_serviceDesc.Streams[0], "/network.natpass/control", opts...) if err != nil { return nil, err } x := &natpassControlClient{stream} return x, nil } type Natpass_ControlClient interface { Send(*ControlData) error Recv() (*ControlData, error) grpc.ClientStream } type natpassControlClient struct { grpc.ClientStream } func (x *natpassControlClient) Send(m *ControlData) error { return x.ClientStream.SendMsg(m) } func (x *natpassControlClient) Recv() (*ControlData, error) { m := new(ControlData) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *natpassClient) Forward(ctx context.Context, opts ...grpc.CallOption) (Natpass_ForwardClient, error) { stream, err := c.cc.NewStream(ctx, &_Natpass_serviceDesc.Streams[1], "/network.natpass/forward", opts...) if err != nil { return nil, err } x := &natpassForwardClient{stream} return x, nil } type Natpass_ForwardClient interface { Send(*Data) error Recv() (*Data, error) grpc.ClientStream } type natpassForwardClient struct { grpc.ClientStream } func (x *natpassForwardClient) Send(m *Data) error { return x.ClientStream.SendMsg(m) } func (x *natpassForwardClient) Recv() (*Data, error) { m := new(Data) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // NatpassServer is the server API for Natpass service. type NatpassServer interface { Control(Natpass_ControlServer) error Forward(Natpass_ForwardServer) error } // UnimplementedNatpassServer can be embedded to have forward compatible implementations. type UnimplementedNatpassServer struct { } func (*UnimplementedNatpassServer) Control(Natpass_ControlServer) error { return status.Errorf(codes.Unimplemented, "method Control not implemented") } func (*UnimplementedNatpassServer) Forward(Natpass_ForwardServer) error { return status.Errorf(codes.Unimplemented, "method Forward not implemented") } func RegisterNatpassServer(s *grpc.Server, srv NatpassServer) { s.RegisterService(&_Natpass_serviceDesc, srv) } func _Natpass_Control_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(NatpassServer).Control(&natpassControlServer{stream}) } type Natpass_ControlServer interface { Send(*ControlData) error Recv() (*ControlData, error) grpc.ServerStream } type natpassControlServer struct { grpc.ServerStream } func (x *natpassControlServer) Send(m *ControlData) error { return x.ServerStream.SendMsg(m) } func (x *natpassControlServer) Recv() (*ControlData, error) { m := new(ControlData) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func _Natpass_Forward_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(NatpassServer).Forward(&natpassForwardServer{stream}) } type Natpass_ForwardServer interface { Send(*Data) error Recv() (*Data, error) grpc.ServerStream } type natpassForwardServer struct { grpc.ServerStream } func (x *natpassForwardServer) Send(m *Data) error { return x.ServerStream.SendMsg(m) } func (x *natpassForwardServer) Recv() (*Data, error) { m := new(Data) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } var _Natpass_serviceDesc = grpc.ServiceDesc{ ServiceName: "network.natpass", HandlerType: (*NatpassServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "control", Handler: _Natpass_Control_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "forward", Handler: _Natpass_Forward_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "service.proto", }