Documentation
¶
Index ¶
- Constants
- func CheckConnStatus(blockId string) error
- func HandleAppendBlockFile(blockId string, blockFile string, data []byte) error
- func HandleTruncateBlockFile(blockId string) error
- func ResyncController(ctx context.Context, tabId string, blockId string, rtOpts *waveobj.RuntimeOpts, ...) error
- func SendInput(blockId string, inputUnion *BlockInputUnion) error
- func StopAllBlockControllers()
- func StopBlockController(blockId string)
- func StopBlockControllerAndSetStatus(blockId string, newStatus string)
- type BlockControllerRuntimeStatus
- type BlockInputUnion
- type ConnUnion
- type Controller
- type RunShellOpts
- type ShellController
- func (sc *ShellController) DoRunShellCommand(logCtx context.Context, rc *RunShellOpts, blockMeta waveobj.MetaMapType) error
- func (sc *ShellController) GetRuntimeStatus() *BlockControllerRuntimeStatus
- func (sc *ShellController) LockRunLock() bool
- func (sc *ShellController) SendInput(inputUnion *BlockInputUnion) error
- func (sc *ShellController) Start(ctx context.Context, blockMeta waveobj.MetaMapType, ...) error
- func (sc *ShellController) Stop(graceful bool, newStatus string) error
- func (sc *ShellController) UnlockRunLock()
- func (sc *ShellController) UpdateControllerAndSendUpdate(updateFn func() bool)
- func (sc *ShellController) WithLock(f func())
- type TsunamiAppProc
- type TsunamiController
- func (c *TsunamiController) GetRuntimeStatus() *BlockControllerRuntimeStatus
- func (c *TsunamiController) SendInput(input *BlockInputUnion) error
- func (c *TsunamiController) Start(ctx context.Context, blockMeta waveobj.MetaMapType, ...) error
- func (c *TsunamiController) Stop(graceful bool, newStatus string) error
- func (c *TsunamiController) WithStatusLock(fn func())
Constants ¶
View Source
const ( BlockController_Shell = "shell" BlockController_Cmd = "cmd" BlockController_Tsunami = "tsunami" )
View Source
const ( Status_Running = "running" Status_Done = "done" Status_Init = "init" )
View Source
const ( DefaultTermMaxFileSize = 256 * 1024 DefaultHtmlMaxFileSize = 256 * 1024 MaxInitScriptSize = 50 * 1024 )
View Source
const ( ConnType_Local = "local" ConnType_Wsl = "wsl" ConnType_Ssh = "ssh" )
View Source
const DefaultGracefulKillWait = 400 * time.Millisecond
View Source
const DefaultTimeout = 2 * time.Second
Variables ¶
This section is empty.
Functions ¶
func CheckConnStatus ¶
func HandleAppendBlockFile ¶
func HandleTruncateBlockFile ¶
func ResyncController ¶
func SendInput ¶ added in v0.11.6
func SendInput(blockId string, inputUnion *BlockInputUnion) error
func StopAllBlockControllers ¶
func StopAllBlockControllers()
func StopBlockController ¶
func StopBlockController(blockId string)
func StopBlockControllerAndSetStatus ¶ added in v0.10.0
Types ¶
type BlockControllerRuntimeStatus ¶
type BlockControllerRuntimeStatus struct { BlockId string `json:"blockid"` Version int `json:"version"` ShellProcStatus string `json:"shellprocstatus,omitempty"` ShellProcConnName string `json:"shellprocconnname,omitempty"` ShellProcExitCode int `json:"shellprocexitcode"` TsunamiPort int `json:"tsunamiport,omitempty"` }
func GetBlockControllerRuntimeStatus ¶ added in v0.11.6
func GetBlockControllerRuntimeStatus(blockId string) *BlockControllerRuntimeStatus
type BlockInputUnion ¶
type Controller ¶ added in v0.11.6
type Controller interface { Start(ctx context.Context, blockMeta waveobj.MetaMapType, rtOpts *waveobj.RuntimeOpts, force bool) error Stop(graceful bool, newStatus string) error GetRuntimeStatus() *BlockControllerRuntimeStatus SendInput(input *BlockInputUnion) error }
Controller interface that all block controllers must implement
func MakeShellController ¶ added in v0.11.6
func MakeShellController(tabId string, blockId string, controllerType string) Controller
Constructor that returns the Controller interface
func MakeTsunamiController ¶ added in v0.11.6
func MakeTsunamiController(tabId string, blockId string) Controller
type RunShellOpts ¶
type ShellController ¶ added in v0.11.6
type ShellController struct { Lock *sync.Mutex // shared fields ControllerType string TabId string BlockId string BlockDef *waveobj.BlockDef RunLock *atomic.Bool ProcStatus string ProcExitCode int StatusVersion int // for shell/cmd ShellProc *shellexec.ShellProc ShellInputCh chan *BlockInputUnion }
func (*ShellController) DoRunShellCommand ¶ added in v0.11.6
func (sc *ShellController) DoRunShellCommand(logCtx context.Context, rc *RunShellOpts, blockMeta waveobj.MetaMapType) error
func (*ShellController) GetRuntimeStatus ¶ added in v0.11.6
func (sc *ShellController) GetRuntimeStatus() *BlockControllerRuntimeStatus
func (*ShellController) LockRunLock ¶ added in v0.11.6
func (sc *ShellController) LockRunLock() bool
func (*ShellController) SendInput ¶ added in v0.11.6
func (sc *ShellController) SendInput(inputUnion *BlockInputUnion) error
func (*ShellController) Start ¶ added in v0.11.6
func (sc *ShellController) Start(ctx context.Context, blockMeta waveobj.MetaMapType, rtOpts *waveobj.RuntimeOpts, force bool) error
func (*ShellController) Stop ¶ added in v0.11.6
func (sc *ShellController) Stop(graceful bool, newStatus string) error
func (*ShellController) UnlockRunLock ¶ added in v0.11.6
func (sc *ShellController) UnlockRunLock()
func (*ShellController) UpdateControllerAndSendUpdate ¶ added in v0.11.6
func (sc *ShellController) UpdateControllerAndSendUpdate(updateFn func() bool)
func (*ShellController) WithLock ¶ added in v0.11.6
func (sc *ShellController) WithLock(f func())
type TsunamiAppProc ¶ added in v0.11.6
type TsunamiAppProc struct { Cmd *exec.Cmd StdoutBuffer *utilds.ReaderLineBuffer StderrBuffer *utilds.ReaderLineBuffer // May be nil if stderr was consumed for port detection StdinWriter io.WriteCloser Port int // Port the tsunami app is listening on WaitCh chan struct{} // Channel that gets closed when cmd.Wait() returns WaitRtn error // Error returned by cmd.Wait() }
type TsunamiController ¶ added in v0.11.6
type TsunamiController struct {
// contains filtered or unexported fields
}
func (*TsunamiController) GetRuntimeStatus ¶ added in v0.11.6
func (c *TsunamiController) GetRuntimeStatus() *BlockControllerRuntimeStatus
func (*TsunamiController) SendInput ¶ added in v0.11.6
func (c *TsunamiController) SendInput(input *BlockInputUnion) error
func (*TsunamiController) Start ¶ added in v0.11.6
func (c *TsunamiController) Start(ctx context.Context, blockMeta waveobj.MetaMapType, rtOpts *waveobj.RuntimeOpts, force bool) error
func (*TsunamiController) Stop ¶ added in v0.11.6
func (c *TsunamiController) Stop(graceful bool, newStatus string) error
func (*TsunamiController) WithStatusLock ¶ added in v0.11.6
func (c *TsunamiController) WithStatusLock(fn func())
Click to show internal directories.
Click to hide internal directories.