Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_api_hello_proto protoreflect.FileDescriptor
var Greet_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.Greet", HandlerType: (*GreetServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _Greet_SayHello_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/hello.proto", }
Greet_ServiceDesc is the grpc.ServiceDesc for Greet service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func NewGreetHandler ¶
func NewGreetHandler(srv GreetHandler, route *gin.Engine)
func RegisterGreetServer ¶
func RegisterGreetServer(s grpc.ServiceRegistrar, srv GreetServer)
Types ¶
type GreetClient ¶
type GreetClient interface {
SayHello(ctx context.Context, in *SayHelloReq, opts ...grpc.CallOption) (*SayHelloRsp, error)
}
GreetClient is the client API for Greet 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 NewGreetClient ¶
func NewGreetClient(cc grpc.ClientConnInterface) GreetClient
type GreetHandler ¶
type GreetHandler interface {
SayHello(context.Context, *SayHelloReq) (*SayHelloRsp, error)
}
type GreetServer ¶
type GreetServer interface {
SayHello(context.Context, *SayHelloReq) (*SayHelloRsp, error)
}
GreetServer is the server API for Greet service. All implementations should embed UnimplementedGreetServer for forward compatibility
type SayHelloReq ¶
type SayHelloReq struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` // contains filtered or unexported fields }
func (*SayHelloReq) Descriptor
deprecated
func (*SayHelloReq) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloReq.ProtoReflect.Descriptor instead.
func (*SayHelloReq) GetName ¶
func (x *SayHelloReq) GetName() string
func (*SayHelloReq) ProtoMessage ¶
func (*SayHelloReq) ProtoMessage()
func (*SayHelloReq) ProtoReflect ¶
func (x *SayHelloReq) ProtoReflect() protoreflect.Message
func (*SayHelloReq) Reset ¶
func (x *SayHelloReq) Reset()
func (*SayHelloReq) String ¶
func (x *SayHelloReq) String() string
type SayHelloRsp ¶
type SayHelloRsp struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` // contains filtered or unexported fields }
func (*SayHelloRsp) Descriptor
deprecated
func (*SayHelloRsp) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloRsp.ProtoReflect.Descriptor instead.
func (*SayHelloRsp) GetName ¶
func (x *SayHelloRsp) GetName() string
func (*SayHelloRsp) ProtoMessage ¶
func (*SayHelloRsp) ProtoMessage()
func (*SayHelloRsp) ProtoReflect ¶
func (x *SayHelloRsp) ProtoReflect() protoreflect.Message
func (*SayHelloRsp) Reset ¶
func (x *SayHelloRsp) Reset()
func (*SayHelloRsp) String ¶
func (x *SayHelloRsp) String() string
type UnimplementedGreetServer ¶
type UnimplementedGreetServer struct { }
UnimplementedGreetServer should be embedded to have forward compatible implementations.
func (UnimplementedGreetServer) SayHello ¶
func (UnimplementedGreetServer) SayHello(context.Context, *SayHelloReq) (*SayHelloRsp, error)
type UnsafeGreetServer ¶
type UnsafeGreetServer interface {
// contains filtered or unexported methods
}
UnsafeGreetServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreetServer will result in compilation errors.