Documentation ¶
Index ¶
- Variables
- func RegisterHelloServer(s grpc.ServiceRegistrar, srv HelloServer)
- type HelloClient
- type HelloServer
- type SayHiReply
- type SayHiRequest
- func (*SayHiRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SayHiRequest) GetAge() int32
- func (x *SayHiRequest) GetName() string
- func (*SayHiRequest) ProtoMessage()
- func (x *SayHiRequest) ProtoReflect() protoreflect.Message
- func (x *SayHiRequest) Reset()
- func (x *SayHiRequest) String() string
- type UnimplementedHelloServer
- type UnsafeHelloServer
Constants ¶
This section is empty.
Variables ¶
var File_hello_proto protoreflect.FileDescriptor
var Hello_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Hello", HandlerType: (*HelloServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHi", Handler: _Hello_SayHi_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "hello.proto", }
Hello_ServiceDesc is the grpc.ServiceDesc for Hello service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterHelloServer ¶
func RegisterHelloServer(s grpc.ServiceRegistrar, srv HelloServer)
Types ¶
type HelloClient ¶
type HelloClient interface {
SayHi(ctx context.Context, in *SayHiRequest, opts ...grpc.CallOption) (*SayHiReply, error)
}
HelloClient is the client API for Hello service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewHelloClient ¶
func NewHelloClient(cc grpc.ClientConnInterface) HelloClient
type HelloServer ¶
type HelloServer interface { SayHi(context.Context, *SayHiRequest) (*SayHiReply, error) // contains filtered or unexported methods }
HelloServer is the server API for Hello service. All implementations must embed UnimplementedHelloServer for forward compatibility
type SayHiReply ¶
type SayHiReply struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SayHiReply) Descriptor
deprecated
func (*SayHiReply) Descriptor() ([]byte, []int)
Deprecated: Use SayHiReply.ProtoReflect.Descriptor instead.
func (*SayHiReply) GetCode ¶
func (x *SayHiReply) GetCode() int32
func (*SayHiReply) GetMessage ¶
func (x *SayHiReply) GetMessage() string
func (*SayHiReply) ProtoMessage ¶
func (*SayHiReply) ProtoMessage()
func (*SayHiReply) ProtoReflect ¶
func (x *SayHiReply) ProtoReflect() protoreflect.Message
func (*SayHiReply) Reset ¶
func (x *SayHiReply) Reset()
func (*SayHiReply) String ¶
func (x *SayHiReply) String() string
type SayHiRequest ¶
type SayHiRequest 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"` // contains filtered or unexported fields }
func (*SayHiRequest) Descriptor
deprecated
func (*SayHiRequest) Descriptor() ([]byte, []int)
Deprecated: Use SayHiRequest.ProtoReflect.Descriptor instead.
func (*SayHiRequest) GetAge ¶
func (x *SayHiRequest) GetAge() int32
func (*SayHiRequest) GetName ¶
func (x *SayHiRequest) GetName() string
func (*SayHiRequest) ProtoMessage ¶
func (*SayHiRequest) ProtoMessage()
func (*SayHiRequest) ProtoReflect ¶
func (x *SayHiRequest) ProtoReflect() protoreflect.Message
func (*SayHiRequest) Reset ¶
func (x *SayHiRequest) Reset()
func (*SayHiRequest) String ¶
func (x *SayHiRequest) String() string
type UnimplementedHelloServer ¶
type UnimplementedHelloServer struct { }
UnimplementedHelloServer must be embedded to have forward compatible implementations.
func (UnimplementedHelloServer) SayHi ¶
func (UnimplementedHelloServer) SayHi(context.Context, *SayHiRequest) (*SayHiReply, error)
type UnsafeHelloServer ¶
type UnsafeHelloServer interface {
// contains filtered or unexported methods
}
UnsafeHelloServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HelloServer will result in compilation errors.