Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyUsername = errors.New("empty username") ErrEmptyAvatar = errors.New("empty avatar") )
Functions ¶
func MakeCreateUserHandle ¶
func MakeCreateUserHandle(svc UserService) func(c *gin.Context)
func MakeGetUserHandle ¶
func MakeGetUserHandle(svc UserService) func(c *gin.Context)
func RegisterHTTPServer ¶
func RegisterHTTPServer(r *gin.Engine, svc UserService)
Types ¶
type CreateUserReply ¶
type CreateUserReply struct {
UID int `json:"uid"`
}
type CreateUserReq ¶
type GetUserReply ¶
type GetUserReq ¶
type GetUserReq struct {
UID int `json:"uid"`
}
type UserService ¶
type UserService interface { CreateUser(ctx context.Context, req *CreateUserReq) (*CreateUserReply, error) GetUser(ctx context.Context, req *GetUserReq) (*GetUserReply, error) }
UserService is a service for user. It should be implemented by the business logic layer. Inject it into the API layer.
Click to show internal directories.
Click to hide internal directories.