Documentation ¶
Index ¶
- Variables
- func MakeAddEndpoint(svc Service) endpoint.Endpoint
- func MakeGetAllEndpoint(svc Service) endpoint.Endpoint
- func MakeHTTPHandler(e EndpointSet, logger log.Logger) http.Handler
- func MakeUpdateEndpoint(svc Service) endpoint.Endpoint
- type EndpointSet
- type Player
- type Service
- type ServiceMiddleware
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingIds = errors.New("missing ids") ErrParsingIds = errors.New("error parsing ids, should be ints") )
View Source
var (
ErrPlayerDoesNotExist = errors.New("player does not exist")
)
Functions ¶
func MakeAddEndpoint ¶
func MakeGetAllEndpoint ¶
func MakeHTTPHandler ¶
func MakeHTTPHandler(e EndpointSet, logger log.Logger) http.Handler
func MakeUpdateEndpoint ¶
Types ¶
type EndpointSet ¶
type EndpointSet struct { GetAllEndpoint endpoint.Endpoint AddEndpoint endpoint.Endpoint UpdateEndpoint endpoint.Endpoint }
func MakeClientEndpoints ¶
func MakeClientEndpoints(instance string) (EndpointSet, error)
func MakeServerEndpoints ¶
func MakeServerEndpoints(svc Service) EndpointSet
type Service ¶
type Service interface { Add(ctx context.Context, name string) (Player, error) GetAll(ctx context.Context) ([]Player, error) Update(ctx context.Context, player Player) (Player, error) }
func NewService ¶
type ServiceMiddleware ¶
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) ServiceMiddleware
Click to show internal directories.
Click to hide internal directories.