transport/grpc: renamed SetClientBefore to ClientBefore to be more consistent with transport/grpc.Server
Geoff Berger
7 years ago
38 | 38 |
addsvc.EncodeGRPCSumRequest,
|
39 | 39 |
addsvc.DecodeGRPCSumResponse,
|
40 | 40 |
pb.SumReply{},
|
41 | |
grpctransport.SetClientBefore(opentracing.FromGRPCRequest(tracer, "Sum", logger)),
|
|
41 |
grpctransport.ClientBefore(opentracing.FromGRPCRequest(tracer, "Sum", logger)),
|
42 | 42 |
).Endpoint()
|
43 | 43 |
sumEndpoint = opentracing.TraceClient(tracer, "Sum")(sumEndpoint)
|
44 | 44 |
sumEndpoint = limiter(sumEndpoint)
|
|
57 | 57 |
addsvc.EncodeGRPCConcatRequest,
|
58 | 58 |
addsvc.DecodeGRPCConcatResponse,
|
59 | 59 |
pb.ConcatReply{},
|
60 | |
grpctransport.SetClientBefore(opentracing.FromGRPCRequest(tracer, "Concat", logger)),
|
|
60 |
grpctransport.ClientBefore(opentracing.FromGRPCRequest(tracer, "Concat", logger)),
|
61 | 61 |
).Endpoint()
|
62 | 62 |
concatEndpoint = opentracing.TraceClient(tracer, "Concat")(concatEndpoint)
|
63 | 63 |
concatEndpoint = limiter(concatEndpoint)
|
63 | 63 |
// ClientOption sets an optional parameter for clients.
|
64 | 64 |
type ClientOption func(*Client)
|
65 | 65 |
|
66 | |
// SetClientBefore sets the RequestFuncs that are applied to the outgoing gRPC
|
|
66 |
// ClientBefore sets the RequestFuncs that are applied to the outgoing gRPC
|
67 | 67 |
// request before it's invoked.
|
68 | |
func SetClientBefore(before ...RequestFunc) ClientOption {
|
|
68 |
func ClientBefore(before ...RequestFunc) ClientOption {
|
69 | 69 |
return func(c *Client) { c.before = before }
|
70 | 70 |
}
|
71 | 71 |
|