libgocron

package
v6.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Version string = "6.2.1"

Version holds the current version of gocron

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCrons

type AccountCrons struct {
	Account string
	Count   int
	Crons   []Cron
}

AccountCrons defines all crons for a given account

type AllCrons

type AllCrons struct {
	Count int
	Crons []Cron
}

AllCrons defines all crons in the database

type BackendVersion

type BackendVersion struct {
	Version  string `json:"version"`
	Database struct {
		Type    string `json:"type"`
		Version string `json:"version"`
	} `json:"database"`
}

BackendVersion defines the backend api json response for /version

type Cron

type Cron struct {
	Cronname    string `json:cronname`  // Name of the cronjob
	Account     string `json:account`   // Account the job belongs to
	Email       string `json:email`     // Address to send alerts to
	Frequency   int    `json:frequency` // How often a job should check in
	Site        bool   `json:site`      // Not implemented, required for database backward compatability
	Ipaddress   string // Source IP address
	Lastruntime int    // Unix timestamp
	Alerted     bool   // set to true if an alert has already been thrown
}

Cron defines a cronjob

func (Cron) CheckLength

func (c Cron) CheckLength() error

CheckLength validates that parameters are present

func (Cron) ValidateParams

func (c Cron) ValidateParams() bool

ValidateParams validates SQL variables

type Gocron

type Gocron struct {
	Dbfqdn       string `yaml:"dbfqdn"`
	Dbport       string `yaml:"dbport"`
	Dbuser       string `yaml:"dbuser"`
	Dbpass       string `yaml:"dbpass"`
	Dbdatabase   string `yaml:"dbdatabase"`
	Interval     int    `yaml:"interval"`
	SlackHookURL string `yaml:"slackhookurl"`
	SlackChannel string `yaml:"slackchannel"`
}

Gocron defines a global configuration used at runtime

func (Gocron) Api

func (g Gocron) Api(port string)

Api runs gocron's rest api

func (Gocron) StartBackend

func (g Gocron) StartBackend() error

StartBackend calls checkCronStatus() on a set interval

func (Gocron) StartFrontend

func (g Gocron) StartFrontend(frontendPort string)

StartFrontend starts the gocron frontend server

func (Gocron) Validate

func (g Gocron) Validate() error

Validate checks if config parameters are valid

Jump to

Keyboard shortcuts

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