bindaddr

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 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.

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