task

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 2 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoDependencies

func NoDependencies() []string

NoDependencies returns an empty list, used with Tasks that have no dependencies.

Types

type Name

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

Name is an identifier for a Task

func NewDefaultName

func NewDefaultName(res, action string) Name

NewDefaultName returns a new task name, for a default action

func NewName

func NewName(res, action string) Name

NewName returns a new task name from parts

func ParseName

func ParseName(name string) Name

ParseName returns a new Name from a task name string

func (Name) Action

func (t Name) Action() string

Action returns the action name of the task

func (Name) Equal

func (t Name) Equal(o Name) bool

Equal compares two objects and returns true if they are the same

func (Name) Format

func (t Name) Format(task string) string

Format the name with the name of the task, used for logging

func (Name) MapKey added in v0.12.0

func (t Name) MapKey() string

MapKey returns a unique key for storing a task.Name in a map. Using task.Name as a key will fail when comparing default actions. See the comparison logic in Name.Equal().

func (Name) Name

func (t Name) Name() string

Name returns the full name of the task in the form 'resource:action'

func (Name) Resource

func (t Name) Resource() string

Resource returns the resource name of the task

func (Name) String

func (t Name) String() string

type Stack

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

Stack is a LIFO stack of strings

func NewStack

func NewStack() *Stack

NewStack returns a new empty stack

func (*Stack) Contains

func (s *Stack) Contains(item Name) bool

Contains returns true if an item is in the stack, false otherwise

func (*Stack) Items

func (s *Stack) Items() []Name

Items returns all the items in the stack in order

func (*Stack) Names

func (s *Stack) Names() []string

Names returns all the name of the items in the stack in order

func (*Stack) Pop

func (s *Stack) Pop() (Name, error)

Pop removes an item from the top of the stack

func (*Stack) Push

func (s *Stack) Push(item Name)

Push adds an item to the top of the stack

func (*Stack) Reset

func (s *Stack) Reset()

Reset removes all items from the stack

Jump to

Keyboard shortcuts

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