v3go.etcd.io/etcd/pkg/v3/grpc_testing Index | Files

package grpc_testing

import "go.etcd.io/etcd/pkg/v3/grpc_testing"

Index

Types

type GrpcRecorder

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

func (*GrpcRecorder) RecordedRequests

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

func (*GrpcRecorder) UnaryInterceptor

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

type RequestInfo

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.

Source Files

recorder.go stub_server.go

Version
v3.5.18 (latest)
Published
Jan 24, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
6 days ago

Tools for package owners.