Documentation ¶
Overview ¶
Package group is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGroupHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGroupHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GroupClient) error
- func RegisterGroupHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGroupHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GroupServer) error
- func RegisterGroupServer(s *grpc.Server, srv GroupServer)
- type GroupClient
- type GroupServer
- type NewGroupRequest
- func (*NewGroupRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NewGroupRequest) GetLogin() string
- func (x *NewGroupRequest) GetName() string
- func (*NewGroupRequest) ProtoMessage()
- func (x *NewGroupRequest) ProtoReflect() protoreflect.Message
- func (x *NewGroupRequest) Reset()
- func (x *NewGroupRequest) 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 UnimplementedGroupServer
- func (*UnimplementedGroupServer) Count(context.Context, *empty.Empty) (*Response, error)
- func (*UnimplementedGroupServer) Delete(context.Context, *Request) (*Response, error)
- func (*UnimplementedGroupServer) List(context.Context, *Request) (*Response, error)
- func (*UnimplementedGroupServer) New(context.Context, *NewGroupRequest) (*Response, error)
Constants ¶
This section is empty.
Variables ¶
var File_github_com_gen95mis_messenger_protobuf_group_group_proto protoreflect.FileDescriptor
Functions ¶
func RegisterGroupHandler ¶
RegisterGroupHandler registers the http handlers for service Group to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGroupHandlerClient ¶
func RegisterGroupHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GroupClient) error
RegisterGroupHandlerClient registers the http handlers for service Group to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GroupClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GroupClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GroupClient" to call the correct interceptors.
func RegisterGroupHandlerFromEndpoint ¶
func RegisterGroupHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGroupHandlerFromEndpoint is same as RegisterGroupHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGroupHandlerServer ¶
func RegisterGroupHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GroupServer) error
RegisterGroupHandlerServer registers the http handlers for service Group to "mux". UnaryRPC :call GroupServer 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 RegisterGroupHandlerFromEndpoint instead.
func RegisterGroupServer ¶
func RegisterGroupServer(s *grpc.Server, srv GroupServer)
Types ¶
type GroupClient ¶
type GroupClient interface { New(ctx context.Context, in *NewGroupRequest, opts ...grpc.CallOption) (*Response, error) Delete(ctx context.Context, in *Request, 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) }
GroupClient is the client API for Group service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGroupClient ¶
func NewGroupClient(cc grpc.ClientConnInterface) GroupClient
type GroupServer ¶
type GroupServer interface { New(context.Context, *NewGroupRequest) (*Response, error) Delete(context.Context, *Request) (*Response, error) List(context.Context, *Request) (*Response, error) Count(context.Context, *empty.Empty) (*Response, error) }
GroupServer is the server API for Group service.
type NewGroupRequest ¶
type NewGroupRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Login string `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"` // contains filtered or unexported fields }
func (*NewGroupRequest) Descriptor
deprecated
func (*NewGroupRequest) Descriptor() ([]byte, []int)
Deprecated: Use NewGroupRequest.ProtoReflect.Descriptor instead.
func (*NewGroupRequest) GetLogin ¶
func (x *NewGroupRequest) GetLogin() string
func (*NewGroupRequest) GetName ¶
func (x *NewGroupRequest) GetName() string
func (*NewGroupRequest) ProtoMessage ¶
func (*NewGroupRequest) ProtoMessage()
func (*NewGroupRequest) ProtoReflect ¶
func (x *NewGroupRequest) ProtoReflect() protoreflect.Message
func (*NewGroupRequest) Reset ¶
func (x *NewGroupRequest) Reset()
func (*NewGroupRequest) String ¶
func (x *NewGroupRequest) 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 UnimplementedGroupServer ¶
type UnimplementedGroupServer struct { }
UnimplementedGroupServer can be embedded to have forward compatible implementations.
func (*UnimplementedGroupServer) New ¶
func (*UnimplementedGroupServer) New(context.Context, *NewGroupRequest) (*Response, error)