common

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StyleDoubleLine = iota
	StyleSingleLine
	StyleDashedLine
	StyleNoLine
)

Styles

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(source string, dest string) (err error)

CopyDir recursive copy of directory

func CopyFile

func CopyFile(source string, dest string) (err error)

CopyFile copy file

func FindGitBranch

func FindGitBranch(file string) (string, error)

FindGitBranch get the current git branch

func FindGitRevision

func FindGitRevision(file string) (shortSha string, sha string, err error)

FindGitRevision get the current git revision

func FindGithubRepo

func FindGithubRepo(file string) (string, error)

FindGithubRepo get the repo

Types

type Conditional

type Conditional func() bool

Conditional define contract for the conditional predicate

type Drawing

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

Drawing struct

func (*Drawing) Draw

func (d *Drawing) Draw(writer io.Writer, centerOnWidth int)

Draw to writer

func (*Drawing) GetWidth

func (d *Drawing) GetWidth() int

GetWidth of drawing

type Executor

type Executor func() error

Executor define contract for the steps of a workflow

func NewConditionalExecutor

func NewConditionalExecutor(conditional Conditional, trueExecutor Executor, falseExecutor Executor) Executor

NewConditionalExecutor creates a new executor based on conditions

func NewErrorExecutor

func NewErrorExecutor(err error) Executor

NewErrorExecutor creates a new executor that always errors out

func NewGitCloneExecutor

func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor

NewGitCloneExecutor creates an executor to clone git repos

func NewParallelExecutor

func NewParallelExecutor(executors ...Executor) Executor

NewParallelExecutor creates a new executor from a parallel of other executors

func NewPipelineExecutor

func NewPipelineExecutor(executors ...Executor) Executor

NewPipelineExecutor creates a new executor from a series of other executors

type NewGitCloneExecutorInput

type NewGitCloneExecutorInput struct {
	URL    *url.URL
	Ref    string
	Dir    string
	Logger *log.Entry
	Dryrun bool
}

NewGitCloneExecutorInput the input for the NewGitCloneExecutor

type Pen

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

Pen struct

func NewPen

func NewPen(style Style, color int) *Pen

NewPen creates a new pen

func (*Pen) DrawArrow

func (p *Pen) DrawArrow() *Drawing

DrawArrow between boxes

func (*Pen) DrawBoxes

func (p *Pen) DrawBoxes(labels ...string) *Drawing

DrawBoxes to draw boxes

type Style

type Style int

Style is a specific style

type Warning

type Warning struct {
	Message string
}

Warning that implements `error` but safe to ignore

func Warningf

func Warningf(format string, args ...interface{}) Warning

Warningf create a warning

func (Warning) Error

func (w Warning) Error() string

Error the contract for error

Jump to

Keyboard shortcuts

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