connecttest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package connecttest serves single RPCs through a connect.Server so server interceptors can be tested without a transport.

Index

Constants

View Source
const Procedure = "/test.v1.TestService/Method"

Procedure is the procedure Serve registers and calls.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, call Call, interceptors ...connect.ServerInterceptor) error

Serve registers call.Handler on a connect.Server with the given interceptors and dispatches one RPC to it, as a transport would.

Types

type Call

type Call struct {
	// StreamType of the registered method; the zero value is unary.
	StreamType connect.StreamType
	// Header holds the request headers the client sent.
	Header map[string]string
	// Handler serves the RPC behind the interceptors.
	Handler connect.ServerFunc
}

Call describes the RPC that Serve dispatches.

Jump to

Keyboard shortcuts

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