lanbind

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 4 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 lanbind holds what the emulator says about the --lb-bind, --gke-bind, --ar-bind, --gfe-bind, --sql-bind and --link-bind addresses in a Containerized Instance, in one place so that start, the Services and doctor say the same (#497, ADR 0011).

A Containerized Instance on a bridge network has only its container's addresses: they reach container networks, never the LAN. Publishing a port on a host address is no substitute (its listeners are --bind's, which don't require credentials), so the fix is to run the container on the host's network, or the native binary on a VM runtime.

Index

Constants

View Source
const Fix = "to reach the LAN, run the container with `--network host` on Linux, or the native binary on a VM runtime (ADR 0011)"

Fix is how a Containerized Instance serves these flags on the LAN.

Variables

This section is empty.

Functions

func Explain

func Explain(w Where, err error) error

Explain adds the cause and Fix to err, the failure to bind a --*-bind address, when the address is not one of the Instance's network namespace in a container. Any other err, and any err on the Host, is returned unchanged.

func NotLocal

func NotLocal(err error) bool

NotLocal reports whether err is a bind refused because the address is not one of the network namespace's.

func Warning

func Warning(flags []string) string

Warning is the start warning for the flags set (without "--") in a Bridge Containerized Instance.

Types

type Where

type Where int

Where is the network namespace the Instance binds the addresses in.

const (
	// Host: the host, or a container on the host's network, where the
	// flags work as documented.
	Host Where = iota
	// Bridge: a Containerized Instance whose runtime confirms its own
	// container, so not on the host's network.
	Bridge
	// Unconfirmed: a Containerized Instance by --containerized or the
	// marker files alone, its runtime not confirming it (no socket, not
	// reachable yet, or not finding its container); it may be on the
	// host's network.
	Unconfirmed
)

func Locate

func Locate(containerized, confirmed bool) Where

Locate decides Where: containerized is whether the Instance is a Containerized Instance (runtime.DecideContainerized), and confirmed whether the runtime found the emulator's own container, so that the decision is its answer. Bridge needs that answer; a decision without it is Unconfirmed (#564).

func (Where) String

func (w Where) String() string

Jump to

Keyboard shortcuts

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