bindaddr

package
v0.2.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package bindaddr resolves the small bind-address vocabulary app services and managed databases use to choose which network interface a published port binds to. Shared by internal/spec, internal/api, internal/store, and internal/reconcile so all four layers validate and resolve it identically rather than drifting apart.

Index

Constants

View Source
const (
	// Private binds a published port to loopback only, unreachable from
	// any other host. The default whenever a caller's value is empty.
	Private = "private"
	// Public binds a published port to every interface, reachable from
	// any network that can route to this host. Requires this exact
	// literal value: Resolve never treats an empty or malformed value as
	// Public, the actual security gap this package exists to close.
	Public = "public"
	// Default is what Resolve returns for an empty value.
	Default = Private
)

Variables

This section is empty.

Functions

func Resolve

func Resolve(value string) (string, error)

Resolve turns value into the literal IP Docker should bind a published port to. Private and Public expand to their concrete address; anything else must already be a valid IP literal (a specific interface, or a WireGuard mesh peer address once internal/network's mesh is wired to this); empty resolves to Default, never to Public.

func Validate

func Validate(value string) error

Validate reports whether value is acceptable input for Resolve, without needing the resolved IP itself.

Types

This section is empty.

Jump to

Keyboard shortcuts

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