Documentation
¶
Index ¶
- Constants
- Variables
- type Manager
- func (m *Manager) AddSessionLifecycleHook(hook SessionLifecycleHook) func()
- func (m *Manager) Cleanup()
- func (m *Manager) CreateSession(name string, workingDir string) (*SessionInfo, error)
- func (m *Manager) DeleteSession(sessionID string) error
- func (m *Manager) DeleteSessionForWidget(sessionID string, widgetID string) error
- func (m *Manager) DetachSink(streamServer *rpc.Server)
- func (m *Manager) Register(r *rpc.Router, meta *session.Meta, streamServer *rpc.Server) func()
- func (m *Manager) RegisterWithAccessGate(r *rpc.Router, meta *session.Meta, streamServer *rpc.Server, ...) func()
- func (m *Manager) VisibleSessionIDs() []string
- type SessionInfo
- type SessionLifecycle
- type SessionLifecycleEvent
- type SessionLifecycleHook
- type SessionLifecycleRecord
Constants ¶
View Source
const ( TypeID_TERMINAL_SESSION_CREATE uint32 = 2001 TypeID_TERMINAL_SESSION_LIST uint32 = 2002 TypeID_TERMINAL_SESSION_ATTACH uint32 = 2003 TypeID_TERMINAL_OUTPUT uint32 = 2004 // notify (agent -> client) TypeID_TERMINAL_RESIZE uint32 = 2005 // notify (client -> agent) TypeID_TERMINAL_INPUT uint32 = 2006 // notify (client -> agent) TypeID_TERMINAL_HISTORY uint32 = 2007 TypeID_TERMINAL_CLEAR uint32 = 2008 TypeID_TERMINAL_SESSION_DELETE uint32 = 2009 TypeID_TERMINAL_NAME_UPDATE uint32 = 2010 // notify (agent -> client): session name/working dir changed TypeID_TERMINAL_SESSION_STATS uint32 = 2011 // history buffer stats (client -> agent) TypeID_TERMINAL_SESSIONS_CHANGED uint32 = 2012 // notify (agent -> client): terminal sessions list changed )
Variables ¶
View Source
var ErrSessionNotFound = errors.New("terminal session not found")
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManagerWithScope ¶ added in v0.6.8
func (*Manager) AddSessionLifecycleHook ¶
func (m *Manager) AddSessionLifecycleHook(hook SessionLifecycleHook) func()
func (*Manager) Cleanup ¶
func (m *Manager) Cleanup()
Cleanup terminates all running terminal sessions (best-effort).
func (*Manager) CreateSession ¶
func (m *Manager) CreateSession(name string, workingDir string) (*SessionInfo, error)
func (*Manager) DeleteSession ¶
func (*Manager) DeleteSessionForWidget ¶
func (*Manager) DetachSink ¶
DetachSink removes all terminal attachments bound to the given RPC stream.
func (*Manager) RegisterWithAccessGate ¶
func (*Manager) VisibleSessionIDs ¶
type SessionInfo ¶
type SessionLifecycle ¶
type SessionLifecycle string
const ( SessionLifecycleOpen SessionLifecycle = "open" SessionLifecycleClosing SessionLifecycle = "closing" SessionLifecycleClosed SessionLifecycle = "closed" SessionLifecycleCloseFailedHidden SessionLifecycle = "close_failed_hidden" )
type SessionLifecycleEvent ¶
type SessionLifecycleHook ¶
type SessionLifecycleHook func(SessionLifecycleEvent)
type SessionLifecycleRecord ¶
type SessionLifecycleRecord struct {
Lifecycle SessionLifecycle `json:"lifecycle"`
OwnerWidgetID string `json:"owner_widget_id,omitempty"`
CloseRequestedAtMs int64 `json:"close_requested_at_ms,omitempty"`
CloseFinishedAtMs int64 `json:"close_finished_at_ms,omitempty"`
FailureCode string `json:"failure_code,omitempty"`
FailureMessage string `json:"failure_message,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.