testing

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

# A simple unit and integration testing package

Documentation

Overview

Package testing is a simple package to help with testing gRPC services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcServiceTester

type GrpcServiceTester struct {
	// contains filtered or unexported fields
}

func NewGrpcServiceTester

func NewGrpcServiceTester(serverDescriptor *grpc.ServiceDesc, srv interface{}, unaryInterceptor grpc.UnaryServerInterceptor) *GrpcServiceTester

func (*GrpcServiceTester) AddTestUserToCtx

func (t *GrpcServiceTester) AddTestUserToCtx(ctx context.Context, outgoing bool) context.Context

func (*GrpcServiceTester) Test

func (t *GrpcServiceTester) Test(ctx context.Context, req proto.Message, resp proto.Message) (interface{}, error)

Test calls the service method for the given request and returns the response. resp is not the expected response but merely a means to unmarshal the response.

func (*GrpcServiceTester) WithHost

func (t *GrpcServiceTester) WithHost(host Host)

func (*GrpcServiceTester) WithTestUser

func (t *GrpcServiceTester) WithTestUser(id string, email string)

type Host

type Host string
const (
	None        Host = ""
	Lb          Host = "lb"
	InternalGw  Host = "internal-gw"
	ConsumersGw Host = "consumers-gw"
	Local8080   Host = "localhost:8080"
)

type TestServerTransportStream

type TestServerTransportStream struct {
	// contains filtered or unexported fields
}

func (*TestServerTransportStream) Method

func (t *TestServerTransportStream) Method() string

func (*TestServerTransportStream) SendHeader

func (t *TestServerTransportStream) SendHeader(metadata.MD) error

func (*TestServerTransportStream) SetHeader

SetHeader(md), SendHeader(md) and SetTrailer(md)

func (*TestServerTransportStream) SetTrailer

func (t *TestServerTransportStream) SetTrailer(metadata.MD) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL