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 ¶
const Type = "transport-discovery"
Type is the registry key used in services.json blocks.
Variables ¶
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 ¶
Types ¶
type Config ¶
type Config struct {
Path string `json:"-"`
PubKey cipher.PubKey `json:"public_key,omitempty"`
SecKey cipher.SecKey `json:"secret_key,omitempty"`
Addr string `json:"addr,omitempty"`
MetricsAddr string `json:"metrics_addr,omitempty"`
PprofAddr string `json:"pprof_addr,omitempty"`
Redis string `json:"redis,omitempty"`
RedisPoolSize int `json:"redis_pool_size,omitempty"`
EntryTimeout services.Duration `json:"entry_timeout,omitempty"`
LogLevel string `json:"log_level,omitempty"`
Tag string `json:"tag,omitempty"`
Testing bool `json:"testing,omitempty"`
Mode string `json:"mode,omitempty"`
Whitelist []string `json:"whitelist_keys,omitempty"`
SurveyWhitelist []cipher.PubKey `json:"survey_whitelist,omitempty"`
TestEnvironment bool `json:"test_environment,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"`
// DmsgPort is the dmsghttp listener port (default 80).
DmsgPort uint16 `json:"dmsg_port,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 ¶
LoadFile reads and strict-parses a Config from path. Used by the standalone cobra command (--config).
func ParseBlock ¶
ParseBlock decodes a services.json block (tolerant of unknown fields — the supervisor's framing keys "type"/"name" arrive in the same object).