Documentation
¶
Overview ¶
Package netplane connects the emulator process to the container networks it creates (Section 3.3). Every container the emulator runs is attached to an internal "services" network on which the emulator's own endpoints (gateway, metadata, DNS, registry, ...) are reachable at the network's gateway address through forwarders, and optionally to an "external" network that provides internet egress (public IPs).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Net ¶
type Net struct {
// Name is the runtime network name.
Name string
// Subnet is the IPv4 CIDR.
Subnet string
// Gateway is the host-side address on the network.
Gateway string
}
Net describes a container network.
type Plane ¶
type Plane struct {
// contains filtered or unexported fields
}
Plane manages the services and external networks of one instance.
func New ¶
New returns a plane. endpoints returns the current host endpoint map (name → host:port), as recorded by emu.Endpoints.
func (*Plane) Addr ¶
Addr returns the address at which containers on the services network reach the named emulator endpoint ("gateway", "metadata", "dns", "ar", ...), starting a forwarder on the services gateway if needed. The port is the same as the host endpoint's when it is free.
func (*Plane) Close ¶
func (p *Plane) Close()
Close stops all forwarders. Networks are left to runtime cleanup.
func (*Plane) External ¶
External returns the external (egress-capable) network, creating it on first use.