Documentation ¶
Index ¶
- func DecodeResponse(_ context.Context, response interface{}) (interface{}, error)
- func EncodeRequest(_ context.Context, request interface{}) (interface{}, error)
- func InitServer(address string) error
- func MakeApiEndPoint(s Service) endpoint.Endpoint
- func NewGRPCServer(endpoint ApiEndPoint) proto.ApiServer
- func RegisterHandlers(handlers map[string]Handler)
- func RequestGrpcApi(_ context.Context, grpcReq interface{}) (interface{}, error)
- func ResponseGrpcApi(_ context.Context, response interface{}) (interface{}, error)
- type ApiEndPoint
- type Handler
- type Request
- type Response
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeResponse ¶
func EncodeRequest ¶
func InitServer ¶
func MakeApiEndPoint ¶
func NewGRPCServer ¶
func NewGRPCServer(endpoint ApiEndPoint) proto.ApiServer
func RegisterHandlers ¶
func RequestGrpcApi ¶
func ResponseGrpcApi ¶
Types ¶
type ApiEndPoint ¶
func NewEndPointServer ¶
func NewEndPointServer(svc Service, limit *rate.Limiter) ApiEndPoint
type Service ¶
type Service interface {
Api(ctx context.Context, in *proto.Request) (ack *proto.Response, err error) //RPC服务接口方法
}
func InitClient ¶
func NewGRPCClient ¶
func NewGRPCClient(conn *grpc.ClientConn) Service
func NewService ¶
func NewService() Service
Source Files ¶
Click to show internal directories.
Click to hide internal directories.