service

package
v0.0.0-...-4aec9fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 5 Imported by: 2

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.

Jump to

Keyboard shortcuts

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