gateway

package
v0.261.0 Latest Latest
Warning

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

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

README

gateway

What - the gateway bounded context: running the Inference Gateway the CLI talks to, as a binary from ~/.infer/bin or as a container, and keeping that binary the release the configuration asks for. Why - the CLI, Desktop and a workspace pod share one binary in one directory, so one owner decides which release is installed and when it is replaced. How - domain/ holds the release choice: what the configuration wants (WantedRelease), what the cached binary says about itself (CachedBinary) and which release to install. infrastructure/ holds BinaryInstaller, the one place the gateway is downloaded: it asks GitHub for the latest release, probes the cached binary and installs a download as a new file. The package itself is the Supervisor, which starts, watches and stops the gateway.

How it plugs in

  • gateway.version chooses the release, latest by default. A pinned release is installed exactly and never updated past, and needs no release lookup.
  • The Supervisor asks the installer for the binary before it starts it. infer gateway install asks for it without starting anything, which is how Desktop installs the gateway.
  • A download is written beside the binary and renamed into place. macOS ends a signed binary whose file was rewritten in place every time it starts.
  • Container mode installs nothing: the image tag in gateway.oci chooses the release.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transport added in v0.240.0

func Transport(cfg config.PeerTLSConfig) http.RoundTripper

Transport is how infer reaches the gateway: gateway.tls.ca_file is trusted on top of the system roots and the gateway.tls client certificate is presented. Unusable TLS material fails every request with its cause, rather than falling back to a transport the gateway would reject.

Types

type Supervisor added in v0.207.0

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

Supervisor manages the lifecycle of the gateway container or binary

func NewSupervisor added in v0.207.0

func NewSupervisor(sessionID convdomain.SessionID, cfg *config.Config, runtime containerruntime.ContainerRuntime) *Supervisor

NewSupervisor creates a new gateway manager

func (*Supervisor) EnsureStarted added in v0.207.0

func (gm *Supervisor) EnsureStarted() error

EnsureStarted starts the gateway if configured and not already running This is a convenience method that checks config and running state before starting

func (*Supervisor) GetGatewayURL added in v0.207.0

func (gm *Supervisor) GetGatewayURL() string

GetGatewayURL returns the actual gateway URL with the assigned port

func (*Supervisor) IsRunning added in v0.207.0

func (gm *Supervisor) IsRunning() bool

IsRunning returns whether the gateway container is running

func (*Supervisor) Start added in v0.207.0

func (gm *Supervisor) Start(ctx context.Context) error

Start starts the gateway container or binary if configured to run locally

func (*Supervisor) Stop added in v0.207.0

func (gm *Supervisor) Stop(ctx context.Context) error

Stop stops the gateway container or binary and cleans up the network

func (*Supervisor) Version added in v0.207.0

func (gm *Supervisor) Version(ctx context.Context) string

Version reports the version of the gateway serving at the managed URL, or "" when it cannot be determined. The gateway's /version endpoint wins; managed modes fall back to the cached binary or the configured container image tag. Externally managed gateways (Gateway.Run off) have no local source to ask.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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