task

package
v1.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultStore

type DefaultStore struct {
	//To sync the related operations.
	*sync.RWMutex
	// contains filtered or unexported fields
}

DefaultStore is the default implemetation of Store interface.

func NewDefaultStore

func NewDefaultStore() *DefaultStore

NewDefaultStore is constructor method for DefaultStore.

func (*DefaultStore) AddTasks

func (ds *DefaultStore) AddTasks(tasks ...Task)

AddTasks implements the same method in Store interface.

func (*DefaultStore) GetTasks

func (ds *DefaultStore) GetTasks() []Task

GetTasks implements the same method in Store interface.

type ScanAllTask

type ScanAllTask struct{}

ScanAllTask is task of scanning all tags.

func NewScanAllTask

func NewScanAllTask() *ScanAllTask

NewScanAllTask is constructor of creating ScanAllTask.

func (*ScanAllTask) Name

func (sat *ScanAllTask) Name() string

Name returns the name of the task.

func (*ScanAllTask) Run

func (sat *ScanAllTask) Run() error

Run the actions.

type Store

type Store interface {
	//GetTasks return the current existing list in store.
	GetTasks() []Task

	//AddTasks is used to append tasks to the list.
	AddTasks(tasks ...Task)
}

Store is designed to keep the tasks.

type Task

type Task interface {
	//Name should return the name of the task.
	Name() string

	//Run the concrete code here
	Run() error
}

Task is used to synchronously run specific action(s).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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