state

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TelemetryView

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

TelemetryView is a minimal, thread-safe implementation to feed observables. Since one Newt process represents one site, we expose a single logical site. site_id is a resource attribute, so we do not emit per-site labels here.

func Global

func Global() *TelemetryView

Global returns a singleton TelemetryView.

func (*TelemetryView) ActiveSessions

func (v *TelemetryView) ActiveSessions(_ string) (int64, bool)

func (*TelemetryView) ClearTunnel

func (v *TelemetryView) ClearTunnel(tunnelID string)

func (*TelemetryView) DecSessions

func (v *TelemetryView) DecSessions(tunnelID string)

func (*TelemetryView) IncSessions

func (v *TelemetryView) IncSessions(tunnelID string)

Instrumentation helpers

func (*TelemetryView) LastHeartbeat

func (v *TelemetryView) LastHeartbeat(_ string) (time.Time, bool)

func (*TelemetryView) ListSites

func (v *TelemetryView) ListSites() []string

func (*TelemetryView) Online

func (v *TelemetryView) Online(_ string) (bool, bool)

func (*TelemetryView) SessionsByTunnel

func (v *TelemetryView) SessionsByTunnel() map[string]int64

Extended accessor used by telemetry callback to publish per-tunnel samples.

func (*TelemetryView) SetOnline

func (v *TelemetryView) SetOnline(b bool)

func (*TelemetryView) TouchHeartbeat

func (v *TelemetryView) TouchHeartbeat()

Jump to

Keyboard shortcuts

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