Documentation ¶
Overview ¶
Package watcher provides functions used by all watchers.
Index ¶
Constants ¶
View Source
const ( Every3Seconds = "@every 3s" EveryDay = "@daily" )
Variables ¶
View Source
var ( // ErrRegistered will be returned when watcher is already been registered. ErrRegistered = errors.New("watcher has already been registered") ErrConfigUnavailable = errors.New("configuration is not available") )
Functions ¶
func ListWatchers ¶
ListWatchers returns registered watchers in map format.
Types ¶
type Config ¶
type Config struct { // The purpose of nightwatch is to handle asynchronous tasks on the monster platform // in a unified manner, so a store aggregation type is needed here. Store store.Interface // Then maximum concurrency event of user watcher. UserWatcherMaxWorkers int64 }
Config aggregates the configurations of all watchers and serves as a configuration aggregator.
type ISpec ¶
type ISpec interface { // Spec return the spec for a cron job. // There are two cron spec formats in common usage: // - standard cron format: https://en.wikipedia.org/wiki/Cron // - quartz scheduler format: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/tutorial-lesson-06.html // This method is optional for a watcher. Spec() string }
Spec interface provides methods to set spec for a cron job.
Directories ¶
Path | Synopsis |
---|---|
Package historyclean is a watcher implement used to delete expired record from the database.
|
Package historyclean is a watcher implement used to delete expired record from the database. |
Package user is a watcher implement.
|
Package user is a watcher implement. |
Click to show internal directories.
Click to hide internal directories.