hostterm

package
v0.8.68 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package hostterm manages the daemon's host terminals: operator shells that run in tmux ON THE DAEMON HOST (not in a container). They are the most privileged surface in the system — uncontained, operator-only, flag-gated, audited, and never reachable by an island token (see internal/api/tokenauth.go and docs/host-terminals.md). This package is just the persisted registry; the tmux lifecycle and PTY attach live in internal/api + internal/bridge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Terminals []Terminal `json:"terminals"`
}

Store is the persisted set of host terminals.

func Load

func Load() (*Store, error)

Load reads the store under the lock; returns an empty store if none exists.

func Update

func Update(fn func(*Store) error) (*Store, error)

Update runs fn against the store under the lock and persists it atomically.

func (*Store) Add

func (s *Store) Add(t Terminal)

Add appends a terminal (caller sets ID via NextID and stamps CreatedAt).

func (*Store) Get

func (s *Store) Get(id string) (Terminal, bool)

Get returns the terminal with the given id.

func (*Store) NextID

func (s *Store) NextID() string

NextID returns the next monotonic "t<N>" id not currently in use.

func (*Store) Relabel

func (s *Store) Relabel(id, label string) bool

Relabel sets a terminal's label.

func (*Store) Remove

func (s *Store) Remove(id string) bool

Remove deletes a terminal by id.

type Terminal

type Terminal struct {
	ID        string    `json:"id"` // "t1", "t2", …
	Label     string    `json:"label,omitempty"`
	CreatedAt time.Time `json:"created_at"`
}

Terminal is one host terminal: a named tmux session on the daemon host.

func (Terminal) Tmux

func (t Terminal) Tmux() string

Tmux is the host tmux session name backing this terminal.

Jump to

Keyboard shortcuts

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