Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware func(UserService) UserService
Middleware describes a service middleware.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
LoggingMiddleware takes a logger as a dependency and returns a UserService Middleware.
type UserService ¶
type UserService interface { // Add your methods here // e.x: Foo(ctx context.Context,s string)(rs string, err error) GetSpec(ctx context.Context, id string) (status bool, errinfo string, data *model.User) GetAll(ctx context.Context, page, offset, limit int, orderby string) (status bool, errinfo string, data []model.User) GetUDF(ctx context.Context, name string, page, offset, limit int, orderby string) (status bool, errinfo string, data []model.User) Post(ctx context.Context, user model.User) (status bool, errinfo string, data *model.User) Patch(ctx context.Context, id string, user model.User) (status bool, errinfo string, data *model.User) Put(ctx context.Context, id string, user model.User) (status bool, errinfo string, data *model.User) Delete(ctx context.Context, id string) (status bool, errinfo string, data *model.User) }
UserService describes the service.
func New ¶
func New(middleware []Middleware) UserService
New returns a UserService with all of the expected middleware wired in.
func NewBasicUserService ¶
func NewBasicUserService() UserService
NewBasicUserService returns a naive, stateless implementation of UserService.
Click to show internal directories.
Click to hide internal directories.