Documentation
¶
Index ¶
- Constants
- func ExecuteTask(taskId string, bus msgbus.Publisher[Message])
- func ListAllJson(bus msgbus.Publisher[Message])
- func StopTaskProcess(p *os.Process) error
- func TaskProcessAttr() *syscall.SysProcAttr
- type ContextKey
- type Message
- func (m Message) CancelFunc() context.CancelFunc
- func (m Message) Command() *exec.Cmd
- func (m Message) Error() error
- func (m Message) Output() string
- func (m Message) SetCommand(cmd *exec.Cmd) Message
- func (m Message) SetError(err error) Message
- func (m Message) SetOutput(output string) Message
- func (m Message) SetTaskRunning(isRunning bool) Message
- func (m Message) TaskRunning() bool
- func (m Message) TopicMessage() msgbus.TopicMessage[Message]
- func (m Message) Wait()
- type Task
- type Type
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 ¶
ExecuteTask runs a task
func ListAllJson ¶ added in v0.4.0
ListAllJson executes the "task --list-all --json" command and sends the resulting JSON to the message bus.
func StopTaskProcess ¶
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) SetTaskRunning ¶ added in v0.5.0
func (Message) TaskRunning ¶ added in v0.5.0
func (Message) TopicMessage ¶ added in v0.5.0
func (m Message) TopicMessage() msgbus.TopicMessage[Message]
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 ¶
ParseTaskLine parses a task line from the task --list-all output
Click to show internal directories.
Click to hide internal directories.