Help us shape the future of Go! Take the 2026 Go Developer Survey

websessions

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package websessions remembers which panel user a browser (web client) session belongs to. The web client announces a per-session id as its RustDesk "my_id"; the controlled device reports that id back in its audit events, which lets connection rules apply to the panel user.

Index

Constants

View Source
const Prefix = "web-"

Prefix marks web client ids; desktop clients have numeric ids.

View Source
const (
	// TTL bounds how long an issued id maps to its user.
	TTL = 12 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry is safe for concurrent use.

func New

func New(now func() time.Time) *Registry

New returns an empty registry; now may be nil (time.Now).

func (*Registry) Issue

func (r *Registry) Issue(userID int64) (string, error)

Issue returns a fresh id for userID.

func (*Registry) User

func (r *Registry) User(id string) (int64, bool)

User returns the panel user behind a web client id.

Jump to

Keyboard shortcuts

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