Documentation ¶
Overview ¶
Package scheduler provides a job scheduler for periodically functions.
Index ¶
Constants ¶
View Source
const ( StatusRunning = "Scheduler is running!" StatusNotRunning = "Scheduler is not running" )
Status messages.
View Source
const (
GoCron = "gocron"
)
Pre-defined scheduler providers.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Provider ¶
type Provider interface { // Start the scheduler executor. Start() // Stop the scheduler executor. Stop() // Status of the scheduler Status() string // Jobs of the scheduler will be returned. Jobs() []ProviderJobDetail // Every will create a new Job with the given interval. // int, string and time.duration should be possible. Every(interval interface{}) ProviderJob }
Provider interface.
type ProviderJob ¶
type ProviderJob interface { // Second will be set as unit. Second() ProviderJob // Minute will be set as unit. Minute() ProviderJob // Day will be set as unit. Day() ProviderJob Monday() ProviderJob Tuesday() ProviderJob Wednesday() ProviderJob Thursday() ProviderJob Friday() ProviderJob Saturday() ProviderJob Sunday() ProviderJob // At defines the runtime. (Format HH:MM or HH:MM:SS) At(string) ProviderJob // Week will be set as unit. Week() ProviderJob // Month will be set as unit. // If no day is given, 1 will be set as default. Month(dayOfMonth ...int) ProviderJob // Name of the job. Name(name string) ProviderJob // Tag(s) to categorize the job. Tag(tag ...string) ProviderJob // Singleton will not spawn a new job if the old one is not finished yet. Singleton() ProviderJob // Do defines the function which should be called. Parameter can be added. Do(jobFun interface{}, params ...interface{}) error }
Job interface.
Click to show internal directories.
Click to hide internal directories.