grpc_testing

package
v3.5.17 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcRecorder added in v3.5.1

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

func (*GrpcRecorder) RecordedRequests added in v3.5.1

func (ri *GrpcRecorder) RecordedRequests() []RequestInfo

func (*GrpcRecorder) UnaryInterceptor added in v3.5.1

func (ri *GrpcRecorder) UnaryInterceptor() grpc.UnaryServerInterceptor

type RequestInfo added in v3.5.1

type RequestInfo struct {
	FullMethod string
	Authority  string
}

type StubServer

type StubServer struct {

	// Network and Address are parameters for Listen. Defaults will be used if these are empty before Start.
	Network string
	Address string
	// contains filtered or unexported fields
}

StubServer is a server that is easy to customize within individual test cases.

func New

func New(testService testpb.TestServiceServer) *StubServer

func NewDummyStubServer

func NewDummyStubServer(body []byte) *StubServer

NewDummyStubServer creates a simple test server that serves Unary calls with responses with the given payload.

func (*StubServer) Addr

func (ss *StubServer) Addr() string

Addr gets the address the server listening on.

func (*StubServer) Start

func (ss *StubServer) Start(sopts []grpc.ServerOption, dopts ...grpc.DialOption) error

Start starts the server and creates a client connected to it.

func (*StubServer) Stop

func (ss *StubServer) Stop()

Stop stops ss and cleans up all resources it consumed.

Jump to

Keyboard shortcuts

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