Help us shape the future of Go! Take the 2026 Go Developer Survey

cliproxy

package
v1.3.104-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

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.

func (MuxAuto) Human

func (m MuxAuto) Human(w io.Writer) error

Human writes the timestamped line the command printed. The timestamp is not a field: a JSON consumer has its own clock and the line exists to be read as it scrolls past.

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.

func (MuxNegotiatedList) Human

func (l MuxNegotiatedList) Human(w io.Writer) error

Human prints one row per group: the caps that are on, then the window shape.

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.

func (MuxOp) Human

func (m MuxOp) Human(w io.Writer) error

Human writes the sentence this used to print.

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.

func (MuxSet) Human

func (m MuxSet) Human(w io.Writer) error

Human writes the summary line the command printed before.

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.

func (MuxWeights) Human

func (m MuxWeights) Human(w io.Writer) error

Human prints the mode and, beneath it, one row per weighted leg.

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`).

func (Settings) Human

func (s Settings) Human(w io.Writer) error

Human writes the knob table.

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.

Jump to

Keyboard shortcuts

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