Documentation
¶
Index ¶
Constants ¶
const ( DemoService_Hi_FullMethodName = "/demo.pb.DemoService/Hi" DemoService_Watch_FullMethodName = "/demo.pb.DemoService/Watch" )
Variables ¶
var DemoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "demo.pb.DemoService", HandlerType: (*DemoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Hi", Handler: _DemoService_Hi_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Watch", Handler: _DemoService_Watch_Handler, ServerStreams: true, }, }, Metadata: "demo/demo.proto", }
DemoService_ServiceDesc is the grpc.ServiceDesc for DemoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterDemoServiceServer ¶
func RegisterDemoServiceServer(s grpc.ServiceRegistrar, srv DemoServiceServer)
Types ¶
type DemoServiceClient ¶
type DemoServiceClient interface {
// Say hi to topic
Hi(ctx context.Context, in *demo.HiRequest, opts ...grpc.CallOption) (*demo.HiResponse, error)
// Watch topic message
Watch(ctx context.Context, in *demo.WatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[demo.WatchResponse], error)
}
DemoServiceClient is the client API for DemoService 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 NewDemoServiceClient ¶
func NewDemoServiceClient(cc grpc.ClientConnInterface) DemoServiceClient
type DemoServiceServer ¶
type DemoServiceServer interface {
// Say hi to topic
Hi(context.Context, *demo.HiRequest) (*demo.HiResponse, error)
// Watch topic message
Watch(*demo.WatchRequest, grpc.ServerStreamingServer[demo.WatchResponse]) error
}
DemoServiceServer is the server API for DemoService service. All implementations should embed UnimplementedDemoServiceServer for forward compatibility.
type DemoService_WatchClient ¶
type DemoService_WatchClient = grpc.ServerStreamingClient[demo.WatchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type DemoService_WatchServer ¶
type DemoService_WatchServer = grpc.ServerStreamingServer[demo.WatchResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type UnimplementedDemoServiceServer ¶
type UnimplementedDemoServiceServer struct{}
UnimplementedDemoServiceServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedDemoServiceServer) Hi ¶
func (UnimplementedDemoServiceServer) Hi(context.Context, *demo.HiRequest) (*demo.HiResponse, error)
func (UnimplementedDemoServiceServer) Watch ¶
func (UnimplementedDemoServiceServer) Watch(*demo.WatchRequest, grpc.ServerStreamingServer[demo.WatchResponse]) error
type UnsafeDemoServiceServer ¶
type UnsafeDemoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDemoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DemoServiceServer will result in compilation errors.
Source Files
¶
- demo_grpc.pb.go