-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints.go
41 lines (34 loc) · 1022 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
41
// Code generated by goa v3.7.13, DO NOT EDIT.
//
// FooService endpoints
//
// Command:
// $ goa gen
// github.com/ernesto-jimenez/example-failing-goa-design/design/example -o .
package fooservice
import (
"context"
goa "goa.design/goa/v3/pkg"
)
// Endpoints wraps the "FooService" service endpoints.
type Endpoints struct {
FooMethod goa.Endpoint
}
// NewEndpoints wraps the methods of the "FooService" service with endpoints.
func NewEndpoints(s Service) *Endpoints {
return &Endpoints{
FooMethod: NewFooMethodEndpoint(s),
}
}
// Use applies the given middleware to all the "FooService" service endpoints.
func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) {
e.FooMethod = m(e.FooMethod)
}
// NewFooMethodEndpoint returns an endpoint function that calls the method
// "FooMethod" of service "FooService".
func NewFooMethodEndpoint(s Service) goa.Endpoint {
return func(ctx context.Context, req interface{}) (interface{}, error) {
p := req.(*FooMethodPayload)
return s.FooMethod(ctx, p)
}
}