Help us shape the future of Go! Take the 2026 Go Developer Survey

modelforward

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package modelforward is the seat's local model forwarder. Harness processes send model requests to it on loopback; it adds the seat's current projected token, read for every request, the lease generation and the current execution, and passes them to the platform model proxy:

http://127.0.0.1:<port>/model/<connection>/v1/... -> <platform>/v1/model/<connection>/v1/...

A rotated token therefore applies at once inside long-running harness processes, without relying on each harness's own credential refresh.

Index

Constants

View Source
const LocalAPIKey = "steadmesh-local"

LocalAPIKey is the placeholder credential harnesses are configured with. The forwarder replaces whatever credential a harness sends.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forwarder

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

Forwarder serves the platform model proxy on loopback.

func Start

func Start(o Options) (*Forwarder, error)

Start listens on a loopback port and serves until Close.

func (*Forwarder) BaseURL

func (f *Forwarder) BaseURL(conn string) string

BaseURL is the base URL a harness uses for a connection (no /v1).

func (*Forwarder) Close

func (f *Forwarder) Close()

type Options

type Options struct {
	PlatformURL string
	TokenFile   string
	// Generation and Execution supply the headers for each request.
	Generation func() int64
	Execution  func() string
	// Observe, when set, receives the execution and status of every response.
	Observe func(execution string, status int)
	Log     *slog.Logger
}

Options configure a forwarder.

Jump to

Keyboard shortcuts

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