Documentation ¶
Index ¶
- func LoadProtoset(path string) (protoreflect.FileDescriptor, error)
- type TestService
- func (TestService) EmptyCall(_ context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (TestService) FullDuplexCall(ss grpc.TestService_FullDuplexCallServer) error
- func (TestService) HalfDuplexCall(ss grpc.TestService_HalfDuplexCallServer) error
- func (TestService) StreamingInputCall(ss grpc.TestService_StreamingInputCallServer) error
- func (TestService) StreamingOutputCall(req *grpc.StreamingOutputCallRequest, ...) error
- func (TestService) UnaryCall(_ context.Context, req *grpc.SimpleRequest) (*grpc.SimpleResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadProtoset ¶
func LoadProtoset(path string) (protoreflect.FileDescriptor, error)
LoadProtoset loads the compiled protoset file at the given path. It returns the last file descriptor in the set. When generating a protoset for a single file, that file is always last (and its dependencies before it).
Types ¶
type TestService ¶
type TestService struct {
grpc.UnimplementedTestServiceServer
}
TestService is a very simple test service that just echos back request payloads
func (TestService) EmptyCall ¶
EmptyCall satisfies the grpc.TestServiceServer interface. It always succeeds.
func (TestService) FullDuplexCall ¶
func (TestService) FullDuplexCall(ss grpc.TestService_FullDuplexCallServer) error
FullDuplexCall satisfies the grpc.TestServiceServer interface. It only fails if the client cancels or disconnects (thus causing ss.Send to return an error). For each request message it receives, it sends back a response message with the same payload.
func (TestService) HalfDuplexCall ¶
func (TestService) HalfDuplexCall(ss grpc.TestService_HalfDuplexCallServer) error
HalfDuplexCall satisfies the grpc.TestServiceServer interface. It only fails if the client cancels or disconnects (thus causing ss.Send to return an error). For each request message it receives, it sends back a response message with the same payload. But since it is half-duplex, all of the request payloads are buffered and responses will only be sent after the request stream is half-closed.
func (TestService) StreamingInputCall ¶
func (TestService) StreamingInputCall(ss grpc.TestService_StreamingInputCallServer) error
StreamingInputCall satisfies the grpc.TestServiceServer interface. It always succeeds, sending back the total observed size of all request payloads.
func (TestService) StreamingOutputCall ¶
func (TestService) StreamingOutputCall(req *grpc.StreamingOutputCallRequest, ss grpc.TestService_StreamingOutputCallServer) error
StreamingOutputCall satisfies the grpc.TestServiceServer interface. It only fails if the client cancels or disconnects (thus causing ss.Send to return an error). It echoes a number of responses equal to the request's number of response parameters. The requested parameter details, however, ignored. The response payload is always an echo of the request payload.
func (TestService) UnaryCall ¶
func (TestService) UnaryCall(_ context.Context, req *grpc.SimpleRequest) (*grpc.SimpleResponse, error)
UnaryCall satisfies the grpc.TestServiceServer interface. It always succeeds, echoing back the payload present in the request.