cmdstate

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandManager

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

func NewManager

func NewManager(runner *state.TaskRunner) *CommandManager

NewManager creates a new CommandManager.

func (*CommandManager) Connect

func (m *CommandManager) Connect(r *http.Request, w http.ResponseWriter, task *state.Task, websocketID string) error

Connect upgrades the HTTP connection and connects to the given websocket.

func (*CommandManager) Ensure

func (m *CommandManager) Ensure() error

Ensure is part of the overlord.StateManager interface.

type ExecArgs

type ExecArgs struct {
	Command     []string
	Environment map[string]string
	WorkingDir  string
	Timeout     time.Duration
	UserID      *int
	GroupID     *int
	Terminal    bool
	Interactive bool
	SplitStderr bool
	Width       int
	Height      int
}

ExecArgs holds the arguments for a command execution.

type ExecMetadata

type ExecMetadata struct {
	TaskID      string
	Environment map[string]string
	WorkingDir  string
}

ExecMetadata is the metadata returned from an Exec call.

func Exec

func Exec(st *state.State, args *ExecArgs) (*state.Task, ExecMetadata, error)

Exec creates a task that will execute the command with the given arguments.

Jump to

Keyboard shortcuts

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