Documentation
¶
Index ¶
- type Event
- type EventType
- type Exec
- func (sr *Exec) Attach(terminal *api.SupervisedTerminal) error
- func (sr *Exec) Close(_ error) error
- func (sr *Exec) CreateMetadata() error
- func (sr *Exec) Detach() error
- func (sr *Exec) ID() api.ID
- func (sr *Exec) OpenSocketCtrl() error
- func (sr *Exec) Resize(_ api.ResizeArgs)
- func (sr *Exec) StartServer(ctx context.Context, sc *supervisorrpc.SupervisorControllerRPC, ...)
- func (sr *Exec) StartTerminalCmd(terminal *api.SupervisedTerminal) error
- func (sr *Exec) WaitClose(_ error) error
- type SupervisorRunner
- type Test
- func (t *Test) Attach(terminal *api.SupervisedTerminal) error
- func (t *Test) Close(reason error) error
- func (t *Test) CreateMetadata() error
- func (t *Test) Detach() error
- func (t *Test) ID() api.ID
- func (t *Test) OpenSocketCtrl() error
- func (t *Test) Resize(args api.ResizeArgs)
- func (t *Test) StartServer(ctx context.Context, sc *supervisorrpc.SupervisorControllerRPC, ...)
- func (t *Test) StartTerminalCmd(terminal *api.SupervisedTerminal) error
- type UIMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exec ¶ added in v0.1.4
type Exec struct {
Mgr *terminalstore.Exec
// contains filtered or unexported fields
}
func (*Exec) Attach ¶ added in v0.1.4
func (sr *Exec) Attach(terminal *api.SupervisedTerminal) error
func (*Exec) CreateMetadata ¶ added in v0.1.4
func (*Exec) OpenSocketCtrl ¶ added in v0.1.4
func (*Exec) Resize ¶ added in v0.1.4
func (sr *Exec) Resize(_ api.ResizeArgs)
func (*Exec) StartServer ¶ added in v0.1.4
func (sr *Exec) StartServer( ctx context.Context, sc *supervisorrpc.SupervisorControllerRPC, readyCh chan error, doneCh chan error, )
func (*Exec) StartTerminalCmd ¶ added in v0.3.0
func (sr *Exec) StartTerminalCmd(terminal *api.SupervisedTerminal) error
type SupervisorRunner ¶
type SupervisorRunner interface {
OpenSocketCtrl() error
StartServer(ctx context.Context, sc *supervisorrpc.SupervisorControllerRPC, readyCh chan error, doneCh chan error)
Attach(terminal *api.SupervisedTerminal) error
ID() api.ID
Close(reason error) error
Resize(args api.ResizeArgs)
CreateMetadata() error
Detach() error
StartTerminalCmd(terminal *api.SupervisedTerminal) error
}
func NewSupervisorRunnerExec ¶
func NewSupervisorRunnerExec( ctx context.Context, logger *slog.Logger, doc *api.SupervisorDoc, evCh chan<- Event, ) SupervisorRunner
type Test ¶ added in v0.1.4
type Test struct {
Ctx context.Context
Logger *slog.Logger
// Last-call trackers
LastListener net.Listener
LastController *supervisorrpc.SupervisorControllerRPC
LastCtx context.Context
LastReason error
LastResize api.ResizeArgs
// Stub functions
OpenSocketCtrlFunc func() error
StartServerFunc func(
ctx context.Context,
sc *supervisorrpc.SupervisorControllerRPC,
readyCh chan error,
doneCh chan error,
)
IDFunc func() api.ID
CloseFunc func(reason error) error
ResizeFunc func(args api.ResizeArgs)
AttachFunc func(terminal *api.SupervisedTerminal) error
CreateMetadataFunc func() error
DetachFunc func() error
StartTerminalCmdFunc func(terminal *api.SupervisedTerminal) error
}
Test is a test double for SupervisorRunner It allows overriding behavior with function fields and capturing arguments for assertions in unit tests.
func NewSupervisorRunnerTest ¶
func NewSupervisorRunnerTest(ctx context.Context, _ *api.SupervisorDoc) *Test
NewSupervisorRunnerTest returns a new SupervisorRunnerTest instance.
func (*Test) CreateMetadata ¶ added in v0.1.4
func (*Test) OpenSocketCtrl ¶ added in v0.1.4
func (*Test) Resize ¶ added in v0.1.4
func (t *Test) Resize(args api.ResizeArgs)
func (*Test) StartServer ¶ added in v0.1.4
func (t *Test) StartServer( ctx context.Context, sc *supervisorrpc.SupervisorControllerRPC, readyCh chan error, doneCh chan error, )
func (*Test) StartTerminalCmd ¶ added in v0.3.0
func (t *Test) StartTerminalCmd(terminal *api.SupervisedTerminal) error
Click to show internal directories.
Click to hide internal directories.