Documentation ¶
Index ¶
- Variables
- func RegisterBasicsServer(s grpc.ServiceRegistrar, srv BasicsServer)
- func RegisterPubSubServer(s grpc.ServiceRegistrar, srv PubSubServer)
- func RegisterTaskServer(s grpc.ServiceRegistrar, srv TaskServer)
- type BasicsClient
- type BasicsRequest
- type BasicsResponse
- type BasicsServer
- type PubSubClient
- type PubSubServer
- type PubSubServerService
- type PubSub_SubscribeClient
- type PubSub_SubscribeServer
- type PublishRequest
- func (*PublishRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PublishRequest) GetId() string
- func (x *PublishRequest) GetIp() string
- func (x *PublishRequest) GetMethod() string
- func (x *PublishRequest) GetValue() string
- func (*PublishRequest) ProtoMessage()
- func (x *PublishRequest) ProtoReflect() protoreflect.Message
- func (x *PublishRequest) Reset()
- func (x *PublishRequest) String() string
- type PublishResponse
- func (*PublishResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PublishResponse) GetId() string
- func (x *PublishResponse) GetIp() string
- func (x *PublishResponse) GetValue() string
- func (*PublishResponse) ProtoMessage()
- func (x *PublishResponse) ProtoReflect() protoreflect.Message
- func (x *PublishResponse) Reset()
- func (x *PublishResponse) String() string
- type SubscribeRequest
- func (*SubscribeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubscribeRequest) GetId() string
- func (x *SubscribeRequest) GetIp() string
- func (x *SubscribeRequest) GetMethod() string
- func (x *SubscribeRequest) GetValue() string
- func (*SubscribeRequest) ProtoMessage()
- func (x *SubscribeRequest) ProtoReflect() protoreflect.Message
- func (x *SubscribeRequest) Reset()
- func (x *SubscribeRequest) String() string
- type SubscribeResponse
- func (*SubscribeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SubscribeResponse) GetId() string
- func (x *SubscribeResponse) GetMethod() string
- func (x *SubscribeResponse) GetValue() string
- func (*SubscribeResponse) ProtoMessage()
- func (x *SubscribeResponse) ProtoReflect() protoreflect.Message
- func (x *SubscribeResponse) Reset()
- func (x *SubscribeResponse) String() string
- type TaskClient
- type TaskRequest
- type TaskResponse
- type TaskServer
- type Task_BidirectionalStreamingTaskClient
- type Task_BidirectionalStreamingTaskServer
- type Task_ClientStreamingTaskClient
- type Task_ClientStreamingTaskServer
- type Task_ServerStreamingTaskClient
- type Task_ServerStreamingTaskServer
- type UnimplementedBasicsServer
- type UnimplementedPubSubServer
- type UnimplementedTaskServer
- func (UnimplementedTaskServer) BidirectionalStreamingTask(Task_BidirectionalStreamingTaskServer) error
- func (UnimplementedTaskServer) ClientStreamingTask(Task_ClientStreamingTaskServer) error
- func (UnimplementedTaskServer) ServerStreamingTask(*TaskRequest, Task_ServerStreamingTaskServer) error
- func (UnimplementedTaskServer) UnaryTask(context.Context, *TaskRequest) (*TaskResponse, error)
- type UnsafeBasicsServer
- type UnsafePubSubServer
- type UnsafeTaskServer
Constants ¶
This section is empty.
Variables ¶
var Basics_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Basics", HandlerType: (*BasicsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _Basics_Ping_Handler, }, { MethodName: "Pong", Handler: _Basics_Pong_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/basics.proto", }
Basics_ServiceDesc is the grpc.ServiceDesc for Basics service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_pb_basics_proto protoreflect.FileDescriptor
var File_pb_pubsub_proto protoreflect.FileDescriptor
var File_pb_task_proto protoreflect.FileDescriptor
var PubSub_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.PubSub", HandlerType: (*PubSubServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Publish", Handler: _PubSub_Publish_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Subscribe", Handler: _PubSub_Subscribe_Handler, ServerStreams: true, }, }, Metadata: "pb/pubsub.proto", }
PubSub_ServiceDesc is the grpc.ServiceDesc for PubSub service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var Task_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Task", HandlerType: (*TaskServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "UnaryTask", Handler: _Task_UnaryTask_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ServerStreamingTask", Handler: _Task_ServerStreamingTask_Handler, ServerStreams: true, }, { StreamName: "ClientStreamingTask", Handler: _Task_ClientStreamingTask_Handler, ClientStreams: true, }, { StreamName: "BidirectionalStreamingTask", Handler: _Task_BidirectionalStreamingTask_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "pb/task.proto", }
Task_ServiceDesc is the grpc.ServiceDesc for Task service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterBasicsServer ¶
func RegisterBasicsServer(s grpc.ServiceRegistrar, srv BasicsServer)
func RegisterPubSubServer ¶
func RegisterPubSubServer(s grpc.ServiceRegistrar, srv PubSubServer)
func RegisterTaskServer ¶
func RegisterTaskServer(s grpc.ServiceRegistrar, srv TaskServer)
Types ¶
type BasicsClient ¶
type BasicsClient interface { // 心跳 Ping(ctx context.Context, in *BasicsRequest, opts ...grpc.CallOption) (*BasicsResponse, error) // 心跳 Pong(ctx context.Context, in *BasicsRequest, opts ...grpc.CallOption) (*BasicsResponse, error) }
BasicsClient is the client API for Basics 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.
func NewBasicsClient ¶
func NewBasicsClient(cc grpc.ClientConnInterface) BasicsClient
type BasicsRequest ¶
type BasicsRequest struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
请求消息
func (*BasicsRequest) Descriptor
deprecated
func (*BasicsRequest) Descriptor() ([]byte, []int)
Deprecated: Use BasicsRequest.ProtoReflect.Descriptor instead.
func (*BasicsRequest) GetMessage ¶
func (x *BasicsRequest) GetMessage() string
func (*BasicsRequest) ProtoMessage ¶
func (*BasicsRequest) ProtoMessage()
func (*BasicsRequest) ProtoReflect ¶
func (x *BasicsRequest) ProtoReflect() protoreflect.Message
func (*BasicsRequest) Reset ¶
func (x *BasicsRequest) Reset()
func (*BasicsRequest) String ¶
func (x *BasicsRequest) String() string
type BasicsResponse ¶
type BasicsResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
响应消息
func (*BasicsResponse) Descriptor
deprecated
func (*BasicsResponse) Descriptor() ([]byte, []int)
Deprecated: Use BasicsResponse.ProtoReflect.Descriptor instead.
func (*BasicsResponse) GetMessage ¶
func (x *BasicsResponse) GetMessage() string
func (*BasicsResponse) ProtoMessage ¶
func (*BasicsResponse) ProtoMessage()
func (*BasicsResponse) ProtoReflect ¶
func (x *BasicsResponse) ProtoReflect() protoreflect.Message
func (*BasicsResponse) Reset ¶
func (x *BasicsResponse) Reset()
func (*BasicsResponse) String ¶
func (x *BasicsResponse) String() string
type BasicsServer ¶
type BasicsServer interface { // 心跳 Ping(context.Context, *BasicsRequest) (*BasicsResponse, error) // 心跳 Pong(context.Context, *BasicsRequest) (*BasicsResponse, error) // contains filtered or unexported methods }
BasicsServer is the server API for Basics service. All implementations must embed UnimplementedBasicsServer for forward compatibility
type PubSubClient ¶
type PubSubClient interface { // [发布] 消息 Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error) // [订阅] 消息 Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (PubSub_SubscribeClient, error) }
PubSubClient is the client API for PubSub 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.
func NewPubSubClient ¶
func NewPubSubClient(cc grpc.ClientConnInterface) PubSubClient
type PubSubServer ¶
type PubSubServer interface { // [发布] 消息 Publish(context.Context, *PublishRequest) (*PublishResponse, error) // [订阅] 消息 Subscribe(*SubscribeRequest, PubSub_SubscribeServer) error // contains filtered or unexported methods }
PubSubServer is the server API for PubSub service. All implementations must embed UnimplementedPubSubServer for forward compatibility
type PubSubServerService ¶
type PubSubServerService struct { UnimplementedPubSubServer // contains filtered or unexported fields }
func NewPubSubServerService ¶
func NewPubSubServerService() *PubSubServerService
func (*PubSubServerService) Publish ¶
func (p *PubSubServerService) Publish(ctx context.Context, req *PublishRequest) (*PublishResponse, error)
Publish 实现发布方法
func (*PubSubServerService) Subscribe ¶
func (p *PubSubServerService) Subscribe(req *SubscribeRequest, stream PubSub_SubscribeServer) error
Subscribe 实现订阅方法
type PubSub_SubscribeClient ¶
type PubSub_SubscribeClient interface { Recv() (*SubscribeResponse, error) grpc.ClientStream }
type PubSub_SubscribeServer ¶
type PubSub_SubscribeServer interface { Send(*SubscribeResponse) error grpc.ServerStream }
type PublishRequest ¶
type PublishRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` // contains filtered or unexported fields }
请求消息
func (*PublishRequest) Descriptor
deprecated
func (*PublishRequest) Descriptor() ([]byte, []int)
Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.
func (*PublishRequest) GetId ¶
func (x *PublishRequest) GetId() string
func (*PublishRequest) GetIp ¶
func (x *PublishRequest) GetIp() string
func (*PublishRequest) GetMethod ¶
func (x *PublishRequest) GetMethod() string
func (*PublishRequest) GetValue ¶
func (x *PublishRequest) GetValue() string
func (*PublishRequest) ProtoMessage ¶
func (*PublishRequest) ProtoMessage()
func (*PublishRequest) ProtoReflect ¶
func (x *PublishRequest) ProtoReflect() protoreflect.Message
func (*PublishRequest) Reset ¶
func (x *PublishRequest) Reset()
func (*PublishRequest) String ¶
func (x *PublishRequest) String() string
type PublishResponse ¶
type PublishResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` // contains filtered or unexported fields }
响应消息
func (*PublishResponse) Descriptor
deprecated
func (*PublishResponse) Descriptor() ([]byte, []int)
Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead.
func (*PublishResponse) GetId ¶
func (x *PublishResponse) GetId() string
func (*PublishResponse) GetIp ¶
func (x *PublishResponse) GetIp() string
func (*PublishResponse) GetValue ¶
func (x *PublishResponse) GetValue() string
func (*PublishResponse) ProtoMessage ¶
func (*PublishResponse) ProtoMessage()
func (*PublishResponse) ProtoReflect ¶
func (x *PublishResponse) ProtoReflect() protoreflect.Message
func (*PublishResponse) Reset ¶
func (x *PublishResponse) Reset()
func (*PublishResponse) String ¶
func (x *PublishResponse) String() string
type SubscribeRequest ¶
type SubscribeRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` // contains filtered or unexported fields }
请求消息
func (*SubscribeRequest) Descriptor
deprecated
func (*SubscribeRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.
func (*SubscribeRequest) GetId ¶
func (x *SubscribeRequest) GetId() string
func (*SubscribeRequest) GetIp ¶
func (x *SubscribeRequest) GetIp() string
func (*SubscribeRequest) GetMethod ¶
func (x *SubscribeRequest) GetMethod() string
func (*SubscribeRequest) GetValue ¶
func (x *SubscribeRequest) GetValue() string
func (*SubscribeRequest) ProtoMessage ¶
func (*SubscribeRequest) ProtoMessage()
func (*SubscribeRequest) ProtoReflect ¶
func (x *SubscribeRequest) ProtoReflect() protoreflect.Message
func (*SubscribeRequest) Reset ¶
func (x *SubscribeRequest) Reset()
func (*SubscribeRequest) String ¶
func (x *SubscribeRequest) String() string
type SubscribeResponse ¶
type SubscribeResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` // contains filtered or unexported fields }
响应消息
func (*SubscribeResponse) Descriptor
deprecated
func (*SubscribeResponse) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead.
func (*SubscribeResponse) GetId ¶
func (x *SubscribeResponse) GetId() string
func (*SubscribeResponse) GetMethod ¶
func (x *SubscribeResponse) GetMethod() string
func (*SubscribeResponse) GetValue ¶
func (x *SubscribeResponse) GetValue() string
func (*SubscribeResponse) ProtoMessage ¶
func (*SubscribeResponse) ProtoMessage()
func (*SubscribeResponse) ProtoReflect ¶
func (x *SubscribeResponse) ProtoReflect() protoreflect.Message
func (*SubscribeResponse) Reset ¶
func (x *SubscribeResponse) Reset()
func (*SubscribeResponse) String ¶
func (x *SubscribeResponse) String() string
type TaskClient ¶
type TaskClient interface { // 普通一元方法 UnaryTask(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskResponse, error) // 服务端推送流 ServerStreamingTask(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (Task_ServerStreamingTaskClient, error) // 客户端推送流 ClientStreamingTask(ctx context.Context, opts ...grpc.CallOption) (Task_ClientStreamingTaskClient, error) // 双向推送流 BidirectionalStreamingTask(ctx context.Context, opts ...grpc.CallOption) (Task_BidirectionalStreamingTaskClient, error) }
TaskClient is the client API for Task 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.
func NewTaskClient ¶
func NewTaskClient(cc grpc.ClientConnInterface) TaskClient
type TaskRequest ¶
type TaskRequest struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
请求消息
func (*TaskRequest) Descriptor
deprecated
func (*TaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use TaskRequest.ProtoReflect.Descriptor instead.
func (*TaskRequest) GetMessage ¶
func (x *TaskRequest) GetMessage() string
func (*TaskRequest) ProtoMessage ¶
func (*TaskRequest) ProtoMessage()
func (*TaskRequest) ProtoReflect ¶
func (x *TaskRequest) ProtoReflect() protoreflect.Message
func (*TaskRequest) Reset ¶
func (x *TaskRequest) Reset()
func (*TaskRequest) String ¶
func (x *TaskRequest) String() string
type TaskResponse ¶
type TaskResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
响应消息
func (*TaskResponse) Descriptor
deprecated
func (*TaskResponse) Descriptor() ([]byte, []int)
Deprecated: Use TaskResponse.ProtoReflect.Descriptor instead.
func (*TaskResponse) GetMessage ¶
func (x *TaskResponse) GetMessage() string
func (*TaskResponse) ProtoMessage ¶
func (*TaskResponse) ProtoMessage()
func (*TaskResponse) ProtoReflect ¶
func (x *TaskResponse) ProtoReflect() protoreflect.Message
func (*TaskResponse) Reset ¶
func (x *TaskResponse) Reset()
func (*TaskResponse) String ¶
func (x *TaskResponse) String() string
type TaskServer ¶
type TaskServer interface { // 普通一元方法 UnaryTask(context.Context, *TaskRequest) (*TaskResponse, error) // 服务端推送流 ServerStreamingTask(*TaskRequest, Task_ServerStreamingTaskServer) error // 客户端推送流 ClientStreamingTask(Task_ClientStreamingTaskServer) error // 双向推送流 BidirectionalStreamingTask(Task_BidirectionalStreamingTaskServer) error // contains filtered or unexported methods }
TaskServer is the server API for Task service. All implementations must embed UnimplementedTaskServer for forward compatibility
type Task_BidirectionalStreamingTaskClient ¶
type Task_BidirectionalStreamingTaskClient interface { Send(*TaskRequest) error Recv() (*TaskResponse, error) grpc.ClientStream }
type Task_BidirectionalStreamingTaskServer ¶
type Task_BidirectionalStreamingTaskServer interface { Send(*TaskResponse) error Recv() (*TaskRequest, error) grpc.ServerStream }
type Task_ClientStreamingTaskClient ¶
type Task_ClientStreamingTaskClient interface { Send(*TaskRequest) error CloseAndRecv() (*TaskResponse, error) grpc.ClientStream }
type Task_ClientStreamingTaskServer ¶
type Task_ClientStreamingTaskServer interface { SendAndClose(*TaskResponse) error Recv() (*TaskRequest, error) grpc.ServerStream }
type Task_ServerStreamingTaskClient ¶
type Task_ServerStreamingTaskClient interface { Recv() (*TaskResponse, error) grpc.ClientStream }
type Task_ServerStreamingTaskServer ¶
type Task_ServerStreamingTaskServer interface { Send(*TaskResponse) error grpc.ServerStream }
type UnimplementedBasicsServer ¶
type UnimplementedBasicsServer struct { }
UnimplementedBasicsServer must be embedded to have forward compatible implementations.
func (UnimplementedBasicsServer) Ping ¶
func (UnimplementedBasicsServer) Ping(context.Context, *BasicsRequest) (*BasicsResponse, error)
func (UnimplementedBasicsServer) Pong ¶
func (UnimplementedBasicsServer) Pong(context.Context, *BasicsRequest) (*BasicsResponse, error)
type UnimplementedPubSubServer ¶
type UnimplementedPubSubServer struct { }
UnimplementedPubSubServer must be embedded to have forward compatible implementations.
func (UnimplementedPubSubServer) Publish ¶
func (UnimplementedPubSubServer) Publish(context.Context, *PublishRequest) (*PublishResponse, error)
func (UnimplementedPubSubServer) Subscribe ¶
func (UnimplementedPubSubServer) Subscribe(*SubscribeRequest, PubSub_SubscribeServer) error
type UnimplementedTaskServer ¶
type UnimplementedTaskServer struct { }
UnimplementedTaskServer must be embedded to have forward compatible implementations.
func (UnimplementedTaskServer) BidirectionalStreamingTask ¶
func (UnimplementedTaskServer) BidirectionalStreamingTask(Task_BidirectionalStreamingTaskServer) error
func (UnimplementedTaskServer) ClientStreamingTask ¶
func (UnimplementedTaskServer) ClientStreamingTask(Task_ClientStreamingTaskServer) error
func (UnimplementedTaskServer) ServerStreamingTask ¶
func (UnimplementedTaskServer) ServerStreamingTask(*TaskRequest, Task_ServerStreamingTaskServer) error
func (UnimplementedTaskServer) UnaryTask ¶
func (UnimplementedTaskServer) UnaryTask(context.Context, *TaskRequest) (*TaskResponse, error)
type UnsafeBasicsServer ¶
type UnsafeBasicsServer interface {
// contains filtered or unexported methods
}
UnsafeBasicsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BasicsServer will result in compilation errors.
type UnsafePubSubServer ¶
type UnsafePubSubServer interface {
// contains filtered or unexported methods
}
UnsafePubSubServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PubSubServer will result in compilation errors.
type UnsafeTaskServer ¶
type UnsafeTaskServer interface {
// contains filtered or unexported methods
}
UnsafeTaskServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TaskServer will result in compilation errors.