message

package
v0.0.0-...-a0b9aba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package message is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetGroupID

func (x *Request) GetGroupID() uint32

func (*Request) GetUserID

func (x *Request) GetUserID() uint32

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetResponse

func (x *Response) GetResponse() *Response_Message

func (*Response) GetStatus

func (x *Response) GetStatus() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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) Count

func (*UnimplementedMessageServer) List

func (*UnimplementedMessageServer) New

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL