testbroker

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testbroker runs real go-plugin transports in-process for credential tests. It supplies sockets and process lifetime, never an agreement or a bound credential.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Identity

func Identity(t testing.TB, name string, clock timeutil.Clock) *tls.Config

Identity generates a fresh test-only identity under an isolated root. To connect two identities, configure each endpoint to trust only the other's root.

Types

type Config

type Config struct {
	Name      string
	Server    plugin.Plugin
	Client    plugin.Plugin
	PluginTLS *tls.Config
	HostTLS   *tls.Config
	NewServer func([]grpc.ServerOption) *grpc.Server
	Dial      []grpc.DialOption
}

Config describes both ends of a real go-plugin connection. Negative tests can substitute a peer, but cannot skip authentication or admission in the other peer.

type Pair

type Pair struct {
	RPC        *plugin.GRPCClient
	Address    net.Addr
	StopServer func()
	Close      func()
}

Pair owns an in-process Serve loop and its reattached client.

func Open

func Open(t testing.TB, cfg Config) *Pair

Open waits for the published address rather than guessing a port or sleeping. Cleanup joins Serve, the reattach runner and the host's go-plugin client workers.

Jump to

Keyboard shortcuts

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