Documentation ¶
Index ¶
- Variables
- func GetHelloName() string
- func RegisterHelloServer(s server.Server, srv HelloServer)
- type HelloClient
- type HelloReply
- func (*HelloReply) Descriptor() ([]byte, []int)deprecated
- func (x *HelloReply) GetMessage() string
- func (x *HelloReply) GetResult() *common.ResultResp
- func (*HelloReply) ProtoMessage()
- func (x *HelloReply) ProtoReflect() protoreflect.Message
- func (x *HelloReply) Reset()
- func (x *HelloReply) String() string
- type HelloRequest
- type HelloServer
- type UnimplementedHelloServer
Constants ¶
This section is empty.
Variables ¶
View Source
var File_example_hello_proto protoreflect.FileDescriptor
Functions ¶
func RegisterHelloServer ¶
func RegisterHelloServer(s server.Server, srv HelloServer)
Types ¶
type HelloClient ¶
type HelloClient interface { // 定义SayHello方法 SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) }
HelloClient is the client API for Hello service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func GetHelloClientByName ¶
func GetHelloClientByName(name string) HelloClient
GetHelloClientByName get client by custom name
func NewHelloClient ¶
func NewHelloClient(cc client.Client) HelloClient
type HelloReply ¶
type HelloReply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message"` // 消息 Result *common.ResultResp `protobuf:"bytes,2,opt,name=result,proto3" json:"result"` // 多proto 文件样例 // contains filtered or unexported fields }
HelloReply 响应结构
func (*HelloReply) Descriptor
deprecated
func (*HelloReply) Descriptor() ([]byte, []int)
Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.
func (*HelloReply) GetMessage ¶
func (x *HelloReply) GetMessage() string
func (*HelloReply) GetResult ¶
func (x *HelloReply) GetResult() *common.ResultResp
func (*HelloReply) ProtoMessage ¶
func (*HelloReply) ProtoMessage()
func (*HelloReply) ProtoReflect ¶
func (x *HelloReply) ProtoReflect() protoreflect.Message
func (*HelloReply) Reset ¶
func (x *HelloReply) Reset()
func (*HelloReply) String ¶
func (x *HelloReply) String() string
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` // 名字 // contains filtered or unexported fields }
HelloRequest 请求结构
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetName ¶
func (x *HelloRequest) GetName() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
type HelloServer ¶
type HelloServer interface { // 定义SayHello方法 SayHello(context.Context, *HelloRequest) (*HelloReply, error) }
HelloServer is the server API for Hello service.
type UnimplementedHelloServer ¶
type UnimplementedHelloServer struct { }
UnimplementedHelloServer can be embedded to have forward compatible implementations.
func (*UnimplementedHelloServer) SayHello ¶
func (*UnimplementedHelloServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error)
Click to show internal directories.
Click to hide internal directories.