diff --git a/httpgrpc/httpgrpc.pb.go b/httpgrpc/httpgrpc.pb.go index 4b3f6ad9f..bab0efd53 100644 --- a/httpgrpc/httpgrpc.pb.go +++ b/httpgrpc/httpgrpc.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: httpgrpc/httpgrpc.proto +// source: httpgrpc.proto package httpgrpc @@ -40,7 +40,7 @@ type HTTPRequest struct { func (m *HTTPRequest) Reset() { *m = HTTPRequest{} } func (*HTTPRequest) ProtoMessage() {} func (*HTTPRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6670c8e151665986, []int{0} + return fileDescriptor_c50820dbc814fcdd, []int{0} } func (m *HTTPRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -106,7 +106,7 @@ type HTTPResponse struct { func (m *HTTPResponse) Reset() { *m = HTTPResponse{} } func (*HTTPResponse) ProtoMessage() {} func (*HTTPResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6670c8e151665986, []int{1} + return fileDescriptor_c50820dbc814fcdd, []int{1} } func (m *HTTPResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -164,7 +164,7 @@ type Header struct { func (m *Header) Reset() { *m = Header{} } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_6670c8e151665986, []int{2} + return fileDescriptor_c50820dbc814fcdd, []int{2} } func (m *Header) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -213,31 +213,29 @@ func init() { proto.RegisterType((*Header)(nil), "httpgrpc.Header") } -func init() { proto.RegisterFile("httpgrpc/httpgrpc.proto", fileDescriptor_6670c8e151665986) } +func init() { proto.RegisterFile("httpgrpc.proto", fileDescriptor_c50820dbc814fcdd) } -var fileDescriptor_6670c8e151665986 = []byte{ - // 322 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x3f, 0x4f, 0xc2, 0x40, - 0x14, 0xc0, 0x7b, 0x14, 0xab, 0x1c, 0x0c, 0xe4, 0xa2, 0xd8, 0x30, 0x5c, 0x08, 0x89, 0x09, 0x71, - 0xa0, 0x09, 0x4e, 0x8e, 0xea, 0xc2, 0xa6, 0xb9, 0x30, 0xb9, 0xb5, 0xf4, 0xa5, 0x35, 0x50, 0x5e, - 0x6d, 0xaf, 0x10, 0x36, 0x3f, 0x82, 0x1f, 0xc3, 0x8f, 0xe2, 0xc8, 0xc8, 0x28, 0xe5, 0x0b, 0xf8, - 0x11, 0xcc, 0x5d, 0x29, 0x36, 0x4e, 0x6e, 0xbf, 0xf7, 0x27, 0xf7, 0x7b, 0xef, 0x1e, 0xbd, 0x0c, - 0xa5, 0x8c, 0x83, 0x24, 0x9e, 0x3a, 0x25, 0x0c, 0xe3, 0x04, 0x25, 0xb2, 0xb3, 0x32, 0xee, 0x9e, - 0x07, 0x18, 0xa0, 0x4e, 0x3a, 0x8a, 0x8a, 0x7a, 0x7f, 0x45, 0x9b, 0xe3, 0xc9, 0xe4, 0x49, 0xc0, - 0x6b, 0x06, 0xa9, 0x64, 0x1d, 0x6a, 0x45, 0x20, 0x43, 0xf4, 0x6d, 0xd2, 0x23, 0x83, 0x86, 0x38, - 0x44, 0xac, 0x4d, 0xcd, 0x2c, 0x99, 0xdb, 0x35, 0x9d, 0x54, 0xc8, 0xae, 0xe9, 0x69, 0x08, 0xae, - 0x0f, 0x49, 0x6a, 0x9b, 0x3d, 0x73, 0xd0, 0x1c, 0xb5, 0x87, 0x47, 0xf5, 0x58, 0x17, 0x44, 0xd9, - 0xc0, 0x18, 0xad, 0x7b, 0xe8, 0xaf, 0xed, 0x7a, 0x8f, 0x0c, 0x5a, 0x42, 0x73, 0xdf, 0xa3, 0xad, - 0x42, 0x9c, 0xc6, 0xb8, 0x48, 0x41, 0xf5, 0x3c, 0xa0, 0x0f, 0xda, 0x7b, 0x22, 0x34, 0x57, 0x1d, - 0xb5, 0xff, 0x3a, 0xcc, 0x8a, 0x63, 0x44, 0xad, 0xa2, 0x4d, 0xcd, 0x3f, 0x83, 0xf5, 0x61, 0x29, - 0x85, 0x6a, 0xd3, 0xa5, 0x3b, 0xcf, 0xa0, 0x78, 0xba, 0x21, 0x0e, 0xd1, 0xe8, 0x8e, 0xd6, 0xd5, - 0x5c, 0xec, 0x96, 0x5a, 0x63, 0x77, 0xe1, 0xcf, 0x81, 0x5d, 0x54, 0xa4, 0xbf, 0x5f, 0xd5, 0xed, - 0xfc, 0x4d, 0x17, 0x8b, 0xf4, 0x8d, 0xfb, 0xc7, 0xed, 0x8e, 0x1b, 0xdf, 0x3b, 0x4e, 0xde, 0x72, - 0x4e, 0x3e, 0x72, 0x4e, 0x3e, 0x73, 0x4e, 0x36, 0x39, 0x27, 0x5f, 0x39, 0x27, 0xef, 0x7b, 0x6e, - 0x6c, 0xf6, 0xdc, 0xd8, 0xee, 0xb9, 0xf1, 0x7c, 0x15, 0xbc, 0xc8, 0x30, 0xf3, 0x86, 0x53, 0x8c, - 0x9c, 0x15, 0xb8, 0x4b, 0x58, 0x61, 0x32, 0x4b, 0x9d, 0x29, 0x46, 0x11, 0x2e, 0x8e, 0xa7, 0xf4, - 0x2c, 0x7d, 0xab, 0x9b, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xb5, 0xfe, 0x5d, 0xe6, 0x01, - 0x00, 0x00, +var fileDescriptor_c50820dbc814fcdd = []byte{ + // 301 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xbd, 0x4e, 0xc3, 0x30, + 0x14, 0x85, 0xed, 0xa6, 0x04, 0xea, 0x56, 0xa8, 0xb2, 0xa0, 0x8a, 0x3a, 0x5c, 0x55, 0x99, 0x22, + 0x86, 0x22, 0x05, 0x16, 0x46, 0x60, 0xc9, 0x88, 0xac, 0xbe, 0x40, 0x42, 0xac, 0x44, 0x22, 0xd4, + 0x21, 0x3f, 0xa0, 0x6e, 0x3c, 0x02, 0x8f, 0xc1, 0xa3, 0x30, 0x66, 0xec, 0x48, 0x9c, 0x85, 0xb1, + 0x8f, 0x80, 0xec, 0xa4, 0x10, 0x31, 0xb1, 0x9d, 0x7b, 0xee, 0x51, 0xbe, 0x7b, 0x62, 0x72, 0x1c, + 0x17, 0x45, 0x1a, 0x65, 0xe9, 0xfd, 0x32, 0xcd, 0x44, 0x21, 0xe8, 0xd1, 0x7e, 0x9e, 0x9f, 0x44, + 0x22, 0x12, 0xda, 0x3c, 0x57, 0xaa, 0xdd, 0xdb, 0x2f, 0x64, 0xec, 0xad, 0x56, 0x77, 0x8c, 0x3f, + 0x95, 0x3c, 0x2f, 0xe8, 0x8c, 0x98, 0x8f, 0xbc, 0x88, 0x45, 0x68, 0xe1, 0x05, 0x76, 0x46, 0xac, + 0x9b, 0xe8, 0x94, 0x18, 0x65, 0x96, 0x58, 0x03, 0x6d, 0x2a, 0x49, 0xcf, 0xc8, 0x61, 0xcc, 0xfd, + 0x90, 0x67, 0xb9, 0x65, 0x2c, 0x0c, 0x67, 0xec, 0x4e, 0x97, 0x3f, 0x68, 0x4f, 0x2f, 0xd8, 0x3e, + 0x40, 0x29, 0x19, 0x06, 0x22, 0xdc, 0x58, 0xc3, 0x05, 0x76, 0x26, 0x4c, 0x6b, 0x3b, 0x20, 0x93, + 0x16, 0x9c, 0xa7, 0x62, 0x9d, 0x73, 0x95, 0xb9, 0x15, 0x21, 0xd7, 0xdc, 0x03, 0xa6, 0x75, 0x9f, + 0x31, 0xf8, 0x2f, 0xc3, 0xe8, 0x31, 0x5c, 0x62, 0xb6, 0x31, 0x75, 0xff, 0x03, 0xdf, 0x74, 0xa5, + 0x94, 0x54, 0x4d, 0x9f, 0xfd, 0xa4, 0xe4, 0xed, 0xa7, 0x47, 0xac, 0x9b, 0xdc, 0x6b, 0x32, 0x54, + 0x77, 0xd1, 0x2b, 0x62, 0x7a, 0xfe, 0x3a, 0x4c, 0x38, 0x3d, 0xed, 0x41, 0x7f, 0x7f, 0xd5, 0x7c, + 0xf6, 0xd7, 0x6e, 0x8b, 0xd8, 0xe8, 0xe6, 0xb2, 0xaa, 0x01, 0x6d, 0x6b, 0x40, 0xbb, 0x1a, 0xf0, + 0xab, 0x04, 0xfc, 0x2e, 0x01, 0x7f, 0x48, 0xc0, 0x95, 0x04, 0xfc, 0x29, 0x01, 0x7f, 0x49, 0x40, + 0x3b, 0x09, 0xf8, 0xad, 0x01, 0x54, 0x35, 0x80, 0xb6, 0x0d, 0xa0, 0xc0, 0xd4, 0x0f, 0x72, 0xf1, + 0x1d, 0x00, 0x00, 0xff, 0xff, 0x44, 0x0e, 0x7c, 0xff, 0xc2, 0x01, 0x00, 0x00, } func (this *HTTPRequest) Equal(that interface{}) bool { @@ -471,7 +469,7 @@ var _HTTP_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "httpgrpc/httpgrpc.proto", + Metadata: "httpgrpc.proto", } func (m *HTTPRequest) Marshal() (dAtA []byte, err error) { @@ -1204,7 +1202,6 @@ func (m *Header) Unmarshal(dAtA []byte) error { func skipHttpgrpc(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 - depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1236,8 +1233,10 @@ func skipHttpgrpc(dAtA []byte) (n int, err error) { break } } + return iNdEx, nil case 1: iNdEx += 8 + return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1258,30 +1257,55 @@ func skipHttpgrpc(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthHttpgrpc } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthHttpgrpc + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupHttpgrpc + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHttpgrpc + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipHttpgrpc(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthHttpgrpc + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthHttpgrpc - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthHttpgrpc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHttpgrpc = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupHttpgrpc = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthHttpgrpc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHttpgrpc = fmt.Errorf("proto: integer overflow") ) diff --git a/httpgrpc/httpgrpc.proto b/httpgrpc/httpgrpc.proto index 0313dbb62..8f546330a 100644 --- a/httpgrpc/httpgrpc.proto +++ b/httpgrpc/httpgrpc.proto @@ -11,7 +11,6 @@ option (gogoproto.goproto_stringer_all) = false; option (gogoproto.goproto_unkeyed_all) = false; option (gogoproto.goproto_unrecognized_all) = false; option (gogoproto.goproto_sizecache_all) = false; -option go_package = "github.com/weaveworks/common/httpgrpc"; service HTTP { rpc Handle(HTTPRequest) returns (HTTPResponse) {}; diff --git a/middleware/middleware_test/echo_server.pb.go b/middleware/middleware_test/echo_server.pb.go index fff998871..ff6509352 100644 --- a/middleware/middleware_test/echo_server.pb.go +++ b/middleware/middleware_test/echo_server.pb.go @@ -1,16 +1,21 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: middleware/middleware_test/echo_server.proto +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: echo_server.proto package middleware_test import ( + bytes "bytes" context "context" fmt "fmt" - proto "github.com/golang/protobuf/proto" + proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. @@ -22,33 +27,37 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Msg struct { - Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` } -func (m *Msg) Reset() { *m = Msg{} } -func (m *Msg) String() string { return proto.CompactTextString(m) } -func (*Msg) ProtoMessage() {} +func (m *Msg) Reset() { *m = Msg{} } +func (*Msg) ProtoMessage() {} func (*Msg) Descriptor() ([]byte, []int) { - return fileDescriptor_812daae5e8bfec37, []int{0} + return fileDescriptor_f24ecbb5972b7a26, []int{0} } - func (m *Msg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Msg.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Msg.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_Msg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *Msg) XXX_Merge(src proto.Message) { xxx_messageInfo_Msg.Merge(m, src) } func (m *Msg) XXX_Size() int { - return xxx_messageInfo_Msg.Size(m) + return m.Size() } func (m *Msg) XXX_DiscardUnknown() { xxx_messageInfo_Msg.DiscardUnknown(m) @@ -67,23 +76,65 @@ func init() { proto.RegisterType((*Msg)(nil), "middleware.Msg") } -func init() { - proto.RegisterFile("middleware/middleware_test/echo_server.proto", fileDescriptor_812daae5e8bfec37) +func init() { proto.RegisterFile("echo_server.proto", fileDescriptor_f24ecbb5972b7a26) } + +var fileDescriptor_f24ecbb5972b7a26 = []byte{ + // 190 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4c, 0x4d, 0xce, 0xc8, + 0x8f, 0x2f, 0x4e, 0x2d, 0x2a, 0x4b, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xca, + 0xcd, 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0x55, 0x92, 0xe4, 0x62, 0xf6, 0x2d, 0x4e, + 0x17, 0x12, 0xe2, 0x62, 0x49, 0xca, 0x4f, 0xa9, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, + 0xb3, 0x8d, 0xec, 0xb9, 0xb8, 0x5c, 0x93, 0x33, 0xf2, 0x83, 0xc1, 0x5a, 0x85, 0x0c, 0xb9, 0xd8, + 0x03, 0x8a, 0xf2, 0x93, 0x53, 0x8b, 0x8b, 0x85, 0xf8, 0xf5, 0x10, 0x06, 0xe8, 0xf9, 0x16, 0xa7, + 0x4b, 0xa1, 0x0b, 0x28, 0x31, 0x68, 0x30, 0x1a, 0x30, 0x3a, 0xb9, 0x5e, 0x78, 0x28, 0xc7, 0x70, + 0xe3, 0xa1, 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, + 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, + 0x63, 0xf8, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, + 0x96, 0x63, 0x88, 0xe2, 0x47, 0x98, 0x15, 0x5f, 0x92, 0x5a, 0x5c, 0x92, 0xc4, 0x06, 0x76, 0xb5, + 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xce, 0xf1, 0x2d, 0xa4, 0xca, 0x00, 0x00, 0x00, } -var fileDescriptor_812daae5e8bfec37 = []byte{ - // 170 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xc9, 0xcd, 0x4c, 0x49, - 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x47, 0x30, 0xe3, 0x4b, 0x52, 0x8b, 0x4b, 0xf4, 0x53, - 0x93, 0x33, 0xf2, 0xe3, 0x8b, 0x53, 0x8b, 0xca, 0x52, 0x8b, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, - 0x85, 0xb8, 0x10, 0x4a, 0x94, 0x24, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x85, 0x84, 0xb8, 0x58, 0x92, - 0xf2, 0x53, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0x23, 0x7b, 0x2e, 0x2e, - 0xd7, 0xe4, 0x8c, 0xfc, 0x60, 0xb0, 0x56, 0x21, 0x43, 0x2e, 0xf6, 0x80, 0xa2, 0xfc, 0xe4, 0xd4, - 0xe2, 0x62, 0x21, 0x7e, 0x3d, 0x84, 0x01, 0x7a, 0xbe, 0xc5, 0xe9, 0x52, 0xe8, 0x02, 0x4a, 0x0c, - 0x1a, 0x8c, 0x06, 0x8c, 0x4e, 0x96, 0x51, 0xe6, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, - 0xf9, 0xb9, 0xfa, 0xe5, 0xa9, 0x89, 0x65, 0xa9, 0xe5, 0xf9, 0x45, 0xd9, 0xc5, 0xfa, 0xc9, 0xf9, - 0xb9, 0xb9, 0xf9, 0x79, 0xfa, 0xb8, 0x1d, 0x9d, 0xc4, 0x06, 0x76, 0xa9, 0x31, 0x20, 0x00, 0x00, - 0xff, 0xff, 0x5e, 0x2c, 0xc1, 0xca, 0xd9, 0x00, 0x00, 0x00, +func (this *Msg) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Msg) + if !ok { + that2, ok := that.(Msg) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Body, that1.Body) { + return false + } + return true +} +func (this *Msg) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&middleware_test.Msg{") + s = append(s, "Body: "+fmt.Sprintf("%#v", this.Body)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringEchoServer(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } // Reference imports to suppress errors if they are not otherwise used. @@ -195,5 +246,281 @@ var _EchoServer_serviceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "middleware/middleware_test/echo_server.proto", + Metadata: "echo_server.proto", +} + +func (m *Msg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Msg) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Msg) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Body) > 0 { + i -= len(m.Body) + copy(dAtA[i:], m.Body) + i = encodeVarintEchoServer(dAtA, i, uint64(len(m.Body))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } + +func encodeVarintEchoServer(dAtA []byte, offset int, v uint64) int { + offset -= sovEchoServer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Msg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Body) + if l > 0 { + n += 1 + l + sovEchoServer(uint64(l)) + } + return n +} + +func sovEchoServer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEchoServer(x uint64) (n int) { + return sovEchoServer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Msg) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Msg{`, + `Body:` + fmt.Sprintf("%v", this.Body) + `,`, + `}`, + }, "") + return s +} +func valueToStringEchoServer(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Msg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEchoServer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Msg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Msg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEchoServer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEchoServer + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEchoServer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Body = append(m.Body[:0], dAtA[iNdEx:postIndex]...) + if m.Body == nil { + m.Body = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEchoServer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEchoServer + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEchoServer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEchoServer(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEchoServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEchoServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEchoServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEchoServer + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthEchoServer + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEchoServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipEchoServer(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthEchoServer + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthEchoServer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEchoServer = fmt.Errorf("proto: integer overflow") +) diff --git a/middleware/middleware_test/echo_server.proto b/middleware/middleware_test/echo_server.proto index c495e87e8..4c0946d97 100644 --- a/middleware/middleware_test/echo_server.proto +++ b/middleware/middleware_test/echo_server.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package middleware; -option go_package = "github.com/weaveworks/common/middleware/middleware_test"; +option go_package = "middleware_test"; service EchoServer { rpc Process(stream Msg) returns (stream Msg) {}; diff --git a/server/fake_server.pb.go b/server/fake_server.pb.go index 4fafbb2f3..75ee6b0a1 100644 --- a/server/fake_server.pb.go +++ b/server/fake_server.pb.go @@ -1,17 +1,21 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: server/fake_server.proto +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: fake_server.proto package server import ( context "context" fmt "fmt" - proto "github.com/golang/protobuf/proto" + proto "github.com/gogo/protobuf/proto" empty "github.com/golang/protobuf/ptypes/empty" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. @@ -23,33 +27,37 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type FailWithHTTPErrorRequest struct { - Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` } -func (m *FailWithHTTPErrorRequest) Reset() { *m = FailWithHTTPErrorRequest{} } -func (m *FailWithHTTPErrorRequest) String() string { return proto.CompactTextString(m) } -func (*FailWithHTTPErrorRequest) ProtoMessage() {} +func (m *FailWithHTTPErrorRequest) Reset() { *m = FailWithHTTPErrorRequest{} } +func (*FailWithHTTPErrorRequest) ProtoMessage() {} func (*FailWithHTTPErrorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2267b95bf2c64cdc, []int{0} + return fileDescriptor_a932e7b7b9f5c118, []int{0} } - func (m *FailWithHTTPErrorRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FailWithHTTPErrorRequest.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *FailWithHTTPErrorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FailWithHTTPErrorRequest.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_FailWithHTTPErrorRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *FailWithHTTPErrorRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_FailWithHTTPErrorRequest.Merge(m, src) } func (m *FailWithHTTPErrorRequest) XXX_Size() int { - return xxx_messageInfo_FailWithHTTPErrorRequest.Size(m) + return m.Size() } func (m *FailWithHTTPErrorRequest) XXX_DiscardUnknown() { xxx_messageInfo_FailWithHTTPErrorRequest.DiscardUnknown(m) @@ -68,26 +76,70 @@ func init() { proto.RegisterType((*FailWithHTTPErrorRequest)(nil), "server.FailWithHTTPErrorRequest") } -func init() { proto.RegisterFile("server/fake_server.proto", fileDescriptor_2267b95bf2c64cdc) } - -var fileDescriptor_2267b95bf2c64cdc = []byte{ - // 246 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0x4e, 0x2d, 0x2a, - 0x4b, 0x2d, 0xd2, 0x4f, 0x4b, 0xcc, 0x4e, 0x8d, 0x87, 0xb0, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, - 0x85, 0xd8, 0x20, 0x3c, 0x29, 0xe9, 0xf4, 0xfc, 0xfc, 0xf4, 0x9c, 0x54, 0x7d, 0xb0, 0x68, 0x52, - 0x69, 0x9a, 0x7e, 0x6a, 0x6e, 0x41, 0x49, 0x25, 0x44, 0x91, 0x92, 0x1e, 0x97, 0x84, 0x5b, 0x62, - 0x66, 0x4e, 0x78, 0x66, 0x49, 0x86, 0x47, 0x48, 0x48, 0x80, 0x6b, 0x51, 0x51, 0x7e, 0x51, 0x50, - 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x90, 0x10, 0x17, 0x8b, 0x73, 0x7e, 0x4a, 0xaa, 0x04, 0xa3, - 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x98, 0x6d, 0x74, 0x9b, 0x89, 0x8b, 0xcb, 0x2d, 0x31, 0x3b, 0x35, - 0x18, 0x6c, 0xb6, 0x90, 0x35, 0x17, 0x7b, 0x70, 0x69, 0x72, 0x72, 0x6a, 0x6a, 0x8a, 0x90, 0x98, - 0x1e, 0xc4, 0x1e, 0x3d, 0x98, 0x3d, 0x7a, 0xae, 0x20, 0x7b, 0xa4, 0x70, 0x88, 0x2b, 0x31, 0x08, - 0x39, 0x72, 0xf1, 0xc2, 0xec, 0x06, 0xdb, 0x4b, 0x86, 0x11, 0xfe, 0x5c, 0x82, 0x18, 0xce, 0x17, - 0x52, 0xd0, 0x83, 0x86, 0x03, 0x2e, 0x9f, 0xe1, 0x31, 0xd0, 0x92, 0x8b, 0x35, 0x38, 0x27, 0x35, - 0xb5, 0x80, 0x2c, 0xef, 0x70, 0x07, 0x97, 0x14, 0xa5, 0x26, 0xe6, 0x92, 0x69, 0x80, 0x01, 0xa3, - 0x93, 0x6a, 0x94, 0x72, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x79, - 0x6a, 0x62, 0x59, 0x6a, 0x79, 0x7e, 0x51, 0x76, 0xb1, 0x7e, 0x72, 0x7e, 0x6e, 0x6e, 0x7e, 0x9e, - 0x3e, 0xc4, 0x5f, 0x49, 0x6c, 0x60, 0xad, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xcd, - 0xa4, 0xf9, 0xfc, 0x01, 0x00, 0x00, +func init() { proto.RegisterFile("fake_server.proto", fileDescriptor_a932e7b7b9f5c118) } + +var fileDescriptor_a932e7b7b9f5c118 = []byte{ + // 265 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4c, 0x4b, 0xcc, 0x4e, + 0x8d, 0x2f, 0x4e, 0x2d, 0x2a, 0x4b, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, + 0xf0, 0xa4, 0xa4, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xa2, 0x49, 0xa5, 0x69, 0xfa, + 0xa9, 0xb9, 0x05, 0x25, 0x95, 0x10, 0x45, 0x4a, 0x7a, 0x5c, 0x12, 0x6e, 0x89, 0x99, 0x39, 0xe1, + 0x99, 0x25, 0x19, 0x1e, 0x21, 0x21, 0x01, 0xae, 0x45, 0x45, 0xf9, 0x45, 0x41, 0xa9, 0x85, 0xa5, + 0xa9, 0xc5, 0x25, 0x42, 0x42, 0x5c, 0x2c, 0xce, 0xf9, 0x29, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, + 0xac, 0x41, 0x60, 0xb6, 0xd1, 0x6d, 0x26, 0x2e, 0x2e, 0xb7, 0xc4, 0xec, 0xd4, 0x60, 0xb0, 0xd9, + 0x42, 0xd6, 0x5c, 0xec, 0xc1, 0xa5, 0xc9, 0xc9, 0xa9, 0xa9, 0x29, 0x42, 0x62, 0x7a, 0x10, 0x7b, + 0xf4, 0x60, 0xf6, 0xe8, 0xb9, 0x82, 0xec, 0x91, 0xc2, 0x21, 0xae, 0xc4, 0x20, 0xe4, 0xc8, 0xc5, + 0x0b, 0xb3, 0x1b, 0x6c, 0x2f, 0x19, 0x46, 0xf8, 0x73, 0x09, 0x62, 0x38, 0x5f, 0x48, 0x41, 0x0f, + 0x1a, 0x0e, 0xb8, 0x7c, 0x86, 0xc7, 0x40, 0x4b, 0x2e, 0xd6, 0xe0, 0x9c, 0xd4, 0xd4, 0x02, 0xb2, + 0xbc, 0xc3, 0x1d, 0x5c, 0x52, 0x94, 0x9a, 0x98, 0x4b, 0xa6, 0x01, 0x06, 0x8c, 0x4e, 0x26, 0x17, + 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, + 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, + 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, + 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0x26, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x43, 0x2b, 0x71, 0x6d, 0x04, 0x02, 0x00, 0x00, +} + +func (this *FailWithHTTPErrorRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FailWithHTTPErrorRequest) + if !ok { + that2, ok := that.(FailWithHTTPErrorRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Code != that1.Code { + return false + } + return true +} +func (this *FailWithHTTPErrorRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&server.FailWithHTTPErrorRequest{") + s = append(s, "Code: "+fmt.Sprintf("%#v", this.Code)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringFakeServer(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } // Reference imports to suppress errors if they are not otherwise used. @@ -339,5 +391,263 @@ var _FakeServer_serviceDesc = grpc.ServiceDesc{ ServerStreams: true, }, }, - Metadata: "server/fake_server.proto", + Metadata: "fake_server.proto", +} + +func (m *FailWithHTTPErrorRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FailWithHTTPErrorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FailWithHTTPErrorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Code != 0 { + i = encodeVarintFakeServer(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintFakeServer(dAtA []byte, offset int, v uint64) int { + offset -= sovFakeServer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *FailWithHTTPErrorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovFakeServer(uint64(m.Code)) + } + return n +} + +func sovFakeServer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFakeServer(x uint64) (n int) { + return sovFakeServer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (this *FailWithHTTPErrorRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FailWithHTTPErrorRequest{`, + `Code:` + fmt.Sprintf("%v", this.Code) + `,`, + `}`, + }, "") + return s +} +func valueToStringFakeServer(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *FailWithHTTPErrorRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFakeServer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FailWithHTTPErrorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FailWithHTTPErrorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFakeServer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipFakeServer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthFakeServer + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthFakeServer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFakeServer(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFakeServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFakeServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFakeServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthFakeServer + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthFakeServer + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFakeServer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipFakeServer(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthFakeServer + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthFakeServer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFakeServer = fmt.Errorf("proto: integer overflow") +) diff --git a/server/fake_server.proto b/server/fake_server.proto index bbf39381a..248a6f244 100644 --- a/server/fake_server.proto +++ b/server/fake_server.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package server; -option go_package = "github.com/weaveworks/common/server"; - import "google/protobuf/empty.proto"; service FakeServer {