Documentation ¶
Index ¶
- Variables
- func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)
- type EchoRequest
- type EchoResponse
- type SumRequest
- type SumResponse
- type TestServiceClient
- type TestServiceServer
- type TestService_DoubleEchoClient
- type TestService_DoubleEchoServer
- type UnimplementedTestServiceServer
- type UnsafeTestServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_test_service_proto protoreflect.FileDescriptor
var TestService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "test_service.TestService", HandlerType: (*TestServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _TestService_Echo_Handler, }, { MethodName: "Sum", Handler: _TestService_Sum_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "DoubleEcho", Handler: _TestService_DoubleEcho_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "test_service.proto", }
TestService_ServiceDesc is the grpc.ServiceDesc for TestService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTestServiceServer ¶
func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)
Types ¶
type EchoRequest ¶
type EchoRequest struct { Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` // contains filtered or unexported fields }
func (*EchoRequest) Descriptor
deprecated
func (*EchoRequest) Descriptor() ([]byte, []int)
Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.
func (*EchoRequest) GetPayload ¶
func (x *EchoRequest) GetPayload() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) ProtoReflect ¶
func (x *EchoRequest) ProtoReflect() protoreflect.Message
func (*EchoRequest) Reset ¶
func (x *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (x *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct { Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` // contains filtered or unexported fields }
func (*EchoResponse) Descriptor
deprecated
func (*EchoResponse) Descriptor() ([]byte, []int)
Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.
func (*EchoResponse) GetPayload ¶
func (x *EchoResponse) GetPayload() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) ProtoReflect ¶
func (x *EchoResponse) ProtoReflect() protoreflect.Message
func (*EchoResponse) Reset ¶
func (x *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (x *EchoResponse) String() string
type SumRequest ¶
type SumRequest struct { Values []int32 `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
func (*SumRequest) Descriptor
deprecated
func (*SumRequest) Descriptor() ([]byte, []int)
Deprecated: Use SumRequest.ProtoReflect.Descriptor instead.
func (*SumRequest) GetValues ¶
func (x *SumRequest) GetValues() []int32
func (*SumRequest) ProtoMessage ¶
func (*SumRequest) ProtoMessage()
func (*SumRequest) ProtoReflect ¶
func (x *SumRequest) ProtoReflect() protoreflect.Message
func (*SumRequest) Reset ¶
func (x *SumRequest) Reset()
func (*SumRequest) String ¶
func (x *SumRequest) String() string
type SumResponse ¶
type SumResponse struct { Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*SumResponse) Descriptor
deprecated
func (*SumResponse) Descriptor() ([]byte, []int)
Deprecated: Use SumResponse.ProtoReflect.Descriptor instead.
func (*SumResponse) GetValue ¶
func (x *SumResponse) GetValue() int32
func (*SumResponse) ProtoMessage ¶
func (*SumResponse) ProtoMessage()
func (*SumResponse) ProtoReflect ¶
func (x *SumResponse) ProtoReflect() protoreflect.Message
func (*SumResponse) Reset ¶
func (x *SumResponse) Reset()
func (*SumResponse) String ¶
func (x *SumResponse) String() string
type TestServiceClient ¶
type TestServiceClient interface { // The server returns the client message as-is. Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) // The server returns the sum of the input values. Sum(ctx context.Context, in *SumRequest, opts ...grpc.CallOption) (*SumResponse, error) // The server returns every message twice. DoubleEcho(ctx context.Context, opts ...grpc.CallOption) (TestService_DoubleEchoClient, error) }
TestServiceClient is the client API for TestService 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 NewTestServiceClient ¶
func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient
type TestServiceServer ¶
type TestServiceServer interface { // The server returns the client message as-is. Echo(context.Context, *EchoRequest) (*EchoResponse, error) // The server returns the sum of the input values. Sum(context.Context, *SumRequest) (*SumResponse, error) // The server returns every message twice. DoubleEcho(TestService_DoubleEchoServer) error // contains filtered or unexported methods }
TestServiceServer is the server API for TestService service. All implementations must embed UnimplementedTestServiceServer for forward compatibility
type TestService_DoubleEchoClient ¶
type TestService_DoubleEchoClient interface { Send(*EchoRequest) error Recv() (*EchoResponse, error) grpc.ClientStream }
type TestService_DoubleEchoServer ¶
type TestService_DoubleEchoServer interface { Send(*EchoResponse) error Recv() (*EchoRequest, error) grpc.ServerStream }
type UnimplementedTestServiceServer ¶
type UnimplementedTestServiceServer struct { }
UnimplementedTestServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTestServiceServer) DoubleEcho ¶
func (UnimplementedTestServiceServer) DoubleEcho(TestService_DoubleEchoServer) error
func (UnimplementedTestServiceServer) Echo ¶
func (UnimplementedTestServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error)
func (UnimplementedTestServiceServer) Sum ¶
func (UnimplementedTestServiceServer) Sum(context.Context, *SumRequest) (*SumResponse, error)
type UnsafeTestServiceServer ¶
type UnsafeTestServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestServiceServer will result in compilation errors.