crontab

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEnable is default state for metrics
	DefaultEnable = true

	// DefaultSource defines a source file
	DefaultSource = "/etc/crontab"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled bool   `toml:"enabled"`
	Crontab string `toml:"source"`
}

Config represents the meta configuration.

func NewConfig

func NewConfig() Config

NewConfig builds a new configuration with default values.

func (Config) Validate

func (c Config) Validate() error

Validate the config

type SourceProvider

type SourceProvider struct {
	Config   Config
	TaskFlow chan *provider.Task
	QuitChan chan bool
}

SourceProvider creates a new src provider

func NewSourceProvider

func NewSourceProvider(config Config) *SourceProvider

NewSourceProvider creates a new src provider

func (SourceProvider) OnTaskUpdate

func (p SourceProvider) OnTaskUpdate(fn func(*provider.Task) error)

OnTaskUpdate runs when a task gets updated

func (*SourceProvider) Read

func (p *SourceProvider) Read() error

Read reads from FS

func (SourceProvider) Stop

func (p SourceProvider) Stop() error

Stop quits reading tasks

func (SourceProvider) String added in v0.7.0

func (p SourceProvider) String() string

String returns the Providers identity

func (SourceProvider) TaskDone

func (p SourceProvider) TaskDone(t *provider.Task) error

TaskDone will be executed when a task is done

func (SourceProvider) TaskError

func (p SourceProvider) TaskError(t *provider.Task, err error) error

TaskError will be called when an error occured

func (SourceProvider) TaskStarted

func (p SourceProvider) TaskStarted(t *provider.Task) error

TaskStarted will be executed when a task is started

Jump to

Keyboard shortcuts

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