Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

testing

v0.0.4
go.alis.build/testing

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

18 matches

Top ↑

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

Types

GrpcServiceTester

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

NewGrpcServiceTester

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

GrpcServiceTester.AddTestUserToCtx

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

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.

GrpcServiceTester.WithHost

func (t *GrpcServiceTester) WithHost(host Host)

GrpcServiceTester.WithTestUser

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

Host

type Host string

None (5 declarations)

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

TestServerTransportStream

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

TestServerTransportStream.Method

func (t *TestServerTransportStream) Method() string

TestServerTransportStream.SendHeader

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

TestServerTransportStream.SetHeader

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

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

TestServerTransportStream.SetTrailer

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

Dependency graph