Documentation
¶
Overview ¶
Package endpoint is how a fiber's address is written, chosen and dialled. Clone returns one string; it is a URL with a scheme:
unix:///var/lib/fiberd/run/<grant>/<epoch>-<seq>.sock same-host callers tcp://10.0.0.7:30012 tcp://[fd00::7]:30012 callers over the network
Which family a home hands out is declared per deployment (a flag on the standalone home, the Pod's addresses under Kubernetes), never discovered by callers: they dial what they were given. Under a shared address, fibers are told apart by port, which is the model for IPv4 and equally for one IPv6 address per grant. Per-fiber IPv6 addresses would be a further policy (a delegated prefix per grant, a network namespace per fiber) and are not built.
The core never parses endpoints; this package serves the host runtime that mints them, the conformance suite that checks their form, and the tools that dial them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("endpoint: unsupported scheme")
ErrUnsupported: the endpoint's scheme is not one this dialer speaks.
Functions ¶
Types ¶
type Endpoint ¶
type Endpoint struct {
Scheme string // "unix" or "tcp"
Path string // unix
Host string // tcp: an IP literal or name, never bracketed
Port int // tcp
}
Endpoint is one parsed fiber address.
func Parse ¶
Parse reads an endpoint URL. A bare absolute path is accepted as a unix endpoint, for the tools.
type Family ¶
type Family string
Family is the address family a home hands out.
func ParseFamily ¶
ParseFamily reads a -endpoint-family value.
type Policy ¶
type Policy struct {
Family Family
// Host is the address advertised for Inet4 and Inet6: the one
// address the grant's fibers share (a node address, a Pod IP).
Host string
// PortMin and PortMax bound the ports handed out, one per live
// fiber; 0 means 30000-32767.
PortMin, PortMax int
}
Policy is what a home declares about the endpoints it mints.