gron

package
v0.0.0-...-e7f9c2e Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf interface {
	Parse(conf io.Reader) ([]*Job, error)
}

Conf is main interface for configuration

type JSONConf

type JSONConf struct {
}

JSONConf config is type to allow JSON configuration

func (*JSONConf) Parse

func (jsonConf *JSONConf) Parse(conf io.Reader) ([]*Job, error)

Parse parses json config into slice of Tasks to run

type Job

type Job struct {
	sync.Mutex
	Name         string
	Cmd          string
	Args         []string
	MaxInstances int
	Timeout      jobDuration
	RunsEvery    jobDuration
	// contains filtered or unexported fields
}

Job is a command to run

func (*Job) AddProcess

func (j *Job) AddProcess(p *Process) error

func (*Job) GetProcesses

func (j *Job) GetProcesses() []*Process

type Process

type Process struct {
	SigChan chan os.Signal
	// contains filtered or unexported fields
}

Process type describes single task's process

func (Process) GetID

func (p Process) GetID() string

func (*Process) String

func (p *Process) String() string

type Spinner

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

func NewSpinner

func NewSpinner(jobs []*Job) *Spinner

func (*Spinner) Spin

func (s *Spinner) Spin() error

Spin all jobs

Jump to

Keyboard shortcuts

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