task

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplyCommand       = "apply"
	ReloadStateCommand = "reload state"
)

Variables

This section is empty.

Functions

func CreateTasks added in v0.1.11

func CreateTasks(cmd string, issuer resource.Resource, fn task.Func, ids ...resource.ID) tea.Cmd

CreateTasks returns a command that creates one or more tasks using the given IDs. If a task fails to be created then no further tasks will be created, and an error notification is sent. If all tasks are successfully created then a status notification is sent accordingly.

func HandleCompletedTasks added in v0.1.11

func HandleCompletedTasks(msg CompletedTasksMsg) (info string, err error)

func HandleCreatedTasks added in v0.1.11

func HandleCreatedTasks(msg CreatedTasksMsg) (cmd tea.Cmd, info string, err error)

func WaitTasks added in v0.1.11

func WaitTasks(created CreatedTasksMsg) tea.Cmd

Types

type CompletedTasksMsg added in v0.1.11

type CompletedTasksMsg CreatedTasksMsg

type CreatedTasksMsg added in v0.1.11

type CreatedTasksMsg struct {
	// The command of the completed tasks (all tasks are assumed to be running
	// the same command).
	Command string
	// The parent resource of the page on which the request to create tasks was
	// issued.
	Issuer resource.Resource
	// Successfully created tasks
	Tasks task.Multi
	// Errors from creating tasks
	CreateErrs []error
}

type ListMaker

type ListMaker struct {
	ModuleService    tui.ModuleService
	WorkspaceService tui.WorkspaceService
	RunService       tui.RunService
	TaskService      tui.TaskService
	MaxTasks         int
	Helpers          *tui.Helpers
}

func (*ListMaker) Make

func (m *ListMaker) Make(parent resource.Resource, width, height int) (tea.Model, error)

type Maker

type Maker struct {
	TaskService tui.TaskService
	Spinner     *spinner.Model

	// If IsRunTab is true then Maker makes task models that are a tab within
	// the run model.
	IsRunTab bool

	Helpers *tui.Helpers
}

func (*Maker) Make

func (mm *Maker) Make(tr resource.Resource, width, height int) (tea.Model, error)

Jump to

Keyboard shortcuts

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