Documentation ¶
Index ¶
- Variables
- func MakeGetEndpoint(svc Service) endpoint.Endpoint
- func MakeHTTPHandler(e EndpointSet, logger log.Logger) http.Handler
- func MakeIncrementEndpoint(svc Service) endpoint.Endpoint
- func MakeSetEndpoint(svc Service) endpoint.Endpoint
- type EndpointSet
- type Service
- type ServiceMiddleware
- type Tickets
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingIds = errors.New("missing ids") ErrParsingIds = errors.New("error parsing ids, should be ints") )
Functions ¶
func MakeGetEndpoint ¶
func MakeHTTPHandler ¶
func MakeHTTPHandler(e EndpointSet, logger log.Logger) http.Handler
func MakeIncrementEndpoint ¶
func MakeSetEndpoint ¶
Types ¶
type EndpointSet ¶
type EndpointSet struct { GetEndpoint endpoint.Endpoint SetEndpoint endpoint.Endpoint IncrementEndpoint endpoint.Endpoint }
func MakeClientEndpoints ¶
func MakeClientEndpoints(instance string) (EndpointSet, error)
func MakeServerEndpoints ¶
func MakeServerEndpoints(svc Service) EndpointSet
type Service ¶
type Service interface { Get(ctx context.Context, ids ...int) ([]Tickets, error) Set(ctx context.Context, tickets ...Tickets) ([]Tickets, error) Increment(ctx context.Context, ids ...int) ([]Tickets, error) }
func NewService ¶
type ServiceMiddleware ¶
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) ServiceMiddleware
Click to show internal directories.
Click to hide internal directories.