Documentation
¶
Overview ¶
Package grpc_wrappers_testing provides a test service that could be used for the testing gRPC wrappers
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Service
- func (s *Service) TestBoolean(ctx context.Context, in *wrappers.BoolValue) (*wrappers.BoolValue, error)
- func (s *Service) TestDouble(ctx context.Context, in *wrappers.DoubleValue) (*wrappers.DoubleValue, error)
- func (s *Service) TestInteger(ctx context.Context, in *wrappers.Int64Value) (*wrappers.Int64Value, error)
- func (s *Service) TestStream(stream Service_TestStreamServer) error
- func (s *Service) TestString(ctx context.Context, in *wrappers.StringValue) (*wrappers.StringValue, error)
- func (s *Service) TestValue(ctx context.Context, in *_struct.Value) (*_struct.Value, error)
- type ServiceClient
- type ServiceServer
- type Service_TestStreamClient
- type Service_TestStreamServer
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) TestBoolean(context.Context, *wrapperspb.BoolValue) (*wrapperspb.BoolValue, error)
- func (UnimplementedServiceServer) TestDouble(context.Context, *wrapperspb.DoubleValue) (*wrapperspb.DoubleValue, error)
- func (UnimplementedServiceServer) TestInteger(context.Context, *wrapperspb.Int64Value) (*wrapperspb.Int64Value, error)
- func (UnimplementedServiceServer) TestStream(Service_TestStreamServer) error
- func (UnimplementedServiceServer) TestString(context.Context, *wrapperspb.StringValue) (*wrapperspb.StringValue, error)
- func (UnimplementedServiceServer) TestValue(context.Context, *structpb.Value) (*structpb.Value, error)
- type UnsafeServiceServer
Constants ¶
const ( Service_TestString_FullMethodName = "/grpc.wrappers.testing.Service/TestString" Service_TestInteger_FullMethodName = "/grpc.wrappers.testing.Service/TestInteger" Service_TestBoolean_FullMethodName = "/grpc.wrappers.testing.Service/TestBoolean" Service_TestDouble_FullMethodName = "/grpc.wrappers.testing.Service/TestDouble" Service_TestValue_FullMethodName = "/grpc.wrappers.testing.Service/TestValue" Service_TestStream_FullMethodName = "/grpc.wrappers.testing.Service/TestStream" )
Variables ¶
var File_test_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpc.wrappers.testing.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "TestString", Handler: _Service_TestString_Handler, }, { MethodName: "TestInteger", Handler: _Service_TestInteger_Handler, }, { MethodName: "TestBoolean", Handler: _Service_TestBoolean_Handler, }, { MethodName: "TestDouble", Handler: _Service_TestDouble_Handler, }, { MethodName: "TestValue", Handler: _Service_TestValue_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "TestStream", Handler: _Service_TestStream_Handler, ClientStreams: true, }, }, Metadata: "test.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type Service ¶ added in v0.58.0
type Service struct {
UnimplementedServiceServer
TestStringImplementation func(context.Context, *wrappers.StringValue) (*wrappers.StringValue, error)
TestIntegerImplementation func(context.Context, *wrappers.Int64Value) (*wrappers.Int64Value, error)
TestBooleanImplementation func(context.Context, *wrappers.BoolValue) (*wrappers.BoolValue, error)
TestDoubleImplementation func(context.Context, *wrappers.DoubleValue) (*wrappers.DoubleValue, error)
TestValueImplementation func(context.Context, *_struct.Value) (*_struct.Value, error)
TestStreamImplementation func(Service_TestStreamServer) error
}
Service is the test service for different grpc values and how they are handled
func Register ¶
func Register(r grpc.ServiceRegistrar) *Service
Register registers a test service that could be used for the testing gRPC wrappers
func (*Service) TestBoolean ¶ added in v0.58.0
func (s *Service) TestBoolean(ctx context.Context, in *wrappers.BoolValue) (*wrappers.BoolValue, error)
TestBoolean is getting and returning a boolean value
func (*Service) TestDouble ¶ added in v0.58.0
func (s *Service) TestDouble(ctx context.Context, in *wrappers.DoubleValue) (*wrappers.DoubleValue, error)
TestDouble is getting and returning a double value
func (*Service) TestInteger ¶ added in v0.58.0
func (s *Service) TestInteger(ctx context.Context, in *wrappers.Int64Value) (*wrappers.Int64Value, error)
TestInteger is getting and returning a integer value
func (*Service) TestStream ¶ added in v0.58.0
func (s *Service) TestStream(stream Service_TestStreamServer) error
TestStream is testing a stream of values
func (*Service) TestString ¶ added in v0.58.0
func (s *Service) TestString(ctx context.Context, in *wrappers.StringValue) (*wrappers.StringValue, error)
TestString is getting and returning a string value
type ServiceClient ¶
type ServiceClient interface {
TestString(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
TestInteger(ctx context.Context, in *wrapperspb.Int64Value, opts ...grpc.CallOption) (*wrapperspb.Int64Value, error)
TestBoolean(ctx context.Context, in *wrapperspb.BoolValue, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
TestDouble(ctx context.Context, in *wrapperspb.DoubleValue, opts ...grpc.CallOption) (*wrapperspb.DoubleValue, error)
TestValue(ctx context.Context, in *structpb.Value, opts ...grpc.CallOption) (*structpb.Value, error)
TestStream(ctx context.Context, opts ...grpc.CallOption) (Service_TestStreamClient, error)
}
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface {
TestString(context.Context, *wrapperspb.StringValue) (*wrapperspb.StringValue, error)
TestInteger(context.Context, *wrapperspb.Int64Value) (*wrapperspb.Int64Value, error)
TestBoolean(context.Context, *wrapperspb.BoolValue) (*wrapperspb.BoolValue, error)
TestDouble(context.Context, *wrapperspb.DoubleValue) (*wrapperspb.DoubleValue, error)
TestValue(context.Context, *structpb.Value) (*structpb.Value, error)
TestStream(Service_TestStreamServer) error
// contains filtered or unexported methods
}
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Service_TestStreamClient ¶
type Service_TestStreamClient interface {
Send(*wrapperspb.StringValue) error
CloseAndRecv() (*wrapperspb.StringValue, error)
grpc.ClientStream
}
type Service_TestStreamServer ¶
type Service_TestStreamServer interface {
SendAndClose(*wrapperspb.StringValue) error
Recv() (*wrapperspb.StringValue, error)
grpc.ServerStream
}
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct {
}
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) TestBoolean ¶
func (UnimplementedServiceServer) TestBoolean(context.Context, *wrapperspb.BoolValue) (*wrapperspb.BoolValue, error)
func (UnimplementedServiceServer) TestDouble ¶
func (UnimplementedServiceServer) TestDouble(context.Context, *wrapperspb.DoubleValue) (*wrapperspb.DoubleValue, error)
func (UnimplementedServiceServer) TestInteger ¶
func (UnimplementedServiceServer) TestInteger(context.Context, *wrapperspb.Int64Value) (*wrapperspb.Int64Value, error)
func (UnimplementedServiceServer) TestStream ¶
func (UnimplementedServiceServer) TestStream(Service_TestStreamServer) error
func (UnimplementedServiceServer) TestString ¶
func (UnimplementedServiceServer) TestString(context.Context, *wrapperspb.StringValue) (*wrapperspb.StringValue, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.