Documentation
¶
Index ¶
- func LoggingMiddleware(logger log.Logger) endpoint.Middleware
- func MakeConcatEndpoint(svc service.AddsvcService) (ep endpoint.Endpoint)
- func MakeSumEndpoint(svc service.AddsvcService) (ep endpoint.Endpoint)
- type ConcatRequest
- type ConcatResponse
- type Endpoints
- type Request
- type SumRequest
- type SumResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 MakeConcatEndpoint ¶
func MakeConcatEndpoint(svc service.AddsvcService) (ep endpoint.Endpoint)
MakeConcatEndpoint returns an endpoint that invokes Concat on the service. Primarily useful in a server.
func MakeSumEndpoint ¶
func MakeSumEndpoint(svc service.AddsvcService) (ep endpoint.Endpoint)
MakeSumEndpoint returns an endpoint that invokes Sum on the service. Primarily useful in a server.
Types ¶
type ConcatRequest ¶
ConcatRequest collects the request parameters for the Concat method.
type ConcatResponse ¶
ConcatResponse collects the response values for the Concat method.
func (ConcatResponse) Headers ¶
func (r ConcatResponse) Headers() http.Header
func (ConcatResponse) StatusCode ¶
func (r ConcatResponse) StatusCode() int
type Endpoints ¶
type Endpoints struct { SumEndpoint endpoint.Endpoint `json:""` ConcatEndpoint endpoint.Endpoint `json:""` }
Endpoints collects all of the endpoints that compose the addsvc 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(svc service.AddsvcService, logger log.Logger, otTracer stdopentracing.Tracer, zipkinTracer *stdzipkin.Tracer) (ep Endpoints)
New return a new instance of the endpoint that wraps the provided service.
type SumRequest ¶
SumRequest collects the request parameters for the Sum method.
type SumResponse ¶
SumResponse collects the response values for the Sum method.
func (SumResponse) Headers ¶
func (r SumResponse) Headers() http.Header
func (SumResponse) StatusCode ¶
func (r SumResponse) StatusCode() int