-
Notifications
You must be signed in to change notification settings - Fork 0
/
request.go
64 lines (49 loc) · 974 Bytes
/
request.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package grpcc
import (
"net/http"
"github.com/pubgo/lug/types"
"google.golang.org/grpc"
)
var _ types.Request = (*request)(nil)
type request struct {
ct string
opts []grpc.CallOption
method string
service string
req, reply interface{}
cc *grpc.ClientConn
invoker grpc.UnaryInvoker
streamer grpc.Streamer
desc *grpc.StreamDesc
header http.Header
}
func (r *request) Client() bool {
return true
}
func (r *request) Service() string {
return r.service
}
func (r *request) Method() string {
return r.method
}
func (r *request) Endpoint() string {
return r.method
}
func (r *request) ContentType() string {
return r.ct
}
func (r *request) Header() types.Header {
return r.header
}
func (r *request) Payload() interface{} {
return r.req
}
func (r *request) Body() ([]byte, error) {
return nil, nil
}
func (r *request) Codec() string {
return r.ct
}
func (r *request) Stream() bool {
return false
}