hooks

package module
v0.0.0-...-6958f8f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 9 Imported by: 2

README

hooks

Many Hooks

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JobName

func JobName(j interface{}) string

func NewCmd

func NewCmd(name string, args ...string) *exec.Cmd

func NewCmdHook

func NewCmdHook(name string, args ...string) func() error

Types

type Job

type Job interface {
	Run() error
}

type JobFunc

type JobFunc func() error

func (JobFunc) JobName

func (this JobFunc) JobName() string

func (JobFunc) Run

func (this JobFunc) Run() error

type JobNamer

type JobNamer interface {
	JobName() string
}

type Jobs

type Jobs []Job

type NamedJob

type NamedJob struct {
	Job
	Name string
}

func (NamedJob) JobName

func (this NamedJob) JobName() string

type NamedPostJob

type NamedPostJob struct {
	PostJob
	Name string
}

func (NamedPostJob) JobName

func (this NamedPostJob) JobName() string

type PostJob

type PostJob interface {
	Run(binNames ...string) error
}

type PostJobFunc

type PostJobFunc func(binNames ...string) error

func (PostJobFunc) JobName

func (this PostJobFunc) JobName() string

func (PostJobFunc) Run

func (this PostJobFunc) Run(binNames ...string) error

type PostJobs

type PostJobs []PostJob

func (PostJobs) Jobs

func (this PostJobs) Jobs(binNames ...string) (jobs Jobs)

type Runner

type Runner struct {
	NumCpu int
	Jobs   Jobs
	Stderr io.Writer
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(jobs Jobs) *Runner

func (*Runner) Append

func (this *Runner) Append(jobs ...Job) *Runner

func (Runner) Ok

func (this Runner) Ok() bool

func (Runner) Run

func (this Runner) Run() (status Status)

func (*Runner) SetNumCpu

func (this *Runner) SetNumCpu(v int) *Runner

type Status

type Status bool

func (Status) Exit

func (this Status) Exit()

Jump to

Keyboard shortcuts

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