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

package grpctesting

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

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.6.0 (latest)
Published
May 15, 2025
Platform
linux/amd64
Imports
9 packages
Last checked
now

Tools for package owners.