/
endpoints.go
40 lines (33 loc) · 995 Bytes
/
endpoints.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Code generated by goa v2.2.6, DO NOT EDIT.
//
// health endpoints
//
// Command:
// $ goa gen goa.design/plugins/goakit/examples/fetcher/fetcher/design -o
// $(GOPATH)/src/goa.design/plugins/goakit/examples/fetcher/fetcher
package health
import (
"context"
"github.com/go-kit/kit/endpoint"
)
// Endpoints wraps the "health" service endpoints.
type Endpoints struct {
Show endpoint.Endpoint
}
// NewEndpoints wraps the methods of the "health" service with endpoints.
func NewEndpoints(s Service) *Endpoints {
return &Endpoints{
Show: NewShowEndpoint(s),
}
}
// Use applies the given middleware to all the "health" service endpoints.
func (e *Endpoints) Use(m func(endpoint.Endpoint) endpoint.Endpoint) {
e.Show = m(e.Show)
}
// NewShowEndpoint returns an endpoint function that calls the method "show" of
// service "health".
func NewShowEndpoint(s Service) endpoint.Endpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
return s.Show(ctx)
}
}