plugin

package
v1.833.332 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 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 plugin answers a family's address in this process.

A family service may run in the process that relays to it: its engine linked as a Go package (the zen and enso engines are their Rust core, translated by wasm2go, behind an http.Handler that runs the module and makes its upstream calls) and registered here under a name. The address plugin://<name> is then that handler, called directly: no socket, no second process. Every other address is the network's. The address is the only thing that differs, so the relay, the tells, billing, failover rows and attribution are the HTTP path's.

Index

Constants

View Source
const Scheme = "plugin"

Scheme is the address scheme a plugin answers at: plugin://zen is the handler registered as "zen".

Variables

This section is empty.

Functions

func Lookup

func Lookup(name string) http.Handler

Lookup is the handler registered as name, or nil.

func Register

func Register(name string, h http.Handler)

Register makes h answer plugin://<name>, in place of any it replaces. A family is registered once per process: one instance holds its key pool, lane health and sessions.

Types

type Transport

type Transport struct {
	// Head bounds how long the handler may take to begin its answer; zero is no
	// bound but the request's own context.
	Head time.Duration
}

Transport answers plugin:// requests in process, as an http.RoundTripper: the request is served by the registered handler, and its answer read back as the HTTP answer it would have been, its body as it is written and its trailers once the body ends. Register it on an http.Transport:

t.RegisterProtocol(plugin.Scheme, plugin.Transport{Head: t.ResponseHeaderTimeout})

func (Transport) RoundTrip

func (t Transport) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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