-
Notifications
You must be signed in to change notification settings - Fork 1
/
responses.go
executable file
·42 lines (33 loc) · 897 Bytes
/
responses.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
package endpoints
import (
"net/http"
httptransport "github.com/go-kit/kit/transport/http"
)
var (
_ httptransport.Headerer = (*SumResponse)(nil)
_ httptransport.StatusCoder = (*SumResponse)(nil)
_ httptransport.Headerer = (*ConcatResponse)(nil)
_ httptransport.StatusCoder = (*ConcatResponse)(nil)
)
// SumResponse collects the response values for the Sum method.
type SumResponse struct {
Rs int64 `json:"rs"`
Err error `json:"err"`
}
func (r SumResponse) StatusCode() int {
return http.StatusOK // TBA
}
func (r SumResponse) Headers() http.Header {
return http.Header{}
}
// ConcatResponse collects the response values for the Concat method.
type ConcatResponse struct {
Rs string `json:"rs"`
Err error `json:"err"`
}
func (r ConcatResponse) StatusCode() int {
return http.StatusOK // TBA
}
func (r ConcatResponse) Headers() http.Header {
return http.Header{}
}