1355 lines
33 KiB
Go
1355 lines
33 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: testpb/query.proto
|
|
|
|
package testdata
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
types "github.com/cosmos/cosmos-sdk/codec/types"
|
|
grpc1 "github.com/cosmos/gogoproto/grpc"
|
|
proto "github.com/cosmos/gogoproto/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"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type EchoRequest struct {
|
|
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
|
|
}
|
|
|
|
func (m *EchoRequest) Reset() { *m = EchoRequest{} }
|
|
func (m *EchoRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*EchoRequest) ProtoMessage() {}
|
|
func (*EchoRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b00998f1336963e3, []int{0}
|
|
}
|
|
func (m *EchoRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_EchoRequest.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 *EchoRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_EchoRequest.Merge(m, src)
|
|
}
|
|
func (m *EchoRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *EchoRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_EchoRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_EchoRequest proto.InternalMessageInfo
|
|
|
|
func (m *EchoRequest) GetMessage() string {
|
|
if m != nil {
|
|
return m.Message
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type EchoResponse struct {
|
|
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
|
|
}
|
|
|
|
func (m *EchoResponse) Reset() { *m = EchoResponse{} }
|
|
func (m *EchoResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*EchoResponse) ProtoMessage() {}
|
|
func (*EchoResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b00998f1336963e3, []int{1}
|
|
}
|
|
func (m *EchoResponse) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_EchoResponse.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 *EchoResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_EchoResponse.Merge(m, src)
|
|
}
|
|
func (m *EchoResponse) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *EchoResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_EchoResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_EchoResponse proto.InternalMessageInfo
|
|
|
|
func (m *EchoResponse) GetMessage() string {
|
|
if m != nil {
|
|
return m.Message
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type SayHelloRequest struct {
|
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
}
|
|
|
|
func (m *SayHelloRequest) Reset() { *m = SayHelloRequest{} }
|
|
func (m *SayHelloRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*SayHelloRequest) ProtoMessage() {}
|
|
func (*SayHelloRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b00998f1336963e3, []int{2}
|
|
}
|
|
func (m *SayHelloRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_SayHelloRequest.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 *SayHelloRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SayHelloRequest.Merge(m, src)
|
|
}
|
|
func (m *SayHelloRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *SayHelloRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SayHelloRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo
|
|
|
|
func (m *SayHelloRequest) GetName() string {
|
|
if m != nil {
|
|
return m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type SayHelloResponse struct {
|
|
Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"`
|
|
}
|
|
|
|
func (m *SayHelloResponse) Reset() { *m = SayHelloResponse{} }
|
|
func (m *SayHelloResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*SayHelloResponse) ProtoMessage() {}
|
|
func (*SayHelloResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b00998f1336963e3, []int{3}
|
|
}
|
|
func (m *SayHelloResponse) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_SayHelloResponse.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 *SayHelloResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_SayHelloResponse.Merge(m, src)
|
|
}
|
|
func (m *SayHelloResponse) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *SayHelloResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_SayHelloResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo
|
|
|
|
func (m *SayHelloResponse) GetGreeting() string {
|
|
if m != nil {
|
|
return m.Greeting
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type TestAnyRequest struct {
|
|
AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"`
|
|
}
|
|
|
|
func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} }
|
|
func (m *TestAnyRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*TestAnyRequest) ProtoMessage() {}
|
|
func (*TestAnyRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b00998f1336963e3, []int{4}
|
|
}
|
|
func (m *TestAnyRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TestAnyRequest.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 *TestAnyRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TestAnyRequest.Merge(m, src)
|
|
}
|
|
func (m *TestAnyRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TestAnyRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TestAnyRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo
|
|
|
|
func (m *TestAnyRequest) GetAnyAnimal() *types.Any {
|
|
if m != nil {
|
|
return m.AnyAnimal
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type TestAnyResponse struct {
|
|
HasAnimal *HasAnimal `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"`
|
|
}
|
|
|
|
func (m *TestAnyResponse) Reset() { *m = TestAnyResponse{} }
|
|
func (m *TestAnyResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*TestAnyResponse) ProtoMessage() {}
|
|
func (*TestAnyResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_b00998f1336963e3, []int{5}
|
|
}
|
|
func (m *TestAnyResponse) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *TestAnyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_TestAnyResponse.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 *TestAnyResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_TestAnyResponse.Merge(m, src)
|
|
}
|
|
func (m *TestAnyResponse) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *TestAnyResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_TestAnyResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_TestAnyResponse proto.InternalMessageInfo
|
|
|
|
func (m *TestAnyResponse) GetHasAnimal() *HasAnimal {
|
|
if m != nil {
|
|
return m.HasAnimal
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*EchoRequest)(nil), "testpb.EchoRequest")
|
|
proto.RegisterType((*EchoResponse)(nil), "testpb.EchoResponse")
|
|
proto.RegisterType((*SayHelloRequest)(nil), "testpb.SayHelloRequest")
|
|
proto.RegisterType((*SayHelloResponse)(nil), "testpb.SayHelloResponse")
|
|
proto.RegisterType((*TestAnyRequest)(nil), "testpb.TestAnyRequest")
|
|
proto.RegisterType((*TestAnyResponse)(nil), "testpb.TestAnyResponse")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("testpb/query.proto", fileDescriptor_b00998f1336963e3) }
|
|
|
|
var fileDescriptor_b00998f1336963e3 = []byte{
|
|
// 367 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x4f, 0x4f, 0xc2, 0x30,
|
|
0x18, 0xc6, 0x59, 0x82, 0xfc, 0x79, 0x31, 0xa2, 0x15, 0x05, 0x77, 0x58, 0xcc, 0x12, 0x23, 0x17,
|
|
0x3b, 0x85, 0x9b, 0x89, 0x07, 0x34, 0x24, 0x5c, 0x45, 0x4f, 0x5e, 0x4c, 0x07, 0x75, 0x5b, 0xdc,
|
|
0x5a, 0xa0, 0xdd, 0x61, 0xdf, 0xc2, 0x2f, 0xe3, 0x77, 0xf0, 0xc8, 0xd1, 0xa3, 0x81, 0x2f, 0x62,
|
|
0xb6, 0xb5, 0x53, 0x24, 0xf1, 0xd4, 0xf6, 0xe9, 0xef, 0x79, 0x9a, 0x3e, 0x79, 0x01, 0x49, 0x2a,
|
|
0xe4, 0xcc, 0x75, 0xe6, 0x31, 0x5d, 0x24, 0x78, 0xb6, 0xe0, 0x92, 0xa3, 0x4a, 0xae, 0x99, 0x27,
|
|
0x1e, 0xe7, 0x5e, 0x48, 0x9d, 0x4c, 0x75, 0xe3, 0x17, 0x87, 0x30, 0x85, 0x98, 0x47, 0xca, 0x96,
|
|
0x2e, 0x53, 0x22, 0x49, 0x2e, 0xdb, 0xe7, 0xd0, 0x18, 0x4e, 0x7c, 0x3e, 0xa6, 0xf3, 0x98, 0x0a,
|
|
0x89, 0x3a, 0x50, 0x8d, 0xa8, 0x10, 0xc4, 0xa3, 0x1d, 0xe3, 0xd4, 0xe8, 0xd6, 0xc7, 0xfa, 0x68,
|
|
0x77, 0x61, 0x37, 0x07, 0xc5, 0x8c, 0x33, 0x41, 0xff, 0x21, 0xcf, 0xa0, 0xf9, 0x40, 0x92, 0x11,
|
|
0x0d, 0xc3, 0x22, 0x16, 0x41, 0x99, 0x91, 0x48, 0x93, 0xd9, 0xde, 0xc6, 0xb0, 0xff, 0x83, 0xa9,
|
|
0x50, 0x13, 0x6a, 0xde, 0x82, 0x52, 0x19, 0x30, 0x4f, 0xb1, 0xc5, 0xd9, 0x1e, 0xc2, 0xde, 0x23,
|
|
0x15, 0x72, 0xc0, 0x12, 0x9d, 0xda, 0x07, 0x20, 0x2c, 0x79, 0x26, 0x2c, 0x88, 0x48, 0x98, 0xf1,
|
|
0x8d, 0x5e, 0x0b, 0xe7, 0x15, 0x60, 0x5d, 0x01, 0x4e, 0x0d, 0x75, 0xc2, 0x92, 0x41, 0x86, 0xd9,
|
|
0x77, 0xd0, 0x2c, 0x62, 0xd4, 0xab, 0x97, 0x00, 0x3e, 0x11, 0x9b, 0x39, 0x07, 0x38, 0xef, 0x0b,
|
|
0x8f, 0x88, 0xc8, 0x9d, 0xe3, 0xba, 0xaf, 0xb7, 0xbd, 0x77, 0x03, 0x76, 0xee, 0xd3, 0xfe, 0xd1,
|
|
0x15, 0x94, 0xd3, 0x5a, 0xd0, 0xa1, 0xe6, 0x7f, 0xb5, 0x69, 0xb6, 0x36, 0x45, 0xf5, 0xdc, 0x0d,
|
|
0xd4, 0xf4, 0xc7, 0x51, 0x5b, 0x13, 0x7f, 0x1a, 0x33, 0x3b, 0xdb, 0x17, 0xca, 0x7e, 0x0d, 0x55,
|
|
0xf5, 0x01, 0x74, 0xac, 0xa1, 0xcd, 0x62, 0xcc, 0xf6, 0x96, 0x9e, 0x7b, 0x6f, 0x47, 0x1f, 0x2b,
|
|
0xcb, 0x58, 0xae, 0x2c, 0xe3, 0x6b, 0x65, 0x19, 0x6f, 0x6b, 0xab, 0xb4, 0x5c, 0x5b, 0xa5, 0xcf,
|
|
0xb5, 0x55, 0x7a, 0xc2, 0x5e, 0x20, 0xfd, 0xd8, 0xc5, 0x13, 0x1e, 0x39, 0x13, 0x2e, 0x22, 0x2e,
|
|
0xd4, 0x72, 0x21, 0xa6, 0xaf, 0xd9, 0xd0, 0xc4, 0x32, 0x08, 0x8b, 0xe9, 0x71, 0x2b, 0x59, 0xbf,
|
|
0xfd, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x8d, 0x9a, 0xee, 0x8e, 0x02, 0x00, 0x00,
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
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.SupportPackageIsVersion4
|
|
|
|
// QueryClient is the client API for Query service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type QueryClient interface {
|
|
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
|
|
SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error)
|
|
TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error)
|
|
}
|
|
|
|
type queryClient struct {
|
|
cc grpc1.ClientConn
|
|
}
|
|
|
|
func NewQueryClient(cc grpc1.ClientConn) QueryClient {
|
|
return &queryClient{cc}
|
|
}
|
|
|
|
func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) {
|
|
out := new(EchoResponse)
|
|
err := c.cc.Invoke(ctx, "/testpb.Query/Echo", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) {
|
|
out := new(SayHelloResponse)
|
|
err := c.cc.Invoke(ctx, "/testpb.Query/SayHello", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) TestAny(ctx context.Context, in *TestAnyRequest, opts ...grpc.CallOption) (*TestAnyResponse, error) {
|
|
out := new(TestAnyResponse)
|
|
err := c.cc.Invoke(ctx, "/testpb.Query/TestAny", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// QueryServer is the server API for Query service.
|
|
type QueryServer interface {
|
|
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
|
|
SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
|
|
TestAny(context.Context, *TestAnyRequest) (*TestAnyResponse, error)
|
|
}
|
|
|
|
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedQueryServer struct {
|
|
}
|
|
|
|
func (*UnimplementedQueryServer) Echo(ctx context.Context, req *EchoRequest) (*EchoResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
|
|
}
|
|
func (*UnimplementedQueryServer) SayHello(ctx context.Context, req *SayHelloRequest) (*SayHelloResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
|
|
}
|
|
func (*UnimplementedQueryServer) TestAny(ctx context.Context, req *TestAnyRequest) (*TestAnyResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method TestAny not implemented")
|
|
}
|
|
|
|
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
|
s.RegisterService(&_Query_serviceDesc, srv)
|
|
}
|
|
|
|
func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(EchoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Echo(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/testpb.Query/Echo",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Echo(ctx, req.(*EchoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SayHelloRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).SayHello(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/testpb.Query/SayHello",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).SayHello(ctx, req.(*SayHelloRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_TestAny_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TestAnyRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).TestAny(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/testpb.Query/TestAny",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).TestAny(ctx, req.(*TestAnyRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var Query_serviceDesc = _Query_serviceDesc
|
|
var _Query_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "testpb.Query",
|
|
HandlerType: (*QueryServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Echo",
|
|
Handler: _Query_Echo_Handler,
|
|
},
|
|
{
|
|
MethodName: "SayHello",
|
|
Handler: _Query_SayHello_Handler,
|
|
},
|
|
{
|
|
MethodName: "TestAny",
|
|
Handler: _Query_TestAny_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "testpb/query.proto",
|
|
}
|
|
|
|
func (m *EchoRequest) 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 *EchoRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *EchoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Message) > 0 {
|
|
i -= len(m.Message)
|
|
copy(dAtA[i:], m.Message)
|
|
i = encodeVarintQuery(dAtA, i, uint64(len(m.Message)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *EchoResponse) 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 *EchoResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *EchoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Message) > 0 {
|
|
i -= len(m.Message)
|
|
copy(dAtA[i:], m.Message)
|
|
i = encodeVarintQuery(dAtA, i, uint64(len(m.Message)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *SayHelloRequest) 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 *SayHelloRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *SayHelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Name) > 0 {
|
|
i -= len(m.Name)
|
|
copy(dAtA[i:], m.Name)
|
|
i = encodeVarintQuery(dAtA, i, uint64(len(m.Name)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *SayHelloResponse) 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 *SayHelloResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *SayHelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Greeting) > 0 {
|
|
i -= len(m.Greeting)
|
|
copy(dAtA[i:], m.Greeting)
|
|
i = encodeVarintQuery(dAtA, i, uint64(len(m.Greeting)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *TestAnyRequest) 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 *TestAnyRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *TestAnyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.AnyAnimal != nil {
|
|
{
|
|
size, err := m.AnyAnimal.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintQuery(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *TestAnyResponse) 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 *TestAnyResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *TestAnyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.HasAnimal != nil {
|
|
{
|
|
size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintQuery(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovQuery(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *EchoRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Message)
|
|
if l > 0 {
|
|
n += 1 + l + sovQuery(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *EchoResponse) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Message)
|
|
if l > 0 {
|
|
n += 1 + l + sovQuery(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *SayHelloRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Name)
|
|
if l > 0 {
|
|
n += 1 + l + sovQuery(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *SayHelloResponse) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Greeting)
|
|
if l > 0 {
|
|
n += 1 + l + sovQuery(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *TestAnyRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.AnyAnimal != nil {
|
|
l = m.AnyAnimal.Size()
|
|
n += 1 + l + sovQuery(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *TestAnyResponse) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.HasAnimal != nil {
|
|
l = m.HasAnimal.Size()
|
|
n += 1 + l + sovQuery(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovQuery(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozQuery(x uint64) (n int) {
|
|
return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *EchoRequest) 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 ErrIntOverflowQuery
|
|
}
|
|
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: EchoRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: EchoRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowQuery
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Message = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *EchoResponse) 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 ErrIntOverflowQuery
|
|
}
|
|
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: EchoResponse: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: EchoResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowQuery
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Message = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *SayHelloRequest) 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 ErrIntOverflowQuery
|
|
}
|
|
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: SayHelloRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: SayHelloRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowQuery
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Name = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *SayHelloResponse) 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 ErrIntOverflowQuery
|
|
}
|
|
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: SayHelloResponse: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: SayHelloResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Greeting", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowQuery
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Greeting = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *TestAnyRequest) 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 ErrIntOverflowQuery
|
|
}
|
|
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: TestAnyRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TestAnyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AnyAnimal", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowQuery
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.AnyAnimal == nil {
|
|
m.AnyAnimal = &types.Any{}
|
|
}
|
|
if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *TestAnyResponse) 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 ErrIntOverflowQuery
|
|
}
|
|
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: TestAnyResponse: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: TestAnyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field HasAnimal", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowQuery
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.HasAnimal == nil {
|
|
m.HasAnimal = &HasAnimal{}
|
|
}
|
|
if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthQuery
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipQuery(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 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowQuery
|
|
}
|
|
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, ErrIntOverflowQuery
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 1:
|
|
iNdEx += 8
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowQuery
|
|
}
|
|
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, ErrInvalidLengthQuery
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupQuery
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthQuery
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
|
|
)
|