workergateway

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The address a worker is told to call. It was the bridge gateway on the
	// worker's own host for as long as GARM ran there too. Clustering ended
	// that: a worker can be placed on any member, so the endpoint it reaches
	// has to be one address the whole fleet shares, and the default below is
	// only the single-host case.
	// ListenAddressRequired is deliberately empty. A clustered deployment has
	// no universal listen address; every unit must pass --listen explicitly.
	ListenAddressRequired = ""
	ExpectedUpstreamURL   = "http://127.0.0.1:9997"
	MaxRequestBodyBytes   = int64(1 << 20)
)

Variables

This section is empty.

Functions

func ProductionUpstream

func ProductionUpstream() (*url.URL, error)

func ValidateListenAddress

func ValidateListenAddress(address string) error

ValidateListenAddress refuses anything but a literal IP and an explicit port. A name here would let DNS decide which machine terminates worker TLS, and the certificate the workers pin names addresses, not names.

Types

type Gateway

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

Gateway exposes only the GARM endpoints required by disposable workers. The GARM administrative API remains bound to loopback and is never routed here.

func New

func New(upstream *url.URL, logger *slog.Logger) (*Gateway, error)

func NewWithCache

func NewWithCache(upstream, cacheUpstream *url.URL, logger *slog.Logger) (*Gateway, error)

func (*Gateway) ServeHTTP

func (g *Gateway) ServeHTTP(writer http.ResponseWriter, request *http.Request)

Jump to

Keyboard shortcuts

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