terminalstore

package
v0.28.8 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("terminal session not found")

Functions

func InitSchema

func InitSchema(ctx context.Context, exec libdb.Exec) error

InitSchema creates the local terminal session metadata table if it is missing.

Types

type Session

type Session struct {
	ID             string        `json:"id"`
	Principal      string        `json:"principal"`
	CWD            string        `json:"cwd"`
	Shell          string        `json:"shell"`
	Cols           int           `json:"cols"`
	Rows           int           `json:"rows"`
	Status         SessionStatus `json:"status"`
	NodeInstanceID string        `json:"nodeInstanceId"`
	WorkspaceID    string        `json:"workspaceId,omitempty"`
	CreatedAt      time.Time     `json:"createdAt"`
	UpdatedAt      time.Time     `json:"updatedAt"`
}

Session maps to the terminal_sessions table.

type SessionStatus

type SessionStatus string

SessionStatus is the persisted lifecycle state for a terminal session.

const (
	SessionStatusActive SessionStatus = "active"
	SessionStatusClosed SessionStatus = "closed"
)

type Store

type Store interface {
	Insert(ctx context.Context, s *Session) error
	GetByID(ctx context.Context, id string) (*Session, error)
	GetByIDAndPrincipal(ctx context.Context, id, principal string) (*Session, error)
	ListByPrincipal(ctx context.Context, principal string, createdAtCursor *time.Time, limit int) ([]*Session, error)
	UpdateGeometry(ctx context.Context, id string, cols, rows int) error
	Delete(ctx context.Context, id string) error
	DeleteByNodeInstanceID(ctx context.Context, nodeInstanceID string) error
}

Store is data access for interactive terminal session metadata.

func New

func New(exec libdb.Exec, workspaceID string) Store

Jump to

Keyboard shortcuts

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