group

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 group 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_group_group_proto protoreflect.FileDescriptor

Functions

func RegisterGroupHandler

func RegisterGroupHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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

type UnimplementedGroupServer struct {
}

UnimplementedGroupServer can be embedded to have forward compatible implementations.

func (*UnimplementedGroupServer) Count

func (*UnimplementedGroupServer) Delete

func (*UnimplementedGroupServer) List

func (*UnimplementedGroupServer) New

Jump to

Keyboard shortcuts

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