/
encode_decode.go
44 lines (38 loc) · 1.42 KB
/
encode_decode.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
42
43
44
// Code generated by goa v3.2.6, DO NOT EDIT.
//
// incidents go-kit HTTP client encoders and decoders
//
// Command:
// $ goa gen github.com/brittonhayes/citadel/design
package client
import (
"context"
"net/http"
"github.com/brittonhayes/citadel/gen/http/incidents/client"
kithttp "github.com/go-kit/kit/transport/http"
goahttp "goa.design/goa/v3/http"
)
// DecodeFindResponse returns a go-kit DecodeResponseFunc suitable for decoding
// incidents find responses.
func DecodeFindResponse(decoder func(*http.Response) goahttp.Decoder) kithttp.DecodeResponseFunc {
dec := client.DecodeFindResponse(decoder, false)
return func(ctx context.Context, resp *http.Response) (interface{}, error) {
return dec(resp)
}
}
// EncodeListAllRequest returns a go-kit EncodeRequestFunc suitable for
// encoding incidents list all requests.
func EncodeListAllRequest(encoder func(*http.Request) goahttp.Encoder) kithttp.EncodeRequestFunc {
enc := client.EncodeListAllRequest(encoder)
return func(_ context.Context, r *http.Request, v interface{}) error {
return enc(r, v)
}
}
// DecodeListAllResponse returns a go-kit DecodeResponseFunc suitable for
// decoding incidents list all responses.
func DecodeListAllResponse(decoder func(*http.Response) goahttp.Decoder) kithttp.DecodeResponseFunc {
dec := client.DecodeListAllResponse(decoder, false)
return func(ctx context.Context, resp *http.Response) (interface{}, error) {
return dec(resp)
}
}