Documentation ¶
Index ¶
- Constants
- Variables
- func MessagingClientRoutes(cli MessagingClient, opts ...gors.Option) []gors.Route
- func MessagingServerRoutes(srv MessagingServer, opts ...gors.Option) []gors.Route
- func MessagingServiceRoutes(svc MessagingService, opts ...gors.Option) []gors.Route
- func RegisterMessagingServer(s grpc.ServiceRegistrar, srv MessagingServer)
- type GetMessageRequest
- func (*GetMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetMessageRequest) GetMessageId() string
- func (x *GetMessageRequest) GetTags() []string
- func (x *GetMessageRequest) GetUserId() uint64
- func (*GetMessageRequest) ProtoMessage()
- func (x *GetMessageRequest) ProtoReflect() protoreflect.Message
- func (x *GetMessageRequest) Reset()
- func (x *GetMessageRequest) String() string
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetContent() string
- func (x *Message) GetMaybe() string
- func (x *Message) GetMessageId() string
- func (x *Message) GetTags() []string
- func (x *Message) GetUpdateMask() *fieldmaskpb.FieldMask
- func (x *Message) GetUserId() uint64
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type MessagingClient
- type MessagingServer
- type MessagingService
- type Messaging_StreamClient
- type Messaging_StreamRequestClient
- type Messaging_StreamRequestServer
- type Messaging_StreamResponseClient
- type Messaging_StreamResponseServer
- type Messaging_StreamServer
- type UnimplementedMessagingServer
- func (UnimplementedMessagingServer) CreateMessage(context.Context, *Message) (*Message, error)
- func (UnimplementedMessagingServer) GetMessage(context.Context, *GetMessageRequest) (*Message, error)
- func (UnimplementedMessagingServer) GetMessages(context.Context, *GetMessageRequest) (*Message, error)
- func (UnimplementedMessagingServer) Stream(Messaging_StreamServer) error
- func (UnimplementedMessagingServer) StreamRequest(Messaging_StreamRequestServer) error
- func (UnimplementedMessagingServer) StreamResponse(*Message, Messaging_StreamResponseServer) error
- func (UnimplementedMessagingServer) UpdateMessage(context.Context, *Message) (*Message, error)
- type UnsafeMessagingServer
Constants ¶
const ( Messaging_GetMessages_FullMethodName = "/tests.example.message.v1.Messaging/GetMessages" Messaging_GetMessage_FullMethodName = "/tests.example.message.v1.Messaging/GetMessage" Messaging_CreateMessage_FullMethodName = "/tests.example.message.v1.Messaging/CreateMessage" Messaging_UpdateMessage_FullMethodName = "/tests.example.message.v1.Messaging/UpdateMessage" Messaging_StreamRequest_FullMethodName = "/tests.example.message.v1.Messaging/StreamRequest" Messaging_StreamResponse_FullMethodName = "/tests.example.message.v1.Messaging/StreamResponse" Messaging_Stream_FullMethodName = "/tests.example.message.v1.Messaging/Stream" )
Variables ¶
var File_example_api_tests_example_message_proto protoreflect.FileDescriptor
var Messaging_ServiceDesc = grpc.ServiceDesc{ ServiceName: "tests.example.message.v1.Messaging", HandlerType: (*MessagingServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetMessages", Handler: _Messaging_GetMessages_Handler, }, { MethodName: "GetMessage", Handler: _Messaging_GetMessage_Handler, }, { MethodName: "CreateMessage", Handler: _Messaging_CreateMessage_Handler, }, { MethodName: "UpdateMessage", Handler: _Messaging_UpdateMessage_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "StreamRequest", Handler: _Messaging_StreamRequest_Handler, ClientStreams: true, }, { StreamName: "StreamResponse", Handler: _Messaging_StreamResponse_Handler, ServerStreams: true, }, { StreamName: "Stream", Handler: _Messaging_Stream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "example/api/tests/example/message.proto", }
Messaging_ServiceDesc is the grpc.ServiceDesc for Messaging service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func MessagingClientRoutes ¶ added in v1.5.8
func MessagingClientRoutes(cli MessagingClient, opts ...gors.Option) []gors.Route
func MessagingServerRoutes ¶ added in v1.5.8
func MessagingServerRoutes(srv MessagingServer, opts ...gors.Option) []gors.Route
func MessagingServiceRoutes ¶
func MessagingServiceRoutes(svc MessagingService, opts ...gors.Option) []gors.Route
func RegisterMessagingServer ¶
func RegisterMessagingServer(s grpc.ServiceRegistrar, srv MessagingServer)
Types ¶
type GetMessageRequest ¶
type GetMessageRequest struct { MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` UserId uint64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` // contains filtered or unexported fields }
func (*GetMessageRequest) Descriptor
deprecated
func (*GetMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetMessageRequest.ProtoReflect.Descriptor instead.
func (*GetMessageRequest) GetMessageId ¶
func (x *GetMessageRequest) GetMessageId() string
func (*GetMessageRequest) GetTags ¶
func (x *GetMessageRequest) GetTags() []string
func (*GetMessageRequest) GetUserId ¶
func (x *GetMessageRequest) GetUserId() uint64
func (*GetMessageRequest) ProtoMessage ¶
func (*GetMessageRequest) ProtoMessage()
func (*GetMessageRequest) ProtoReflect ¶
func (x *GetMessageRequest) ProtoReflect() protoreflect.Message
func (*GetMessageRequest) Reset ¶
func (x *GetMessageRequest) Reset()
func (*GetMessageRequest) String ¶
func (x *GetMessageRequest) String() string
type Message ¶
type Message struct { // 消息id MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` // 用户id UserId uint64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Maybe *string `protobuf:"bytes,4,opt,name=maybe,proto3,oneof" json:"maybe,omitempty"` Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,6,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetContent ¶
func (*Message) GetMessageId ¶
func (*Message) GetUpdateMask ¶ added in v1.5.1
func (x *Message) GetUpdateMask() *fieldmaskpb.FieldMask
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type MessagingClient ¶
type MessagingClient interface { GetMessages(ctx context.Context, in *GetMessageRequest, opts ...grpc.CallOption) (*Message, error) GetMessage(ctx context.Context, in *GetMessageRequest, opts ...grpc.CallOption) (*Message, error) CreateMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) UpdateMessage(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) StreamRequest(ctx context.Context, opts ...grpc.CallOption) (Messaging_StreamRequestClient, error) StreamResponse(ctx context.Context, in *Message, opts ...grpc.CallOption) (Messaging_StreamResponseClient, error) Stream(ctx context.Context, opts ...grpc.CallOption) (Messaging_StreamClient, error) }
MessagingClient is the client API for Messaging 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 NewMessagingClient ¶
func NewMessagingClient(cc grpc.ClientConnInterface) MessagingClient
type MessagingServer ¶
type MessagingServer interface { GetMessages(context.Context, *GetMessageRequest) (*Message, error) GetMessage(context.Context, *GetMessageRequest) (*Message, error) CreateMessage(context.Context, *Message) (*Message, error) UpdateMessage(context.Context, *Message) (*Message, error) StreamRequest(Messaging_StreamRequestServer) error StreamResponse(*Message, Messaging_StreamResponseServer) error Stream(Messaging_StreamServer) error // contains filtered or unexported methods }
MessagingServer is the server API for Messaging service. All implementations must embed UnimplementedMessagingServer for forward compatibility
type MessagingService ¶
type MessagingService interface { GetMessages(context.Context, *GetMessageRequest) (*Message, error) GetMessage(context.Context, *GetMessageRequest) (*Message, error) CreateMessage(context.Context, *Message) (*Message, error) UpdateMessage(context.Context, *Message) (*Message, error) }
MessagingService is the service API for Messaging service.
type Messaging_StreamClient ¶ added in v1.5.6
type Messaging_StreamRequestClient ¶ added in v1.5.6
type Messaging_StreamRequestServer ¶ added in v1.5.6
type Messaging_StreamResponseClient ¶ added in v1.5.6
type Messaging_StreamResponseClient interface { Recv() (*Message, error) grpc.ClientStream }
type Messaging_StreamResponseServer ¶ added in v1.5.6
type Messaging_StreamResponseServer interface { Send(*Message) error grpc.ServerStream }
type Messaging_StreamServer ¶ added in v1.5.6
type UnimplementedMessagingServer ¶
type UnimplementedMessagingServer struct { }
UnimplementedMessagingServer must be embedded to have forward compatible implementations.
func (UnimplementedMessagingServer) CreateMessage ¶
func (UnimplementedMessagingServer) GetMessage ¶
func (UnimplementedMessagingServer) GetMessage(context.Context, *GetMessageRequest) (*Message, error)
func (UnimplementedMessagingServer) GetMessages ¶
func (UnimplementedMessagingServer) GetMessages(context.Context, *GetMessageRequest) (*Message, error)
func (UnimplementedMessagingServer) Stream ¶ added in v1.5.6
func (UnimplementedMessagingServer) Stream(Messaging_StreamServer) error
func (UnimplementedMessagingServer) StreamRequest ¶ added in v1.5.6
func (UnimplementedMessagingServer) StreamRequest(Messaging_StreamRequestServer) error
func (UnimplementedMessagingServer) StreamResponse ¶ added in v1.5.6
func (UnimplementedMessagingServer) StreamResponse(*Message, Messaging_StreamResponseServer) error
func (UnimplementedMessagingServer) UpdateMessage ¶
type UnsafeMessagingServer ¶
type UnsafeMessagingServer interface {
// contains filtered or unexported methods
}
UnsafeMessagingServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessagingServer will result in compilation errors.