Documentation
¶
Overview ¶
Package cliproxy is the output shape of the `skywire cli proxy` commands.
Most of these mutate something and then say so. A sentence is fine for a person and useless to a caller, which had to scrape "added mux leg (2-hop, first tp=abc…) on app=skysocks" to learn what happened. The types here carry the same facts as fields.
Package cliproxy pkg/cliout/cliproxy/mux_controls.go
Output shapes for the per-leg mux controls: the weight override and the negotiated per-group view. Both answer a question rather than reporting a mutation, so unlike MuxOp they carry the whole state back, not just what changed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MuxAuto ¶
type MuxAuto struct {
App string `json:"app"`
Preset string `json:"preset"`
Legs int `json:"legs"`
Keep int `json:"keep"`
Pruned int `json:"pruned"`
Grown int `json:"grown"`
DryRun bool `json:"dry_run,omitempty"`
}
MuxAuto is one adaptation pass: what the preset asked for and what the run actually did to the session's legs.
DryRun is a field rather than a different shape, because the numbers mean the same thing either way — the only difference is whether they happened.
type MuxLegWeight ¶
type MuxLegWeight struct {
TransportID string `json:"transport_id"`
Weight float64 `json:"weight"`
}
MuxLegWeight is one leg's share, named by its first-hop transport.
type MuxNegotiated ¶
type MuxNegotiated struct {
DstPort uint16 `json:"dst_port"`
SrcPort uint16 `json:"src_port"`
Remote string `json:"remote"`
AppName string `json:"app_name,omitempty"`
Legs int `json:"legs"`
MuxEnabled bool `json:"mux_enabled"`
SACKEnabled bool `json:"sack_enabled"`
HOLRetxEnabled bool `json:"hol_retx_enabled"`
PerFrameNoise bool `json:"per_frame_noise"`
FECEnabled bool `json:"fec_enabled"`
Directional bool `json:"directional"`
Distribution string `json:"distribution"`
ExplicitWeights []MuxLegWeight `json:"explicit_weights,omitempty"`
EcfMinWindowBytes int64 `json:"ecf_min_window_bytes"`
EcfMaxWindowBytes int64 `json:"ecf_max_window_bytes"`
EcfWindowMargin float64 `json:"ecf_window_margin"`
SendWindowWaitMax string `json:"send_window_wait_max"`
ForwardSpill bool `json:"forward_spill"`
ForwardSwitchMargin float64 `json:"forward_switch_margin"`
PerLegWindowBytes []float64 `json:"per_leg_window_bytes,omitempty"`
}
MuxNegotiated is one route group's negotiated capabilities and the send-window shape in effect on it.
type MuxNegotiatedList ¶
type MuxNegotiatedList struct {
App string `json:"app"`
Groups []MuxNegotiated `json:"groups"`
}
MuxNegotiatedList is the printable list of them.
type MuxOp ¶
type MuxOp struct {
// Op is "add", "remove", "cut", "cap", "width", "standby", "switch",
// "adopt", "mode" or "direction".
Op string `json:"op"`
App string `json:"app"`
// TransportID is the first transport of the leg, for add and remove.
TransportID string `json:"transport_id,omitempty"`
// Hops is the leg's length, for add.
Hops int `json:"hops,omitempty"`
// Mode is the new setting, for the "mode" op only.
Mode string `json:"mode,omitempty"`
// Value is the new numeric setting, for the cap/width/standby ops — kept
// separate from Mode so a width/standby retune isn't reported as a "mode"
// change.
Value string `json:"value,omitempty"`
// Legs is how many mux legs the op actually added, for "grow". Kept apart
// from Hops (one leg's length) and Value (the tunnel's port) so a caller
// can read the outcome without parsing prose: fewer legs than asked for is
// a normal answer, not an error.
Legs int `json:"legs,omitempty"`
}
MuxOp is the result of a mux leg operation — add, remove, or a mode change.
One type for the three because a caller asking "what did this do" wants the same answer shape each time: what happened, to which app, and to which leg. The fields that do not apply are omitted rather than zeroed, so their absence is meaningful.
type MuxSet ¶
type MuxSet struct {
App string `json:"app"`
Target int `json:"target"`
// Added and Removed are the transports the run actually changed, so a
// caller can act on them rather than parse a count out of prose.
Added []string `json:"added,omitempty"`
Removed []string `json:"removed,omitempty"`
Existing int `json:"already_present"`
// Note carries the trailing remark the human line appends, if any.
Note string `json:"note,omitempty"`
}
MuxSet is the result of reconciling an app's legs toward a target count.
type MuxWeights ¶
type MuxWeights struct {
App string `json:"app"`
DstPort uint16 `json:"dst_port"`
SrcPort uint16 `json:"src_port"`
Mode string `json:"mode"`
Weights []MuxLegWeight `json:"weights,omitempty"`
}
MuxWeights is the weights state of one route group: the scheduler mode in force and, when it is the explicit one, the per-leg weights it spreads by.
type Settings ¶
type Settings struct {
App string `json:"app"`
// Version is the value set the visor holds; Applied is the one the app
// last reported having installed. Applied < Version means a change is in
// flight — the app installs it on its next pull.
Version uint64 `json:"version"`
Applied uint64 `json:"applied"`
Knobs []SettingsEntry `json:"knobs"`
}
Settings is a running proxy app's live tuning knobs (`proxy settings`).
type SettingsEntry ¶
type SettingsEntry struct {
Name string `json:"name"`
Value string `json:"value"`
Default string `json:"default"`
Kind string `json:"kind"`
// State is "default", "applied" or "pending".
State string `json:"state"`
Doc string `json:"doc,omitempty"`
}
SettingsEntry is one knob's row.