tasks

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(ctx context.Context, c *goph.Client, remotePath string, localPath string) (err error)

Download file from remote server!

func Upload

func Upload(ctx context.Context, c *goph.Client, localPath string, remotePath string) (err error)

Types

type SshRun

type SshRun struct {
	Error error
}

type Task

type Task struct {
	Id      string
	Name    string
	Desc    string
	Env     map[string]string
	XEnv    map[string]string
	Run     string
	Uses    string
	Hosts   []string
	Cwd     string
	Timeout time.Duration
	Needs   []string
	Files   []string
	Args    []string
}

type TaskContext

type TaskContext struct {
	Task    Task
	TaskDef schema.TaskDef
	Targets schema.Hosts
	Context context.Context
}

type TaskResult

type TaskResult struct {
	Err       error
	Status    int
	StartedAt time.Time
	EndedAt   time.Time
	Message   string
	Output    map[string]interface{}
}

func NewTaskResult

func NewTaskResult() *TaskResult

func Run

func Run(ctx TaskContext) *TaskResult

func (*TaskResult) Cancel

func (tr *TaskResult) Cancel(msg string) *TaskResult

func (*TaskResult) End

func (tr *TaskResult) End() *TaskResult

func (*TaskResult) Fail

func (tr *TaskResult) Fail(err error) *TaskResult

func (*TaskResult) Ok

func (tr *TaskResult) Ok() *TaskResult

func (*TaskResult) Skip

func (tr *TaskResult) Skip(msg string) *TaskResult

func (*TaskResult) Start

func (tr *TaskResult) Start() *TaskResult

Jump to

Keyboard shortcuts

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