session

package
v0.9.4-dev.4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 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

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Kind          EventKind
	ObservedAt    time.Time
	Attempt       int
	Status        protocol.Status
	Core          protocol.CoreStatus
	Subscriptions protocol.SubscriptionList
	Proxies       protocol.ProxyGroups
	Routing       protocol.RoutingStatus
	Preferences   protocol.TUIPreferences
	Rules         protocol.RuleList
	RuleProviders protocol.RuleProviderList
	WebGUI        protocol.WebGUIStatus
	// Logging contains the daemon logging status associated with the event.
	Logging     protocol.LoggingStatus
	Traffic     protocol.TrafficSample
	Memory      protocol.MemorySample
	Log         protocol.LogEntry
	Connections protocol.ConnectionList
	// Epoch is the snapshot synchronization epoch produced only by Session.
	Epoch uint64
	Err   error
}

type EventKind

type EventKind string
const (
	EventStatus        EventKind = "status"
	EventCore          EventKind = "core"
	EventSubscriptions EventKind = "subscriptions"
	EventProxies       EventKind = "proxies"
	EventRouting       EventKind = "routing"
	EventPreferences   EventKind = "preferences"
	EventRules         EventKind = "rules"
	EventRuleProviders EventKind = "rule-providers"
	EventWebGUI        EventKind = "web-gui"
	// EventLogging carries an epoch-tagged daemon Logging snapshot.
	EventLogging       EventKind = "logging"
	EventTraffic       EventKind = "traffic"
	EventMemory        EventKind = "memory"
	EventLog           EventKind = "log"
	EventConnections   EventKind = "connections"
	EventReconnecting  EventKind = "reconnecting"
	EventConnected     EventKind = "connected"
	EventTerminalError EventKind = "terminal-error"
)

type Options

type Options struct {
	// Reporter is the optional owner-provided diagnostic output.
	Reporter         diagnostics.Reporter
	Backoff          func(attempt int) time.Duration
	OrderedQueueSize int
	EventBufferSize  int
	// PollInterval is the cadence for re-polling status snapshots (status, core,
	// proxies, subscriptions, ...) while the push streams stay connected.
	PollInterval time.Duration
}

type Session

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

func New

func New(client Client, options Options) *Session

func (*Session) Close

func (s *Session) Close()

func (*Session) Start

func (s *Session) Start(parent context.Context) <-chan Event

Jump to

Keyboard shortcuts

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