task

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeTaskOutput      = Type("task.output")
	TypeTaskOutputErr   = Type("task.outputerr")
	TypeTaskError       = Type("task.error")
	TypeTaskJSON        = Type("task.json")
	TypeTaskCommand     = Type("task.command")
	TypeTaskDone        = Type("task.done")
	TypeTaskListAllDone = Type("list.done")
	TypeTaskListAllErr  = Type("list.error")
)
View Source
const (
	CtxKeyError       = ContextKey("error")
	CtxKeyOutput      = ContextKey("output")
	CtxKeyCommand     = ContextKey("command")
	CtxKeyTaskRunning = ContextKey("taskRunning")
)

Variables

This section is empty.

Functions

func ExecuteTask

func ExecuteTask(taskId string, bus msgbus.Publisher[Message])

ExecuteTask runs a task

func ListAllJson added in v0.4.0

func ListAllJson(bus msgbus.Publisher[Message])

ListAllJson executes the "task --list-all --json" command and sends the resulting JSON to the message bus.

func StopTaskProcess

func StopTaskProcess(p *os.Process) error

StopTaskProcess stops a running task process by sending a SIGINT signal

func TaskProcessAttr

func TaskProcessAttr() *syscall.SysProcAttr

TaskProcessAttr returns the system process attributes for task execution

Types

type ContextKey added in v0.5.0

type ContextKey string

type Message added in v0.5.0

type Message struct {
	Type Type
	// contains filtered or unexported fields
}

func (Message) CancelFunc added in v0.5.0

func (m Message) CancelFunc() context.CancelFunc

func (Message) Command added in v0.5.0

func (m Message) Command() *exec.Cmd

func (Message) Error added in v0.5.0

func (m Message) Error() error

func (Message) Output added in v0.5.0

func (m Message) Output() string

func (Message) SetCommand added in v0.5.0

func (m Message) SetCommand(cmd *exec.Cmd) Message

func (Message) SetError added in v0.5.0

func (m Message) SetError(err error) Message

func (Message) SetOutput added in v0.5.0

func (m Message) SetOutput(output string) Message

func (Message) SetTaskRunning added in v0.5.0

func (m Message) SetTaskRunning(isRunning bool) Message

func (Message) TaskRunning added in v0.5.0

func (m Message) TaskRunning() bool

func (Message) TopicMessage added in v0.5.0

func (m Message) TopicMessage() msgbus.TopicMessage[Message]

func (Message) Wait added in v0.5.0

func (m Message) Wait()

type Task

type Task struct {
	Id      string   `json:"name"`
	Desc    string   `json:"desc,omitempty"`
	Summary string   `json:"summary,omitempty"`
	Aliases []string `json:"aliases,omitempty"`
}

Task represents a task from the Taskfile

func ParseTaskLine

func ParseTaskLine(taskMsg string) (Task, bool)

ParseTaskLine parses a task line from the task --list-all output

type Type added in v0.5.0

type Type string

func (Type) Message added in v0.5.0

func (t Type) Message() Message

func (Type) Topic added in v0.5.0

func (t Type) Topic() msgbus.Topic

Jump to

Keyboard shortcuts

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