Package list golang-github-go-kit-kit / 34e8d90
examples/addsvc: use improved FooToBar syntax Peter Bourgon 4 years ago
2 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
3838 endpoints.SumEndpoint,
3939 decodeGRPCSumRequest,
4040 encodeGRPCSumResponse,
41 append(options, grpctransport.ServerBefore(opentracing.FromGRPCRequest(tracer, "Sum", logger)))...,
41 append(options, grpctransport.ServerBefore(opentracing.GRPCToContext(tracer, "Sum", logger)))...,
4242 ),
4343 concat: grpctransport.NewServer(
4444 endpoints.ConcatEndpoint,
4545 decodeGRPCConcatRequest,
4646 encodeGRPCConcatResponse,
47 append(options, grpctransport.ServerBefore(opentracing.FromGRPCRequest(tracer, "Concat", logger)))...,
47 append(options, grpctransport.ServerBefore(opentracing.GRPCToContext(tracer, "Concat", logger)))...,
4848 ),
4949 }
5050 }
9090 encodeGRPCSumRequest,
9191 decodeGRPCSumResponse,
9292 pb.SumReply{},
93 grpctransport.ClientBefore(opentracing.ToGRPCRequest(tracer, logger)),
93 grpctransport.ClientBefore(opentracing.ContextToGRPC(tracer, logger)),
9494 ).Endpoint()
9595 sumEndpoint = opentracing.TraceClient(tracer, "Sum")(sumEndpoint)
9696 sumEndpoint = limiter(sumEndpoint)
111111 encodeGRPCConcatRequest,
112112 decodeGRPCConcatResponse,
113113 pb.ConcatReply{},
114 grpctransport.ClientBefore(opentracing.ToGRPCRequest(tracer, logger)),
114 grpctransport.ClientBefore(opentracing.ContextToGRPC(tracer, logger)),
115115 ).Endpoint()
116116 concatEndpoint = opentracing.TraceClient(tracer, "Concat")(concatEndpoint)
117117 concatEndpoint = limiter(concatEndpoint)
3737 endpoints.SumEndpoint,
3838 decodeHTTPSumRequest,
3939 encodeHTTPGenericResponse,
40 append(options, httptransport.ServerBefore(opentracing.FromHTTPRequest(tracer, "Sum", logger)))...,
40 append(options, httptransport.ServerBefore(opentracing.HTTPToContext(tracer, "Sum", logger)))...,
4141 ))
4242 m.Handle("/concat", httptransport.NewServer(
4343 endpoints.ConcatEndpoint,
4444 decodeHTTPConcatRequest,
4545 encodeHTTPGenericResponse,
46 append(options, httptransport.ServerBefore(opentracing.FromHTTPRequest(tracer, "Concat", logger)))...,
46 append(options, httptransport.ServerBefore(opentracing.HTTPToContext(tracer, "Concat", logger)))...,
4747 ))
4848 return m
4949 }
8080 copyURL(u, "/sum"),
8181 encodeHTTPGenericRequest,
8282 decodeHTTPSumResponse,
83 httptransport.ClientBefore(opentracing.ToHTTPRequest(tracer, logger)),
83 httptransport.ClientBefore(opentracing.ContextToHTTP(tracer, logger)),
8484 ).Endpoint()
8585 sumEndpoint = opentracing.TraceClient(tracer, "Sum")(sumEndpoint)
8686 sumEndpoint = limiter(sumEndpoint)
9999 copyURL(u, "/concat"),
100100 encodeHTTPGenericRequest,
101101 decodeHTTPConcatResponse,
102 httptransport.ClientBefore(opentracing.ToHTTPRequest(tracer, logger)),
102 httptransport.ClientBefore(opentracing.ContextToHTTP(tracer, logger)),
103103 ).Endpoint()
104104 concatEndpoint = opentracing.TraceClient(tracer, "Concat")(concatEndpoint)
105105 concatEndpoint = limiter(concatEndpoint)