Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCOption ¶
type GRPCOption func(*grpcOptions)
GRPCOption is a function that can be used to configure the gRPC server.
func WithDialOptions ¶
func WithDialOptions(opts ...grpc.DialOption) GRPCOption
WithDialOptions configures the gRPC client.
func WithServerOptions ¶
func WithServerOptions(opts ...grpc.ServerOption) GRPCOption
WithServerOptions configures the gRPC server.
func WithStreamFunc ¶
func WithStreamFunc(fn StreamFunc) GRPCOption
WithStreamFunc provides the implementation for the gRPC streaming method.
func WithUnaryFunc ¶
func WithUnaryFunc(fn UnaryFunc) GRPCOption
WithUnaryFunc provides the implementation for the gRPC unary method.
type GRPClient ¶
type GRPClient interface { GRPCMethod(context.Context, *Fields) (*Fields, error) GRPCStream(context.Context) (Stream, error) }
GRPClient is a test service gRPC client.
type HTTPClient ¶
HTTPClient is a test service HTTP client.
func SetupHTTP ¶
func SetupHTTP(t *testing.T, opts ...HTTPOption) (c HTTPClient, stop func())
SetupHTTP instantiates the test gRPC service with the given options. It returns a ready-to-use client and a function used to stop the server.
type HTTPOption ¶
type HTTPOption func(*httpOptions)
HTTPOption is a function that can be used to configure the HTTP server.
func WithHTTPFunc ¶
func WithHTTPFunc(fn UnaryFunc) HTTPOption
func WithHTTPMiddleware ¶
func WithHTTPMiddleware(fn ...func(http.Handler) http.Handler) HTTPOption
type Service ¶ added in v0.15.0
type Service struct { HTTPFunc UnaryFunc GRPCFunc UnaryFunc StreamFunc StreamFunc }
func (*Service) GrpcMethod ¶ added in v0.15.0
func (*Service) GrpcStream ¶ added in v0.15.0
Click to show internal directories.
Click to hide internal directories.