forward

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package forward tracks live `stackr forward` tunnels in memory. A dropped websocket IS a closed forward, so there is nothing to persist and nothing to reconcile after a restart, the canvas cards themselves come from the relay containers; this registry only answers "who".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry is a mutex-guarded session set. The zero value is not usable; New.

func New

func New() *Registry

func (*Registry) Add

func (r *Registry) Add(s Session) (remove func())

Add records a session and returns its remover, for the same defer that writes the close audit line, so the two can never disagree.

func (*Registry) Sessions

func (r *Registry) Sessions() []Session

Sessions returns a snapshot of every open session.

type Session

type Session struct {
	TileID     string
	Port       int
	UserID     string
	UserName   string
	AvatarPath string // storage path, "" = initials fallback
	Role       string // server role, for the card's hover line
	StartedAt  time.Time
}

Session is one open forward: a user with a tunnel into a tile's port.

Jump to

Keyboard shortcuts

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