Documentation ¶
Overview ¶
THIS FILE IS AUTO GENERATED BY GK-CLI DO NOT EDIT!!
Index ¶
- func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware
- func LoggingMiddleware(logger log.Logger) endpoint.Middleware
- func MakeAddEndpoint(s service.TodoService) endpoint.Endpoint
- func MakeDeleteEndpoint(s service.TodoService) endpoint.Endpoint
- func MakeGetEndpoint(s service.TodoService) endpoint.Endpoint
- func MakeRemoveCompleteEndpoint(s service.TodoService) endpoint.Endpoint
- func MakeSetCompleteEndpoint(s service.TodoService) endpoint.Endpoint
- type AddRequest
- type AddResponse
- type DeleteRequest
- type DeleteResponse
- type Endpoints
- func (e Endpoints) Add(ctx context.Context, todo io.Todo) (t io.Todo, error error)
- func (e Endpoints) Delete(ctx context.Context, id string) (error error)
- func (e Endpoints) Get(ctx context.Context) (t []io.Todo, error error)
- func (e Endpoints) RemoveComplete(ctx context.Context, id string) (error error)
- func (e Endpoints) SetComplete(ctx context.Context, id string) (error error)
- type Failure
- type GetRequest
- type GetResponse
- type RemoveCompleteRequest
- type RemoveCompleteResponse
- type SetCompleteRequest
- type SetCompleteResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstrumentingMiddleware ¶
func InstrumentingMiddleware(duration metrics.Histogram) endpoint.Middleware
InstrumentingMiddleware returns an endpoint middleware that records the duration of each invocation to the passed histogram. The middleware adds a single field: "success", which is "true" if no error is returned, and "false" otherwise.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) endpoint.Middleware
LoggingMiddleware returns an endpoint middleware that logs the duration of each invocation, and the resulting error, if any.
func MakeAddEndpoint ¶
func MakeAddEndpoint(s service.TodoService) endpoint.Endpoint
MakeAddEndpoint returns an endpoint that invokes Add on the service.
func MakeDeleteEndpoint ¶
func MakeDeleteEndpoint(s service.TodoService) endpoint.Endpoint
MakeDeleteEndpoint returns an endpoint that invokes Delete on the service.
func MakeGetEndpoint ¶
func MakeGetEndpoint(s service.TodoService) endpoint.Endpoint
MakeGetEndpoint returns an endpoint that invokes Get on the service.
func MakeRemoveCompleteEndpoint ¶
func MakeRemoveCompleteEndpoint(s service.TodoService) endpoint.Endpoint
MakeRemoveCompleteEndpoint returns an endpoint that invokes RemoveComplete on the service.
func MakeSetCompleteEndpoint ¶
func MakeSetCompleteEndpoint(s service.TodoService) endpoint.Endpoint
MakeSetCompleteEndpoint returns an endpoint that invokes SetComplete on the service.
Types ¶
type AddRequest ¶
AddRequest collects the request parameters for the Add method.
type AddResponse ¶
AddResponse collects the response parameters for the Add method.
type DeleteRequest ¶
type DeleteRequest struct {
Id string `json:"id"`
}
DeleteRequest collects the request parameters for the Delete method.
type DeleteResponse ¶
type DeleteResponse struct {
Error error `json:"error"`
}
DeleteResponse collects the response parameters for the Delete method.
type Endpoints ¶
type Endpoints struct { GetEndpoint endpoint.Endpoint AddEndpoint endpoint.Endpoint SetCompleteEndpoint endpoint.Endpoint RemoveCompleteEndpoint endpoint.Endpoint DeleteEndpoint endpoint.Endpoint }
Endpoints collects all of the endpoints that compose a profile service. It's meant to be used as a helper struct, to collect all of the endpoints into a single parameter.
func New ¶
func New(s service.TodoService, mdw map[string][]endpoint.Middleware) Endpoints
New returns a Endpoints struct that wraps the provided service, and wires in all of the expected endpoint middlewares
func (Endpoints) RemoveComplete ¶
RemoveComplete implements Service. Primarily useful in a client.
type Failure ¶
type Failure interface {
Failed() error
}
Failer is an interface that should be implemented by response types. Response encoders can check if responses are Failer, and if so they've failed, and if so encode them using a separate write path based on the error.
type GetRequest ¶
type GetRequest struct{}
GetRequest collects the request parameters for the Get method.
type GetResponse ¶
GetResponse collects the response parameters for the Get method.
type RemoveCompleteRequest ¶
type RemoveCompleteRequest struct {
Id string `json:"id"`
}
RemoveCompleteRequest collects the request parameters for the RemoveComplete method.
type RemoveCompleteResponse ¶
type RemoveCompleteResponse struct {
Error error `json:"error"`
}
RemoveCompleteResponse collects the response parameters for the RemoveComplete method.
func (RemoveCompleteResponse) Failed ¶
func (r RemoveCompleteResponse) Failed() error
Failed implements Failer.
type SetCompleteRequest ¶
type SetCompleteRequest struct {
Id string `json:"id"`
}
SetCompleteRequest collects the request parameters for the SetComplete method.
type SetCompleteResponse ¶
type SetCompleteResponse struct {
Error error `json:"error"`
}
SetCompleteResponse collects the response parameters for the SetComplete method.
func (SetCompleteResponse) Failed ¶
func (r SetCompleteResponse) Failed() error
Failed implements Failer.