Documentation
¶
Overview ¶
Package loopback implements port-mode routing with no TLS: the laptop default.
Like every routing adapter, it makes traffic arrive at Pando's proxy and never reaches the workload (R-023).
Index ¶
- Constants
- func Info() api.KindInfo
- func Warnings(raw json.RawMessage) []string
- type Adapter
- func (a *Adapter) Capabilities(context.Context) (api.RoutingCapabilities, error)
- func (a *Adapter) Category() api.Category
- func (a *Adapter) Configure(_ context.Context, raw json.RawMessage) error
- func (a *Adapter) Edge(context.Context, api.EdgeRequest) (api.EdgePlan, bool, error)
- func (a *Adapter) Ensure(_ context.Context, r api.RouteRequest) (api.RouteHandle, error)
- func (a *Adapter) HealthCheck(context.Context) error
- func (a *Adapter) Kind() string
- func (a *Adapter) Observe(_ context.Context, h api.RouteHandle) (api.RouteState, error)
- func (a *Adapter) Remove(_ context.Context, h api.RouteHandle) error
- type Config
Constants ¶
const Kind = "loopback"
Kind is the adapter's kind string.
Variables ¶
This section is empty.
Functions ¶
func Info ¶
Info describes this kind of adapter for the forms that configure one (api.KindInfo, R-261).
func Warnings ¶ added in v0.10.0
func Warnings(raw json.RawMessage) []string
Warnings returns what is worth telling someone saving this configuration, without refusing it. A stored base_url is the only one: it is accepted for compatibility but does nothing. Configuration that does not parse returns nothing here; Configure reports that as an error.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter serves apps on localhost ports: the laptop default.
It does nothing to the network — there is nothing to configure, because the proxy already listens and a port-mode app is reached by asking the proxy for it. Ensure therefore records intent rather than performing an action, and Observe reports what was recorded.
That is not a degenerate case of the interface; it is the interface working. Ensure/Remove/Observe describe intent, which is why they fit both an adapter that writes config files and one that has no config at all.
func (*Adapter) Capabilities ¶
Capabilities reports port mode only, and no TLS.
Stated honestly so the planner refuses a subdomain app at plan time with PLAN_CAPABILITY_UNSUPPORTED, rather than accepting it and producing an app nobody can reach.
func (*Adapter) Ensure ¶
func (a *Adapter) Ensure(_ context.Context, r api.RouteRequest) (api.RouteHandle, error)
Ensure records that an app should be reachable on a port.
func (*Adapter) HealthCheck ¶
HealthCheck always succeeds: there is no external dependency to be unhealthy.
func (*Adapter) Observe ¶
func (a *Adapter) Observe(_ context.Context, h api.RouteHandle) (api.RouteState, error)
type Config ¶
type Config struct {
BaseURL string `json:"base_url,omitempty"`
}
Config is the adapter's configuration. There is nothing to set.
BaseURL is accepted so a configuration stored by an earlier version still loads, and is otherwise ignored. It never changed an address anyone saw: the API renders a port-mode address from the host the request reached Pando on (spec.Address, R-261), and the proxy listens on each allocated port on that same host (design 03 §4.2), so any other host is an address nothing answers on. server.external_url already names where browsers reach the install; a second setting that could disagree with it would be a guess about DNS.