Versions in this module Expand all Collapse all v1 v1.0.8 Oct 2, 2021 v1.0.7 Oct 2, 2021 v1.0.6 Oct 2, 2021 v1.0.4 Oct 9, 2022 Changes in this version + var JobRegisterErrorsTotal = promauto.NewCounter(prometheus.CounterOpts{ ... }) + var RunDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ ... }, []string{ ... }) + var RunErrorsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var RunLatest = promauto.NewGaugeVec(prometheus.GaugeOpts{ ... }, []string{ ... }) + var RunsTotal = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var SchedulerJobs = promauto.NewGauge(prometheus.GaugeOpts{ ... }) v1.0.3 Jun 20, 2022 v1.0.2 Jun 18, 2022 v1.0.1 Jan 1, 2022 v1.0.0 Oct 2, 2021 Changes in this version + const HashmeTagName + var ErrEmptySchedule = errors.New("unable to add a job with a empty schedule.") + var ErrEmptyScheduler = errors.New("unable to start a empty scheduler.") + var ErrLocalImageNotFound = errors.New("couldn't find image on the host") + var ErrMaxTimeRunning = errors.New("the job has exceed the maximum allowed time running.") + var ErrSkippedExecution = errors.New("skipped execution") + var ErrUnexpected = errors.New("error unexpected, docker has returned exit code -1, maybe wrong user?") + type BareJob struct + Command string + Name string + Schedule string + func (c *BareJob) Middlewares() []Middleware + func (c *BareJob) Use(ms ...Middleware) + func (j *BareJob) GetCommand() string + func (j *BareJob) GetCronJobID() int + func (j *BareJob) GetName() string + func (j *BareJob) GetSchedule() string + func (j *BareJob) NotifyStart() + func (j *BareJob) NotifyStop() + func (j *BareJob) Running() int32 + func (j *BareJob) SetCronJobID(id int) + type Context struct + Execution *Execution + Job Job + Logger Logger + Scheduler *Scheduler + func NewContext(s *Scheduler, j Job, e *Execution) *Context + func (c *Context) Log(msg string) + func (c *Context) Next() error + func (c *Context) Start() + func (c *Context) Stop(err error) + type CronUtils struct + Logger Logger + func NewCronUtils(l Logger) *CronUtils + func (c *CronUtils) Error(err error, msg string, keysAndValues ...interface{}) + func (c *CronUtils) Info(msg string, keysAndValues ...interface{}) + type ExecJob struct + Client *docker.Client + Container string + TTY bool + User string + func NewExecJob(c *docker.Client) *ExecJob + func (c *ExecJob) Middlewares() []Middleware + func (c *ExecJob) Use(ms ...Middleware) + func (j *ExecJob) Hash() string + func (j *ExecJob) Run(ctx *Context) error + type Execution struct + Date time.Time + Duration time.Duration + Error error + ErrorStream *circbuf.Buffer + Failed bool + ID string + IsRunning bool + OutputStream *circbuf.Buffer + Skipped bool + func NewExecution() *Execution + func (e *Execution) Start() + func (e *Execution) Stop(err error) + type Job interface + GetCommand func() string + GetCronJobID func() int + GetName func() string + GetSchedule func() string + Middlewares func() []Middleware + NotifyStart func() + NotifyStop func() + Run func(*Context) error + Running func() int32 + SetCronJobID func(int) + Use func(...Middleware) + type LocalJob struct + Dir string + Environment []string + func NewLocalJob() *LocalJob + func (c *LocalJob) Middlewares() []Middleware + func (c *LocalJob) Use(ms ...Middleware) + func (j *LocalJob) Run(ctx *Context) error + type Logger interface + Criticalf func(format string, args ...interface{}) + Debugf func(format string, args ...interface{}) + Errorf func(format string, args ...interface{}) + Noticef func(format string, args ...interface{}) + Warningf func(format string, args ...interface{}) + type Middleware interface + ContinueOnStop func() bool + Run func(*Context) error + type RunJob struct + Client *docker.Client + Container string + Delete string + Image string + Network string + Pull string + TTY bool + User string + Volume []string + func NewRunJob(c *docker.Client) *RunJob + func (c *RunJob) Middlewares() []Middleware + func (c *RunJob) Use(ms ...Middleware) + func (j *RunJob) Run(ctx *Context) error + type RunServiceJob struct + Client *docker.Client + Delete string + Image string + Network string + TTY bool + User string + func NewRunServiceJob(c *docker.Client) *RunServiceJob + func (c *RunServiceJob) Middlewares() []Middleware + func (c *RunServiceJob) Use(ms ...Middleware) + func (j *RunServiceJob) Run(ctx *Context) error + type Scheduler struct + Jobs []Job + Logger Logger + func NewScheduler(l Logger) *Scheduler + func (c *Scheduler) Middlewares() []Middleware + func (c *Scheduler) Use(ms ...Middleware) + func (s *Scheduler) AddJob(j Job) error + func (s *Scheduler) IsRunning() bool + func (s *Scheduler) RemoveJob(j Job) error + func (s *Scheduler) Start() error + func (s *Scheduler) Stop() error