Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidPerformance identifies an out-of-range observation reuse duration. ErrInvalidPerformance = errors.New("observation reuse seconds must be between 0 and 5") 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
ValidateLatencyConcurrency shares the stored-value bounds with installer migration.
func ValidateLogLevels ¶ added in v0.9.6
ValidateLogLevels validates a nonempty set of canonical display level names.
func ValidatePerformance ¶
func ValidatePerformance(value PerformancePreferences) error
ValidatePerformance checks the instance observation bounds.
Types ¶
type PerformancePreferences ¶
type PerformancePreferences struct {
ControllerOwnerDetection bool `json:"controller_owner_detection"`
ObservationReuseSeconds int `json:"observation_reuse_seconds"`
}
PerformancePreferences controls instance-wide display observation policy.
func DefaultPerformancePreferences ¶
func DefaultPerformancePreferences() PerformancePreferences
DefaultPerformancePreferences disables display owner scans and reuses observations for three seconds.
type Preferences ¶
type Preferences struct {
Performance PerformancePreferences
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 (*Service) Reset ¶
func (s *Service) Reset(ctx context.Context) (Preferences, error)
Reset restores this preferences store to its defaults through the normal persistence path.
func (*Service) ResetAfterDataClear ¶
func (s *Service) ResetAfterDataClear()
ResetAfterDataClear publishes defaults after the daemon reset owner removed the preferences file.
func (*Service) Snapshot ¶
func (s *Service) Snapshot() Preferences
type Update ¶
type Update struct {
Performance *PerformancePreferences
ConnectionsColumns []string
Proxies *ProxyPreferences
// LogLevels replaces the saved set when non-nil; an empty set is invalid.
LogLevels []string
}