state

package
v0.1.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager holds the central state tree

func NewManager

func NewManager(client *tmux.Client) *Manager

NewManager creates a new state manager

func (*Manager) GetSessions

func (m *Manager) GetSessions() []*tmux.Session

GetSessions returns all tracked sessions with full details

func (*Manager) SessionForPane

func (m *Manager) SessionForPane(paneID string) string

SessionForPane returns the session name for a given pane ID (e.g. "%42"). Returns empty string if not found.

func (*Manager) Subscribe

func (m *Manager) Subscribe() chan StateEvent

Subscribe returns a channel that receives state events

func (*Manager) Unsubscribe

func (m *Manager) Unsubscribe(ch chan StateEvent)

Unsubscribe removes a subscriber channel

func (*Manager) UpdateSessions

func (m *Manager) UpdateSessions(sessions []*tmux.Session)

UpdateSessions takes a snapshot of sessions from discovery, diffs against previous state, and broadcasts changes

type StateEvent

type StateEvent struct {
	Type     string      `json:"type"`
	Session  string      `json:"session,omitempty"`
	Host     string      `json:"host,omitempty"`
	HostName string      `json:"host_name,omitempty"`
	Data     interface{} `json:"data,omitempty"`
}

StateEvent represents a change in the state tree

Jump to

Keyboard shortcuts

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