Phase 1 to add the server interceptor

This commit is contained in:
iamqizhao
2016-04-18 16:18:34 -07:00
parent dec33edc37
commit 61e92eacc3
13 changed files with 414 additions and 278 deletions

View File

@ -1,12 +1,12 @@
// Code generated by protoc-gen-go.
// source: metrics.proto
// source: stress/grpc_testing/metrics.proto
// DO NOT EDIT!
/*
Package grpc_testing is a generated protocol buffer package.
It is generated from these files:
metrics.proto
stress/grpc_testing/metrics.proto
It has these top-level messages:
GaugeResponse
@ -53,13 +53,13 @@ type isGaugeResponse_Value interface {
}
type GaugeResponse_LongValue struct {
LongValue int64 `protobuf:"varint,2,opt,name=long_value,json=longValue,oneof"`
LongValue int64 `protobuf:"varint,2,opt,name=long_value,oneof"`
}
type GaugeResponse_DoubleValue struct {
DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,oneof"`
DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,oneof"`
}
type GaugeResponse_StringValue struct {
StringValue string `protobuf:"bytes,4,opt,name=string_value,json=stringValue,oneof"`
StringValue string `protobuf:"bytes,4,opt,name=string_value,oneof"`
}
func (*GaugeResponse_LongValue) isGaugeResponse_Value() {}
@ -203,7 +203,7 @@ var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion1
const _ = grpc.SupportPackageIsVersion2
// Client API for MetricsService service
@ -299,16 +299,22 @@ func (x *metricsServiceGetAllGaugesServer) Send(m *GaugeResponse) error {
return x.ServerStream.SendMsg(m)
}
func _MetricsService_GetGauge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
func _MetricsService_GetGauge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GaugeRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(MetricsServiceServer).GetGauge(ctx, in)
if err != nil {
return nil, err
if interceptor == nil {
return srv.(MetricsServiceServer).GetGauge(ctx, in)
}
return out, nil
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.testing.MetricsService/GetGauge",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MetricsServiceServer).GetGauge(ctx, req.(*GaugeRequest))
}
return interceptor(ctx, in, info, handler)
}
var _MetricsService_serviceDesc = grpc.ServiceDesc{
@ -330,21 +336,21 @@ var _MetricsService_serviceDesc = grpc.ServiceDesc{
}
var fileDescriptor0 = []byte{
// 253 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xcd, 0x4d, 0x2d, 0x29,
0xca, 0x4c, 0x2e, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x49, 0x2f, 0x2a, 0x48, 0xd6,
0x2b, 0x49, 0x2d, 0x2e, 0xc9, 0xcc, 0x4b, 0x57, 0x9a, 0xce, 0xc8, 0xc5, 0xeb, 0x9e, 0x58, 0x9a,
0x9e, 0x1a, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0x24, 0xc4, 0xc5, 0x92, 0x97, 0x98,
0x9b, 0x2a, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0x66, 0x0b, 0xc9, 0x73, 0x71, 0xe5, 0xe4,
0xe7, 0xa5, 0xc7, 0x97, 0x25, 0xe6, 0x94, 0xa6, 0x4a, 0x30, 0x01, 0x65, 0x98, 0x3d, 0x18, 0x82,
0x38, 0x41, 0x62, 0x61, 0x20, 0x21, 0x21, 0x65, 0x2e, 0x9e, 0x94, 0xfc, 0xd2, 0xa4, 0x9c, 0x54,
0xa8, 0x12, 0x66, 0xa0, 0x12, 0x46, 0xa0, 0x12, 0x6e, 0x88, 0x28, 0x5c, 0x51, 0x31, 0xd0, 0x25,
0x70, 0x73, 0x58, 0x40, 0x36, 0x80, 0x14, 0x41, 0x44, 0xc1, 0x8a, 0x9c, 0xd8, 0xb9, 0x58, 0xc1,
0xb2, 0x4a, 0x4a, 0x5c, 0x3c, 0x50, 0x87, 0x15, 0x96, 0x02, 0x1d, 0x8b, 0xcd, 0x5d, 0x4a, 0x7c,
0x5c, 0x3c, 0xae, 0xb9, 0x05, 0x25, 0x95, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x46, 0x0b,
0x18, 0xb9, 0xf8, 0x7c, 0x21, 0xbe, 0x0d, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x15, 0xf2, 0x04,
0x1a, 0x93, 0x5a, 0xe2, 0x98, 0x93, 0x03, 0x36, 0xac, 0x58, 0x48, 0x4a, 0x0f, 0xd9, 0xff, 0x7a,
0xc8, 0xda, 0xa5, 0xa4, 0x51, 0xe5, 0x50, 0xc2, 0xc5, 0x80, 0x51, 0xc8, 0x99, 0x8b, 0x03, 0x68,
0x14, 0x58, 0x14, 0xdd, 0x18, 0x64, 0x97, 0xe2, 0x35, 0x26, 0x89, 0x0d, 0x1c, 0x0b, 0xc6, 0x80,
0x00, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x7d, 0xb2, 0xc9, 0x96, 0x01, 0x00, 0x00,
// 242 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x90, 0xbd, 0x4e, 0xc3, 0x30,
0x14, 0x85, 0x6b, 0x5a, 0xfe, 0xae, 0x4c, 0x07, 0x0b, 0xa1, 0xaa, 0x30, 0x40, 0x26, 0xa6, 0x14,
0xc1, 0x13, 0x00, 0x42, 0x94, 0xa1, 0x0b, 0x3c, 0x40, 0x95, 0x86, 0x2b, 0xcb, 0x92, 0x63, 0x1b,
0x5f, 0xbb, 0x12, 0x6f, 0xc3, 0xa3, 0xe2, 0x3a, 0x11, 0x4a, 0x18, 0xba, 0x7e, 0x37, 0xf9, 0xce,
0x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