Documentation
¶
Overview ¶
Package plugintest provides test helpers for exercising a plugin's Connect/Session against a real target, without depending on the core.
Index ¶
- func CredentialKindSupported(schema plugin.Schema, kind plugin.CredentialKind) bool
- func DirectTransport() plugin.NetTransport
- func HTTPTransport(baseURL string, rt http.RoundTripper) plugin.NetTransport
- func Projection(t testing.TB, p plugin.Plugin) plugin.Projection
- func RouteMap(routes []plugin.Route) map[string]plugin.Route
- func TransportFunc(dial func(ctx context.Context, network, addr string) (net.Conn, error)) plugin.NetTransport
- func ValidatePlugin(t testing.TB, p plugin.Plugin)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CredentialKindSupported ¶ added in v0.1.4
func CredentialKindSupported(schema plugin.Schema, kind plugin.CredentialKind) bool
CredentialKindSupported reports whether a schema has any credential_ref field that accepts kind.
func DirectTransport ¶
func DirectTransport() plugin.NetTransport
DirectTransport returns a plugin.NetTransport that dials targets directly, for driving a plugin Connect/Session in tests. It has no egress allow-list, so a test may reach any address it sets up.
func HTTPTransport ¶
func HTTPTransport(baseURL string, rt http.RoundTripper) plugin.NetTransport
HTTPTransport returns a plugin.NetTransport that offers an L7 client (base URL + RoundTripper), like the core's agent http_proxy mode, for testing a plugin's HTTP egress. DialContext (L4) is unavailable.
func Projection ¶ added in v0.1.4
Projection validates the plugin and returns its browser projection.
func TransportFunc ¶
func TransportFunc(dial func(ctx context.Context, network, addr string) (net.Conn, error)) plugin.NetTransport
TransportFunc returns a plugin.NetTransport whose DialContext delegates to dial — for exercising a plugin over a custom or agent-style transport in tests without standing up the core's tunnel registry.
Types ¶
This section is empty.