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 MakeDeleteEndpoint(s service.PostsService) endpoint.Endpoint
- func MakeListEndpoint(s service.PostsService) endpoint.Endpoint
- func MakeStoreEndpoint(s service.PostsService) endpoint.Endpoint
- func MakeUpdateEndpoint(s service.PostsService) endpoint.Endpoint
- type DeleteRequest
- type DeleteResponse
- type Endpoints
- func (e Endpoints) Delete(ctx context.Context, post model.Post) (response string, err error)
- func (e Endpoints) List(ctx context.Context, post model.Post) (response []*pb.Post, err error)
- func (e Endpoints) Store(ctx context.Context, post model.Post) (response string, err error)
- func (e Endpoints) Update(ctx context.Context, post model.Post) (response string, err error)
- type Failure
- type ListRequest
- type ListResponse
- type StoreRequest
- type StoreResponse
- type UpdateRequest
- type UpdateResponse
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 MakeDeleteEndpoint ¶
func MakeDeleteEndpoint(s service.PostsService) endpoint.Endpoint
MakeDeleteEndpoint returns an endpoint that invokes Delete on the service.
func MakeListEndpoint ¶
func MakeListEndpoint(s service.PostsService) endpoint.Endpoint
MakeListEndpoint returns an endpoint that invokes List on the service.
func MakeStoreEndpoint ¶
func MakeStoreEndpoint(s service.PostsService) endpoint.Endpoint
MakeStoreEndpoint returns an endpoint that invokes Store on the service.
func MakeUpdateEndpoint ¶
func MakeUpdateEndpoint(s service.PostsService) endpoint.Endpoint
MakeUpdateEndpoint returns an endpoint that invokes Update on the service.
Types ¶
type DeleteRequest ¶
DeleteRequest collects the request parameters for the Delete method.
type DeleteResponse ¶
DeleteResponse collects the response parameters for the Delete method.
type Endpoints ¶
type Endpoints struct { StoreEndpoint endpoint.Endpoint UpdateEndpoint endpoint.Endpoint ListEndpoint 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.PostsService, 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
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 ListRequest ¶
ListRequest collects the request parameters for the List method.
type ListResponse ¶
ListResponse collects the response parameters for the List method.
type StoreRequest ¶
StoreRequest collects the request parameters for the Store method.
type StoreResponse ¶
StoreResponse collects the response parameters for the Store method.
type UpdateRequest ¶
UpdateRequest collects the request parameters for the Update method.
type UpdateResponse ¶
UpdateResponse collects the response parameters for the Update method.