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 MakeCreateEndpoint(s service.TransactionsService) endpoint.Endpoint
- func MakeDeleteAllEndpoint(s service.TransactionsService) endpoint.Endpoint
- func MakeGetEndpoint(s service.TransactionsService) endpoint.Endpoint
- type CreateRequest
- type CreateResponse
- type DeleteAllRequest
- type DeleteAllResponse
- type Endpoints
- type Failure
- type GetRequest
- type GetResponse
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 MakeCreateEndpoint ¶
func MakeCreateEndpoint(s service.TransactionsService) endpoint.Endpoint
MakeCreateEndpoint returns an endpoint that invokes Create on the service.
func MakeDeleteAllEndpoint ¶
func MakeDeleteAllEndpoint(s service.TransactionsService) endpoint.Endpoint
MakeDeleteAllEndpoint returns an endpoint that invokes DeleteAll on the service.
func MakeGetEndpoint ¶
func MakeGetEndpoint(s service.TransactionsService) endpoint.Endpoint
MakeGetEndpoint returns an endpoint that invokes Get on the service.
Types ¶
type CreateRequest ¶
type CreateRequest struct {
io.Transaction
}
CreateRequest collects the request parameters for the Create method.
type CreateResponse ¶
type CreateResponse io.Transaction
CreateResponse collects the response parameters for the Create method.
type DeleteAllResponse ¶
type DeleteAllResponse struct {
Error error `json:"error"`
}
DeleteAllResponse struct
type Endpoints ¶
type Endpoints struct { GetEndpoint endpoint.Endpoint CreateEndpoint endpoint.Endpoint DeleteAllEndpoint 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.TransactionsService, 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) Create ¶
func (e Endpoints) Create(ctx context.Context, transaction io.Transaction) (t CreateResponse, error error)
Create implements Service. Primarily useful in a client.
type Failure ¶
type Failure interface {
Failed() error
}
Failure 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 {
UUID string `json:"uuid"`
}
GetRequest collects the request parameters for the Get method.
type GetResponse ¶
type GetResponse []io.Transaction
GetResponse collects the response parameters for the Get method.