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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DealService

type DealService interface {
	// Add your methods here
	// e.x: Foo(ctx context.Context,s string)(rs string, err error)
	GetUserDealByState(ctx context.Context, id string, state string) (status bool, errinfo string, data []model.Deal)
	GetDealByDID(ctx context.Context, id string) (status bool, errinfo string, data model.Deal)
	GetDealByState(ctx context.Context, state string) (status bool, errinfo string, data []model.Deal)
	PostAcceptDeal(ctx context.Context, deal model.Deal) (status bool, errinfo string, data model.Deal)
	PutDealState(ctx context.Context, deal model.Deal) (status bool, errinfo string, data *model.Deal)
}

DealService describes the service.

func New

func New(middleware []Middleware) DealService

New returns a DealService with all of the expected middleware wired in.

func NewBasicDealService

func NewBasicDealService() DealService

NewBasicDealService returns a naive, stateless implementation of DealService.

type Middleware

type Middleware func(DealService) DealService

Middleware describes a service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a DealService Middleware.

Jump to

Keyboard shortcuts

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