Help us shape the future of Go! Take the 2026 Go Developer Survey

task

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

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

List is a list which could be called as transaction

func NewTaskList

func NewTaskList(tasks []Task) *List

NewTaskList initials a list of task

func (*List) Start

func (l *List) Start() error

Start to run this tasks list, will return the last run error

type Task

type Task interface {
	// Name of the task
	Name() string
	// Run method
	Run() error
	// Rollback if failed to run this task
	Rollback() error
}

Task is an interface which could be added into a TaskList

Jump to

Keyboard shortcuts

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