terminalstore

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 7 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 libdbexec.Exec) error

InitSchema creates terminal_sessions if missing (matches runtimetypes/schema.sql).

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 persisted terminal session lifecycle.

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 libdbexec.Exec) Store

New constructs a Store backed by exec (use db.WithoutTransaction() or a tx from WithTransaction).

Jump to

Keyboard shortcuts

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