Documentation ¶
Overview ¶
Package message is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterMessageHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMessageHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessageClient) error
- func RegisterMessageHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMessageHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessageServer) error
- func RegisterMessageServer(s *grpc.Server, srv MessageServer)
- type MessageClient
- type MessageServer
- type NewMessageRequest
- func (*NewMessageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NewMessageRequest) GetDate() uint64
- func (x *NewMessageRequest) GetRequest() *Request
- func (x *NewMessageRequest) GetText() string
- func (*NewMessageRequest) ProtoMessage()
- func (x *NewMessageRequest) ProtoReflect() protoreflect.Message
- func (x *NewMessageRequest) Reset()
- func (x *NewMessageRequest) String() string
- type Request
- type Response
- type Response_Message
- func (*Response_Message) Descriptor() ([]byte, []int)deprecated
- func (x *Response_Message) GetError() string
- func (x *Response_Message) GetMessage() []*any.Any
- func (*Response_Message) ProtoMessage()
- func (x *Response_Message) ProtoReflect() protoreflect.Message
- func (x *Response_Message) Reset()
- func (x *Response_Message) String() string
- type UnimplementedMessageServer
Constants ¶
This section is empty.
Variables ¶
var File_github_com_gen95mis_messenger_protobuf_message_message_proto protoreflect.FileDescriptor
Functions ¶
func RegisterMessageHandler ¶
func RegisterMessageHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterMessageHandler registers the http handlers for service Message to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMessageHandlerClient ¶
func RegisterMessageHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessageClient) error
RegisterMessageHandlerClient registers the http handlers for service Message to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MessageClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MessageClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MessageClient" to call the correct interceptors.
func RegisterMessageHandlerFromEndpoint ¶
func RegisterMessageHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMessageHandlerFromEndpoint is same as RegisterMessageHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMessageHandlerServer ¶
func RegisterMessageHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessageServer) error
RegisterMessageHandlerServer registers the http handlers for service Message to "mux". UnaryRPC :call MessageServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMessageHandlerFromEndpoint instead.
func RegisterMessageServer ¶
func RegisterMessageServer(s *grpc.Server, srv MessageServer)
Types ¶
type MessageClient ¶
type MessageClient interface { New(ctx context.Context, in *NewMessageRequest, opts ...grpc.CallOption) (*Response, error) List(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) Count(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Response, error) }
MessageClient is the client API for Message service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMessageClient ¶
func NewMessageClient(cc grpc.ClientConnInterface) MessageClient
type MessageServer ¶
type MessageServer interface { New(context.Context, *NewMessageRequest) (*Response, error) List(context.Context, *Request) (*Response, error) Count(context.Context, *empty.Empty) (*Response, error) }
MessageServer is the server API for Message service.
type NewMessageRequest ¶
type NewMessageRequest struct { Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"` Date uint64 `protobuf:"varint,3,opt,name=date,proto3" json:"date,omitempty"` // contains filtered or unexported fields }
func (*NewMessageRequest) Descriptor
deprecated
func (*NewMessageRequest) Descriptor() ([]byte, []int)
Deprecated: Use NewMessageRequest.ProtoReflect.Descriptor instead.
func (*NewMessageRequest) GetDate ¶
func (x *NewMessageRequest) GetDate() uint64
func (*NewMessageRequest) GetRequest ¶
func (x *NewMessageRequest) GetRequest() *Request
func (*NewMessageRequest) GetText ¶
func (x *NewMessageRequest) GetText() string
func (*NewMessageRequest) ProtoMessage ¶
func (*NewMessageRequest) ProtoMessage()
func (*NewMessageRequest) ProtoReflect ¶
func (x *NewMessageRequest) ProtoReflect() protoreflect.Message
func (*NewMessageRequest) Reset ¶
func (x *NewMessageRequest) Reset()
func (*NewMessageRequest) String ¶
func (x *NewMessageRequest) String() string
type Request ¶
type Request struct { UserID uint32 `protobuf:"varint,1,opt,name=userID,proto3" json:"userID,omitempty"` GroupID uint32 `protobuf:"varint,2,opt,name=groupID,proto3" json:"groupID,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetGroupID ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` Response *Response_Message `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetResponse ¶
func (x *Response) GetResponse() *Response_Message
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type Response_Message ¶
type Response_Message struct { Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` Message []*any.Any `protobuf:"bytes,2,rep,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Response_Message) Descriptor
deprecated
func (*Response_Message) Descriptor() ([]byte, []int)
Deprecated: Use Response_Message.ProtoReflect.Descriptor instead.
func (*Response_Message) GetError ¶
func (x *Response_Message) GetError() string
func (*Response_Message) GetMessage ¶
func (x *Response_Message) GetMessage() []*any.Any
func (*Response_Message) ProtoMessage ¶
func (*Response_Message) ProtoMessage()
func (*Response_Message) ProtoReflect ¶
func (x *Response_Message) ProtoReflect() protoreflect.Message
func (*Response_Message) Reset ¶
func (x *Response_Message) Reset()
func (*Response_Message) String ¶
func (x *Response_Message) String() string
type UnimplementedMessageServer ¶
type UnimplementedMessageServer struct { }
UnimplementedMessageServer can be embedded to have forward compatible implementations.
func (*UnimplementedMessageServer) New ¶
func (*UnimplementedMessageServer) New(context.Context, *NewMessageRequest) (*Response, error)