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

tpd

package
v1.3.104 Latest Latest
Warning

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

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

Documentation

Overview

Package tpd pkg/services/tpd/config.go c2-vis-appsvc

JSON schema for transport-discovery as both a standalone config file (cmd/svc/transport-discovery -c path) AND a service block in services.json (skywire svc run --config services.json).

Package tpd pkg/services/tpd/tpd.go c2-vis-appsvc

transport-discovery as a pkg/services.Service. The standalone `skywire svc tpd` cobra command and the multi-service supervisor (`skywire svc run`) both end up calling Run(ctx) — the per-flag CLI path lives in cmd/svc/transport-discovery and constructs the Config from flags + optional --config file before handing off.

Index

Constants

View Source
const Type = "transport-discovery"

Type is the registry key used in services.json blocks.

Variables

View Source
var (
	DefaultEntryTimeout  = 5 * time.Minute
	DefaultStoreDataPath = "/var/lib/skywire/tpd/bandwidth"
	DefaultUptimeDB      = "/var/lib/skywire/tpd/uptime.db"
	DefaultRedisPoolSize = 10
)

Default values for the cobra command's flag defaults that get overridden by Config field zero-values. Exposed so the cmd package can reference one source of truth.

Functions

func New

func New(cfg *Config, log *logging.Logger) services.Service

New builds a Service from an already-parsed Config.

Types

type Config

type Config struct {
	Path string `json:"-"`

	services.Common

	Whitelist []string `json:"whitelist_keys,omitempty"`

	// StoreDataPath is the on-disk path for bandwidth backup files.
	StoreDataPath string `json:"store_data_path,omitempty"`
	// UptimeDB is the local self-uptime bbolt store path. Empty
	// disables service-self uptime recording.
	UptimeDB string `json:"uptime_db,omitempty"`

	// ChartsAddr serves only the charts page over plain HTTP. Empty disables it.
	ChartsAddr string `json:"charts_addr,omitempty"`

	// TelemetryApplyEvery is how often one edge's report of one transport is
	// written to redis. Empty means 15m, and it is capped at 30m.
	TelemetryApplyEvery services.Duration `json:"telemetry_apply_every,omitempty"`

	// RoutingPublishEvery is how often the routing feed is republished.
	// Empty means 10m.
	RoutingPublishEvery services.Duration `json:"routing_publish_every,omitempty"`

	// RoutingLatencyWindow is how many routing publishes the published
	// latency is the minimum of. Zero means 6.
	RoutingLatencyWindow int `json:"routing_latency_window,omitempty"`

	// RoutingHysteresis is the relative change a transport's latency or
	// throughput must make before the routing feed republishes it. Zero
	// means 0.25; a negative value republishes every change.
	RoutingHysteresis float64 `json:"routing_hysteresis,omitempty"`

	// RoutingSnapshotEvery is how many routing publishes go by between full
	// snapshots; the publishes between send only what changed. Zero means 6.
	RoutingSnapshotEvery int `json:"routing_snapshot_every,omitempty"`

	// AddressResolverDmsg is the address resolver whose bindings feed shows
	// which visors share a public IP. Empty means the production one.
	AddressResolverDmsg string `json:"address_resolver_dmsg,omitempty"`

	// Dmsg is the dmsg-related config block — same shape across
	// every deployment service that uses it.
	Dmsg cmdutil.DmsgConfig `json:"dmsg,omitempty"`
}

Config is the JSON configuration for transport-discovery.

func LoadFile

func LoadFile(path string) (*Config, error)

LoadFile reads and strict-parses a Config from path. Used by the standalone cobra command (--config).

func ParseBlock

func ParseBlock(raw []byte) (*Config, error)

ParseBlock decodes a services.json block (tolerant of unknown fields — the supervisor's framing keys "type"/"name" arrive in the same object).

Jump to

Keyboard shortcuts

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