Documentation ¶
Index ¶
- Variables
- func DecodeLoginRequest(ctx context.Context, r interface{}) (interface{}, error)
- func EncodeLoginResponse(_ context.Context, r interface{}) (interface{}, error)
- func MakeUserEndpoint(svc UserService) endpoint.Endpoint
- func NewTokenBucketLimitterWithBuildIn(bkt *rate.Limiter) endpoint.Middleware
- func NewUserServer(ctx context.Context, endpoints Endpoints) pb.UserServiceServer
- type Endpoints
- type LoginForm
- type LoginResult
- type ServiceMiddleware
- type UserService
- type UserServiceImpl
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimitExceed = errors.New("Rate limit exceed!")
View Source
var (
ErrorBadRequest = errors.New("invalid request parameter")
)
Functions ¶
func DecodeLoginRequest ¶
解码请求体
func EncodeLoginResponse ¶
编码响应结果
func MakeUserEndpoint ¶
func MakeUserEndpoint(svc UserService) endpoint.Endpoint
func NewTokenBucketLimitterWithBuildIn ¶
func NewTokenBucketLimitterWithBuildIn(bkt *rate.Limiter) endpoint.Middleware
使用x/time/rate创建限流中间件
func NewUserServer ¶
func NewUserServer(ctx context.Context, endpoints Endpoints) pb.UserServiceServer
Types ¶
type LoginResult ¶
type UserService ¶
Click to show internal directories.
Click to hide internal directories.