123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607 |
- // Code generated by protoc-gen-gogo. DO NOT EDIT.
- // source: app/service/live/grpc-demo/api/grpc/v1/api.proto
- package v1
- import proto "github.com/gogo/protobuf/proto"
- import fmt "fmt"
- import math "math"
- import _ "github.com/gogo/protobuf/gogoproto"
- import (
- context "golang.org/x/net/context"
- grpc "google.golang.org/grpc"
- )
- import io "io"
- // 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
- type GeeterReq struct {
- Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty" form:"uid" validate:"required"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *GeeterReq) Reset() { *m = GeeterReq{} }
- func (m *GeeterReq) String() string { return proto.CompactTextString(m) }
- func (*GeeterReq) ProtoMessage() {}
- func (*GeeterReq) Descriptor() ([]byte, []int) {
- return fileDescriptor_api_021c7d441ded66d0, []int{0}
- }
- func (m *GeeterReq) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *GeeterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GeeterReq.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (dst *GeeterReq) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GeeterReq.Merge(dst, src)
- }
- func (m *GeeterReq) XXX_Size() int {
- return m.Size()
- }
- func (m *GeeterReq) XXX_DiscardUnknown() {
- xxx_messageInfo_GeeterReq.DiscardUnknown(m)
- }
- var xxx_messageInfo_GeeterReq proto.InternalMessageInfo
- func (m *GeeterReq) GetUid() int32 {
- if m != nil {
- return m.Uid
- }
- return 0
- }
- type GreeterResp struct {
- Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *GreeterResp) Reset() { *m = GreeterResp{} }
- func (m *GreeterResp) String() string { return proto.CompactTextString(m) }
- func (*GreeterResp) ProtoMessage() {}
- func (*GreeterResp) Descriptor() ([]byte, []int) {
- return fileDescriptor_api_021c7d441ded66d0, []int{1}
- }
- func (m *GreeterResp) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *GreeterResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GreeterResp.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (dst *GreeterResp) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GreeterResp.Merge(dst, src)
- }
- func (m *GreeterResp) XXX_Size() int {
- return m.Size()
- }
- func (m *GreeterResp) XXX_DiscardUnknown() {
- xxx_messageInfo_GreeterResp.DiscardUnknown(m)
- }
- var xxx_messageInfo_GreeterResp proto.InternalMessageInfo
- func (m *GreeterResp) GetUid() int32 {
- if m != nil {
- return m.Uid
- }
- return 0
- }
- func init() {
- proto.RegisterType((*GeeterReq)(nil), "live.grpcdemo.v1.GeeterReq")
- proto.RegisterType((*GreeterResp)(nil), "live.grpcdemo.v1.GreeterResp")
- }
- // 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
- // GreeterClient is the client API for Greeter service.
- //
- // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
- type GreeterClient interface {
- // `method:"POST" internal:"true"`
- SayHelloInternal(ctx context.Context, in *GeeterReq, opts ...grpc.CallOption) (*GreeterResp, error)
- SayHello(ctx context.Context, in *GeeterReq, opts ...grpc.CallOption) (*GreeterResp, error)
- }
- type greeterClient struct {
- cc *grpc.ClientConn
- }
- func NewGreeterClient(cc *grpc.ClientConn) GreeterClient {
- return &greeterClient{cc}
- }
- func (c *greeterClient) SayHelloInternal(ctx context.Context, in *GeeterReq, opts ...grpc.CallOption) (*GreeterResp, error) {
- out := new(GreeterResp)
- err := c.cc.Invoke(ctx, "/live.grpcdemo.v1.Greeter/say_hello_internal", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *greeterClient) SayHello(ctx context.Context, in *GeeterReq, opts ...grpc.CallOption) (*GreeterResp, error) {
- out := new(GreeterResp)
- err := c.cc.Invoke(ctx, "/live.grpcdemo.v1.Greeter/say_hello", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- // GreeterServer is the server API for Greeter service.
- type GreeterServer interface {
- // `method:"POST" internal:"true"`
- SayHelloInternal(context.Context, *GeeterReq) (*GreeterResp, error)
- SayHello(context.Context, *GeeterReq) (*GreeterResp, error)
- }
- func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
- s.RegisterService(&_Greeter_serviceDesc, srv)
- }
- func _Greeter_SayHelloInternal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GeeterReq)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).SayHelloInternal(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/live.grpcdemo.v1.Greeter/SayHelloInternal",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).SayHelloInternal(ctx, req.(*GeeterReq))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GeeterReq)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).SayHello(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/live.grpcdemo.v1.Greeter/SayHello",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).SayHello(ctx, req.(*GeeterReq))
- }
- return interceptor(ctx, in, info, handler)
- }
- var _Greeter_serviceDesc = grpc.ServiceDesc{
- ServiceName: "live.grpcdemo.v1.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "say_hello_internal",
- Handler: _Greeter_SayHelloInternal_Handler,
- },
- {
- MethodName: "say_hello",
- Handler: _Greeter_SayHello_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "app/service/live/grpc-demo/api/grpc/v1/api.proto",
- }
- func (m *GeeterReq) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *GeeterReq) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Uid != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintApi(dAtA, i, uint64(m.Uid))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
- }
- func (m *GreeterResp) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *GreeterResp) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Uid != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintApi(dAtA, i, uint64(m.Uid))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
- }
- func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return offset + 1
- }
- func (m *GeeterReq) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Uid != 0 {
- n += 1 + sovApi(uint64(m.Uid))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
- }
- func (m *GreeterResp) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Uid != 0 {
- n += 1 + sovApi(uint64(m.Uid))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
- }
- func sovApi(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
- }
- func sozApi(x uint64) (n int) {
- return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
- }
- func (m *GeeterReq) 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 ErrIntOverflowApi
- }
- 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: GeeterReq: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GeeterReq: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
- }
- m.Uid = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowApi
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Uid |= (int32(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipApi(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthApi
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *GreeterResp) 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 ErrIntOverflowApi
- }
- 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: GreeterResp: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GreeterResp: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType)
- }
- m.Uid = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowApi
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Uid |= (int32(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipApi(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthApi
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func skipApi(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, ErrIntOverflowApi
- }
- 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, ErrIntOverflowApi
- }
- 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, ErrIntOverflowApi
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- iNdEx += length
- if length < 0 {
- return 0, ErrInvalidLengthApi
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowApi
- }
- 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 := skipApi(dAtA[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- }
- 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 (
- ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
- )
- func init() {
- proto.RegisterFile("app/service/live/grpc-demo/api/grpc/v1/api.proto", fileDescriptor_api_021c7d441ded66d0)
- }
- var fileDescriptor_api_021c7d441ded66d0 = []byte{
- // 271 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x90, 0x3d, 0x4e, 0xc3, 0x30,
- 0x18, 0x40, 0x65, 0x10, 0x54, 0x35, 0x4b, 0xe5, 0x09, 0x8a, 0x48, 0x2b, 0x4f, 0x5d, 0x6a, 0x13,
- 0x60, 0xea, 0x46, 0x97, 0xac, 0xa8, 0x23, 0x4b, 0xe5, 0x24, 0x5f, 0x53, 0x4b, 0x49, 0xed, 0x3a,
- 0xb6, 0x25, 0xee, 0xc3, 0x61, 0x18, 0x39, 0x41, 0x85, 0x32, 0x32, 0x72, 0x02, 0x64, 0x53, 0x55,
- 0x15, 0x62, 0x63, 0xfb, 0x9e, 0xfd, 0xf4, 0xfc, 0x83, 0x6f, 0x85, 0xd6, 0xbc, 0x05, 0xe3, 0x65,
- 0x01, 0xbc, 0x96, 0x1e, 0x78, 0x65, 0x74, 0x31, 0x2d, 0xa1, 0x51, 0x5c, 0x68, 0x19, 0x89, 0xfb,
- 0x34, 0xcc, 0x4c, 0x1b, 0x65, 0x15, 0x19, 0x04, 0x8b, 0x85, 0xf5, 0x20, 0x31, 0x9f, 0x0e, 0xa7,
- 0x95, 0xb4, 0x6b, 0x97, 0xb3, 0x42, 0x35, 0xbc, 0x52, 0x95, 0xe2, 0x51, 0xcc, 0xdd, 0x2a, 0x52,
- 0x84, 0x38, 0xfd, 0x04, 0xe8, 0x23, 0xee, 0x67, 0x00, 0x16, 0xcc, 0x02, 0xb6, 0xe4, 0x01, 0x9f,
- 0x3a, 0x59, 0x5e, 0xa2, 0x31, 0x9a, 0x9c, 0xcd, 0xe9, 0xd7, 0x6e, 0x94, 0xac, 0x94, 0x69, 0x66,
- 0xd4, 0xc9, 0x92, 0x8e, 0xbd, 0xa8, 0x65, 0x29, 0x2c, 0xcc, 0xa8, 0x81, 0xad, 0x93, 0x06, 0x4a,
- 0xba, 0x08, 0x3a, 0x9d, 0xe0, 0x8b, 0xcc, 0xec, 0x1b, 0xad, 0x26, 0x57, 0xc7, 0x91, 0xde, 0xe7,
- 0x6e, 0x14, 0x30, 0x9a, 0x77, 0xaf, 0x08, 0xf7, 0xf6, 0x2a, 0x79, 0xc2, 0xa4, 0x15, 0x2f, 0xcb,
- 0x35, 0xd4, 0xb5, 0x5a, 0xca, 0x8d, 0x05, 0xb3, 0x11, 0x35, 0xb9, 0x66, 0xbf, 0x1f, 0xc4, 0x0e,
- 0xd7, 0x1b, 0xde, 0xfc, 0xb1, 0x79, 0x74, 0x70, 0x86, 0xfb, 0x87, 0xe2, 0x7f, 0x42, 0xf3, 0xc1,
- 0x5b, 0x97, 0xa0, 0xf7, 0x2e, 0x41, 0x1f, 0x5d, 0x82, 0x9e, 0x4f, 0x7c, 0x9a, 0x9f, 0xc7, 0xcf,
- 0xba, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xee, 0x9e, 0xe9, 0xa1, 0x01, 0x00, 0x00,
- }
|