terminal

package
v1.0.0-rc1 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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