/
client.go
41 lines (35 loc) · 928 Bytes
/
client.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 v2.2.4, DO NOT EDIT.
//
// sommelier client
//
// Command:
// $ goa gen goa.design/examples/cellar/design -o
// $(GOPATH)/src/goa.design/examples/cellar
package sommelier
import (
"context"
"goa.design/goa"
)
// Client is the "sommelier" service client.
type Client struct {
PickEndpoint goa.Endpoint
}
// NewClient initializes a "sommelier" service client given the endpoints.
func NewClient(pick goa.Endpoint) *Client {
return &Client{
PickEndpoint: pick,
}
}
// Pick calls the "pick" endpoint of the "sommelier" service.
// Pick may return the following errors:
// - "no_criteria" (type NoCriteria)
// - "no_match" (type NoMatch)
// - error: internal error
func (c *Client) Pick(ctx context.Context, p *Criteria) (res StoredBottleCollection, err error) {
var ires interface{}
ires, err = c.PickEndpoint(ctx, p)
if err != nil {
return
}
return ires.(StoredBottleCollection), nil
}