task

package
v0.0.0-...-397c4c8 Latest Latest
Warning

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

Go to latest
Published: May 26, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NullWriter = &nullWriter{}

Functions

func MakeAnsiColorWriter

func MakeAnsiColorWriter(child io.Writer, color string) io.Writer

func MakeMultiWriter

func MakeMultiWriter(children ...io.Writer) io.Writer

func MakeWrappedWriter

func MakeWrappedWriter(child io.Writer, prefix string, postfix string) io.Writer

func RunCommand

func RunCommand(args []string, log TaskLog) bool

Types

type CommandTask

type CommandTask struct {
	Args []string
}

func Command

func Command(args ...string) *CommandTask

func (*CommandTask) Run

func (task *CommandTask) Run(log TaskLog) bool

type FlatTextLog

type FlatTextLog struct {
	Parent  TaskLog
	Path    []string
	Printer *FlatTextLogPrinter
}

func (*FlatTextLog) Begin

func (log *FlatTextLog) Begin(t time.Time)

func (*FlatTextLog) BeginCapture

func (log *FlatTextLog) BeginCapture() (io.Writer, io.Writer)

func (*FlatTextLog) CreateSubtask

func (log *FlatTextLog) CreateSubtask(name string) TaskLog

func (*FlatTextLog) End

func (log *FlatTextLog) End(t time.Time, d time.Duration)

func (*FlatTextLog) EndCapture

func (log *FlatTextLog) EndCapture()

func (*FlatTextLog) LogError

func (log *FlatTextLog) LogError(format string, args ...interface{})

func (*FlatTextLog) LogInfo

func (log *FlatTextLog) LogInfo(format string, args ...interface{})

type FlatTextLogPrinter

type FlatTextLogPrinter struct {
	Stdout io.Writer
	Stderr io.Writer
	Info   io.Writer
	Error  io.Writer
}

type MultiLog

type MultiLog struct {
	Children []TaskLog
}

func (*MultiLog) Begin

func (log *MultiLog) Begin(t time.Time)

func (*MultiLog) BeginCapture

func (log *MultiLog) BeginCapture() (io.Writer, io.Writer)

func (*MultiLog) CreateSubtask

func (log *MultiLog) CreateSubtask(name string) TaskLog

func (*MultiLog) End

func (log *MultiLog) End(t time.Time, d time.Duration)

func (*MultiLog) EndCapture

func (log *MultiLog) EndCapture()

func (*MultiLog) LogError

func (log *MultiLog) LogError(format string, args ...interface{})

func (*MultiLog) LogInfo

func (log *MultiLog) LogInfo(format string, args ...interface{})

type NullLog

type NullLog struct {
}

func (*NullLog) Begin

func (log *NullLog) Begin(t time.Time)

func (*NullLog) BeginCapture

func (log *NullLog) BeginCapture() (io.Writer, io.Writer)

func (*NullLog) CreateSubtask

func (log *NullLog) CreateSubtask(name string) TaskLog

func (*NullLog) End

func (log *NullLog) End(t time.Time, d time.Duration)

func (*NullLog) EndCapture

func (log *NullLog) EndCapture()

func (*NullLog) LogError

func (log *NullLog) LogError(format string, args ...interface{})

func (*NullLog) LogInfo

func (log *NullLog) LogInfo(format string, args ...interface{})

type TaskDecl

type TaskDecl interface {
	Run(log TaskLog) bool
}

type TaskLog

type TaskLog interface {
	LogInfo(format string, args ...interface{})
	LogError(format string, args ...interface{})
	BeginCapture() (io.Writer, io.Writer)
	EndCapture()
	CreateSubtask(name string) TaskLog
	Begin(t time.Time)
	End(t time.Time, d time.Duration)
}

func MakeConsoleLog

func MakeConsoleLog() TaskLog

func MakeMultiLog

func MakeMultiLog(children ...TaskLog) TaskLog

Jump to

Keyboard shortcuts

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