bridge

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 7 Imported by: ? 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.

README

Ext transport bridges

bridge.Open turns a verified backend Session into an Endpoint that another transport can serve. It preserves the Ext domain contract while translating connection mechanics. Go, C, Rust, Zig and TypeScript implementations coexist.

See interoperability for ownership, authorization, route planning, HashiCorp launch configuration, examples and conformance coverage. ext bridge --config <path> is the command entry point: Ext JSON lines ↔ HashiCorp gRPC/net/rpc. No full engine migration is required.

Documentation

Overview

Package bridge exposes a verified Ext backend as a Ext endpoint. It changes transport, not domain meaning. Both sides retain their own admission policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeJSONLine

func ServeJSONLine(ctx context.Context, conn io.ReadWriteCloser, relay *Relay) error

ServeJSONLine owns relay and conn. It monitors connection EOF while an invocation is running, so a disconnected host cancels upstream work too. Conn.Close must unblock Read and Write. Read-ahead is bounded by io.Copy's buffer and the pipe; this is not an unbounded request queue.

Types

type Relay

type Relay struct {
	// contains filtered or unexported fields
}

func New

func New(session Session) (*Relay, error)

New takes ownership of a ready, policy-enforcing session. This permits engine bindings to provide shared mechanics without nesting a second Go Session.

func (*Relay) Close

func (r *Relay) Close() error

Close aborts upstream I/O and releases the backend exactly once. The serving frontend must call it on EOF, transport error and cancellation.

func (*Relay) Drain

func (r *Relay) Drain(ctx context.Context) error

Drain stops admission and waits for admitted calls, using Session semantics.

func (*Relay) Handshake

func (r *Relay) Handshake(ctx context.Context) (plugin.Descriptor, error)

func (*Relay) Invoke

func (r *Relay) Invoke(ctx context.Context, request plugin.Request) (plugin.Response, error)

type Session

type Session interface {
	State() plugin.State
	Descriptor() plugin.Descriptor
	Call(context.Context, plugin.ContractRef, string, json.RawMessage) (json.RawMessage, error)
	Close(context.Context) error
	Abort() error
}

Relay owns one upstream Session. Incoming calls keep their external ID; the upstream Session assigns independent IDs. No retries or authority forwarding are implicit. A bridge's upstream credentials belong to its configured policy.

Jump to

Keyboard shortcuts

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