Documentation ¶
Index ¶
- Variables
- func RegisterGreeterGinServer(e *gin.Engine, server GreeterGinServer)
- func RegisterGreeterServer(s *grpc.Server, srv GreeterServer)
- type GreeterClient
- type GreeterGinServer
- type GreeterServer
- type Greeter_StreamHelloClient
- type Greeter_StreamHelloServer
- type HelloReply
- func (*HelloReply) Descriptor() ([]byte, []int)
- func (m *HelloReply) GetMessage() string
- func (m *HelloReply) GetSuccess() bool
- func (m *HelloReply) Marshal() (dAtA []byte, err error)
- func (m *HelloReply) MarshalTo(dAtA []byte) (int, error)
- func (m *HelloReply) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HelloReply) ProtoMessage()
- func (m *HelloReply) Reset()
- func (m *HelloReply) Size() (n int)
- func (m *HelloReply) String() string
- func (m *HelloReply) Unmarshal(dAtA []byte) error
- func (m *HelloReply) XXX_DiscardUnknown()
- func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HelloReply) XXX_Merge(src proto.Message)
- func (m *HelloReply) XXX_Size() int
- func (m *HelloReply) XXX_Unmarshal(b []byte) error
- type HelloRequest
- func (*HelloRequest) Descriptor() ([]byte, []int)
- func (m *HelloRequest) GetAge() int32
- func (m *HelloRequest) GetName() string
- func (m *HelloRequest) Marshal() (dAtA []byte, err error)
- func (m *HelloRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *HelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HelloRequest) ProtoMessage()
- func (m *HelloRequest) Reset()
- func (m *HelloRequest) Size() (n int)
- func (m *HelloRequest) String() string
- func (m *HelloRequest) Unmarshal(dAtA []byte) error
- func (m *HelloRequest) XXX_DiscardUnknown()
- func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HelloRequest) XXX_Merge(src proto.Message)
- func (m *HelloRequest) XXX_Size() int
- func (m *HelloRequest) XXX_Unmarshal(b []byte) error
- type UnimplementedGreeterServer
- type UserErrCode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UserNotExist = ecode.New(-404, "") UserUpdateNameFailed = ecode.New(10000, "") )
UserErrCode ecode
View Source
var ( ErrInvalidLengthHello = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowHello = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupHello = fmt.Errorf("proto: unexpected end of group") )
View Source
var PathGreeterSayHello = "/testproto.Greeter/SayHello"
View Source
var UserErrCode_name = map[int32]string{
0: "OK",
-404: "UserNotExist",
10000: "UserUpdateNameFailed",
}
View Source
var UserErrCode_value = map[string]int32{
"OK": 0,
"UserNotExist": -404,
"UserUpdateNameFailed": 10000,
}
Functions ¶
func RegisterGreeterGinServer ¶
func RegisterGreeterGinServer(e *gin.Engine, server GreeterGinServer)
RegisterGreeterGinServer Register the gin server route
func RegisterGreeterServer ¶
func RegisterGreeterServer(s *grpc.Server, srv GreeterServer)
Types ¶
type GreeterClient ¶
type GreeterClient interface { // Sends a greeting SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) // A bidirectional streaming RPC call recvice HelloRequest return HelloReply StreamHello(ctx context.Context, opts ...grpc.CallOption) (Greeter_StreamHelloClient, error) }
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.
func NewGreeterClient ¶
func NewGreeterClient(cc *grpc.ClientConn) GreeterClient
type GreeterGinServer ¶
type GreeterGinServer interface { // Sends a greeting SayHello(ctx context.Context, req *HelloRequest) (resp *HelloReply, err error) }
GreeterGinServer is the server API for Greeter service. The greeting service definition.
var GreeterSvc GreeterGinServer
type GreeterServer ¶
type GreeterServer interface { // Sends a greeting SayHello(context.Context, *HelloRequest) (*HelloReply, error) // A bidirectional streaming RPC call recvice HelloRequest return HelloReply StreamHello(Greeter_StreamHelloServer) error }
GreeterServer is the server API for Greeter service.
type Greeter_StreamHelloClient ¶
type Greeter_StreamHelloClient interface { Send(*HelloRequest) error Recv() (*HelloReply, error) grpc.ClientStream }
type Greeter_StreamHelloServer ¶
type Greeter_StreamHelloServer interface { Send(*HelloReply) error Recv() (*HelloRequest, error) grpc.ServerStream }
type HelloReply ¶
type HelloReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The response message containing the greetings
func (*HelloReply) Descriptor ¶
func (*HelloReply) Descriptor() ([]byte, []int)
func (*HelloReply) GetMessage ¶
func (m *HelloReply) GetMessage() string
func (*HelloReply) GetSuccess ¶
func (m *HelloReply) GetSuccess() bool
func (*HelloReply) Marshal ¶
func (m *HelloReply) Marshal() (dAtA []byte, err error)
func (*HelloReply) MarshalToSizedBuffer ¶
func (m *HelloReply) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HelloReply) ProtoMessage ¶
func (*HelloReply) ProtoMessage()
func (*HelloReply) Reset ¶
func (m *HelloReply) Reset()
func (*HelloReply) Size ¶
func (m *HelloReply) Size() (n int)
func (*HelloReply) String ¶
func (m *HelloReply) String() string
func (*HelloReply) Unmarshal ¶
func (m *HelloReply) Unmarshal(dAtA []byte) error
func (*HelloReply) XXX_DiscardUnknown ¶
func (m *HelloReply) XXX_DiscardUnknown()
func (*HelloReply) XXX_Marshal ¶
func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HelloReply) XXX_Merge ¶
func (m *HelloReply) XXX_Merge(src proto.Message)
func (*HelloReply) XXX_Size ¶
func (m *HelloReply) XXX_Size() int
func (*HelloReply) XXX_Unmarshal ¶
func (m *HelloReply) XXX_Unmarshal(b []byte) error
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The request message containing the user's name.
func (*HelloRequest) Descriptor ¶
func (*HelloRequest) Descriptor() ([]byte, []int)
func (*HelloRequest) GetAge ¶
func (m *HelloRequest) GetAge() int32
func (*HelloRequest) GetName ¶
func (m *HelloRequest) GetName() string
func (*HelloRequest) Marshal ¶
func (m *HelloRequest) Marshal() (dAtA []byte, err error)
func (*HelloRequest) MarshalToSizedBuffer ¶
func (m *HelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) Reset ¶
func (m *HelloRequest) Reset()
func (*HelloRequest) Size ¶
func (m *HelloRequest) Size() (n int)
func (*HelloRequest) String ¶
func (m *HelloRequest) String() string
func (*HelloRequest) Unmarshal ¶
func (m *HelloRequest) Unmarshal(dAtA []byte) error
func (*HelloRequest) XXX_DiscardUnknown ¶
func (m *HelloRequest) XXX_DiscardUnknown()
func (*HelloRequest) XXX_Marshal ¶
func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HelloRequest) XXX_Merge ¶
func (m *HelloRequest) XXX_Merge(src proto.Message)
func (*HelloRequest) XXX_Size ¶
func (m *HelloRequest) XXX_Size() int
func (*HelloRequest) XXX_Unmarshal ¶
func (m *HelloRequest) XXX_Unmarshal(b []byte) error
type UnimplementedGreeterServer ¶
type UnimplementedGreeterServer struct { }
UnimplementedGreeterServer can be embedded to have forward compatible implementations.
func (*UnimplementedGreeterServer) SayHello ¶
func (*UnimplementedGreeterServer) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error)
func (*UnimplementedGreeterServer) StreamHello ¶
func (*UnimplementedGreeterServer) StreamHello(srv Greeter_StreamHelloServer) error
type UserErrCode ¶
type UserErrCode int32
const ( UserErrCode_OK UserErrCode = 0 UserErrCode_UserNotExist UserErrCode = -404 UserErrCode_UserUpdateNameFailed UserErrCode = 10000 )
func (UserErrCode) EnumDescriptor ¶
func (UserErrCode) EnumDescriptor() ([]byte, []int)
func (UserErrCode) String ¶
func (x UserErrCode) String() string
Click to show internal directories.
Click to hide internal directories.