terminal

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package terminal routes canonical AOP PTY messages to the local PTY runtime.

Index

Constants

View Source
const (
	DefaultAttachBytes     = 64 * 1024
	DefaultMonitorInterval = 50 * time.Millisecond
)

Variables

This section is empty.

Functions

func IsClosed

func IsClosed(message *ptypb.ProtocolMessage) bool

func IsDetach

func IsDetach(message *ptypb.ProtocolMessage) bool

func NewDetach

func NewDetach(streamID string) *ptypb.ProtocolMessage

func NewDetached

func NewDetached(streamID string) *ptypb.ProtocolMessage

func NewKill

func NewKill(streamID string) *ptypb.ProtocolMessage

func NewList

func NewList(streamID, nodeID string) *ptypb.ProtocolMessage

func NodeID

func NodeID(message *ptypb.ProtocolMessage) string

func StreamID

func StreamID(message *ptypb.ProtocolMessage) string

Types

type Option

type Option func(*Router)

func WithAttachBytes

func WithAttachBytes(n int) Option

func WithMonitorInterval

func WithMonitorInterval(interval time.Duration) Option

func WithOpener

func WithOpener(kind string, opener runtimepty.OpenFunc) Option

func WithOpeners

func WithOpeners(openers map[string]runtimepty.OpenFunc) Option

type Router

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

func NewRouter

func NewRouter(mgr runtimepty.SessionManager, opts ...Option) *Router

func NewRuntimeRouter

func NewRuntimeRouter(mgr *runtimepty.Manager, opts ...Option) *Router

NewRuntimeRouter wraps the utils/pty runtime with the canonical AOP PTY protocol. Callers above this boundary only exchange ProtocolMessage values; runtime opener and session details remain private to this package.

func (*Router) BroadcastSessions

func (r *Router) BroadcastSessions(send SendFunc)

BroadcastSessions emits the current runtime session state as canonical AOP PTY messages for every active stream.

func (*Router) Close

func (r *Router) Close()

func (*Router) Handle

func (r *Router) Handle(ctx context.Context, message *ptypb.ProtocolMessage, send SendFunc)

func (*Router) StreamIDs

func (r *Router) StreamIDs() []string

type SendFunc

type SendFunc func(*ptypb.ProtocolMessage)

Jump to

Keyboard shortcuts

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