centraltest

package
v0.159.8 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 19 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 centraltest gives a test a muster in front of a beekeeper serve: its call_tool forwards x_<server>_<tool> to the backend with the caller's bearer and wraps the result as muster does, its subscriptions/listen streams take the updates the test relays, and a muster binary that names its endpoint and prints a token.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Binary

func Binary(t *testing.T, endpoint, token string) (bin, tokenFile string)

Binary writes a muster binary for one person: `context show` names endpoint, `auth token` prints the token file's content. It returns the binary and the token file, which the test may rewrite.

Types

type Muster

type Muster struct {
	URL string
	// contains filtered or unexported fields
}

Muster is a test muster in front of the beekeeper serve at backend (its /mcp URL), registered as server.

func New

func New(t *testing.T, backend, server string) *Muster

New starts a test muster forwarding to backend.

func NewStalling added in v0.138.4

func NewStalling(t *testing.T, backend, server, method string) (*Muster, *http.Transport)

NewStalling starts a test muster over HTTP/2, as muster behind its ingress answers, whose first connection stalls: it takes the requests of the JSON-RPC method on it and never answers them, as a connection whose far end went away without a word; method "" stalls every request on it. Every other connection answers. It returns the muster and the transport that trusts it.

func (*Muster) Close

func (m *Muster) Close()

Close stops muster itself.

func (*Muster) Down

func (m *Muster) Down(down bool)

Down makes the backend unreachable behind muster (down) or reachable.

func (*Muster) Updated added in v0.150.0

func (m *Muster) Updated(uri string) int

Updated sends notifications/resources/updated of uri to every stream subscribed to it, as muster relays the backend's, and says how many it reached.

Jump to

Keyboard shortcuts

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