preferences

package
v0.9.6-dev.8 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: GPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidColumns = errors.New("invalid connections columns")
	// ErrInvalidLogLevels identifies an empty, unknown, or duplicate display-level selection.
	ErrInvalidLogLevels = errors.New("invalid log display levels")
	// ErrInvalidLatencyConcurrency identifies an out-of-range latency test limit.
	ErrInvalidLatencyConcurrency = errors.New("latency test concurrency must be between 1 and 50")
)

Functions

func ValidateLatencyConcurrency added in v0.9.6

func ValidateLatencyConcurrency(value int) error

ValidateLatencyConcurrency shares the stored-value bounds with installer migration.

func ValidateLogLevels added in v0.9.6

func ValidateLogLevels(levels []string) error

ValidateLogLevels validates a nonempty set of canonical display level names.

Types

type Preferences

type Preferences struct {
	ConnectionsColumns []string
	Proxies            ProxyPreferences
	// LogLevels is the committed set of canonical levels restored by new TUI sessions.
	LogLevels []string
}

type ProxyPreferences added in v0.9.6

type ProxyPreferences struct {
	ExtraLatency           bool `json:"extra_latency"`
	AutoLatencyTest        bool `json:"auto_latency_test"`
	LatencyTestConcurrency int  `json:"latency_test_concurrency,omitempty"`
}

ProxyPreferences controls Proxies presentation and automatic latency tests.

func DefaultProxyPreferences added in v0.9.6

func DefaultProxyPreferences() ProxyPreferences

DefaultProxyPreferences enables both switches and keeps five concurrent tests.

type Service

type Service struct {
	// contains filtered or unexported fields
}

func Open

func Open(path string) (*Service, error)

func (*Service) Snapshot

func (s *Service) Snapshot() Preferences

func (*Service) Update

func (s *Service) Update(ctx context.Context, update Update) (Preferences, error)

type Update

type Update struct {
	ConnectionsColumns []string
	Proxies            *ProxyPreferences
	// LogLevels replaces the saved set when non-nil; an empty set is invalid.
	LogLevels []string
}

Jump to

Keyboard shortcuts

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