Documentation
¶
Overview ¶
Package application allows the creation of Application struct. There's only one Application per main().
Index ¶
- type Application
- func (app *Application) CheckAndRunTriggers(refetchChecksChan <-chan bool)
- func (app *Application) FullAddr() string
- func (app *Application) HandlePGNotificationPeersAdd(notification *pq.Notification) error
- func (app *Application) HandlePGNotificationPeersRemove(notification *pq.Notification) error
- func (app *Application) ListenAllPGChannels(listener *pq.ListenerConn) (bool, error)
- func (app *Application) MiddlewareStruct() (*interpose.Middleware, error)
- func (app *Application) MigrateUpAll() error
- func (app *Application) NewHTTPServer() (*graceful.Server, error)
- func (app *Application) NewPGListener(generalConfig config.GeneralConfig) (*pq.ListenerConn, <-chan *pq.Notification, error)
- func (app *Application) PGNotifyChecksRefetch() error
- func (app *Application) PGNotifyPeersAdd() error
- func (app *Application) PGNotifyPeersRemove() error
- func (app *Application) PruneAll()
- func (app *Application) PruneTSCheckOnce(cluster *dal.ClusterRow) error
- func (app *Application) PruneTSEventOnce(cluster *dal.ClusterRow) error
- func (app *Application) PruneTSExecutorLogOnce(cluster *dal.ClusterRow) error
- func (app *Application) PruneTSLogOnce(cluster *dal.ClusterRow) error
- func (app *Application) PruneTSMetricAggr15mOnce(cluster *dal.ClusterRow) error
- func (app *Application) PruneTSMetricOnce(cluster *dal.ClusterRow) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
Hostname string
GeneralConfig config.GeneralConfig
DBConfig *config.DBConfig
Mailers map[string]*mailer.Mailer
Peers *libmap.TSafeMapString // Peers include self
// contains filtered or unexported fields
}
Application is the application object that runs HTTP server.
func New ¶
func New(configDir string) (*Application, error)
New is the constructor for Application struct.
func (*Application) CheckAndRunTriggers ¶
func (app *Application) CheckAndRunTriggers(refetchChecksChan <-chan bool)
CheckAndRunTriggers pulls list of all checks, distributed evenly across N master daemons, evaluates the checks and run triggers when conditions are met.
func (*Application) FullAddr ¶
func (app *Application) FullAddr() string
func (*Application) HandlePGNotificationPeersAdd ¶
func (app *Application) HandlePGNotificationPeersAdd(notification *pq.Notification) error
HandlePGNotificationPeersAdd responds to peers_add channel.
func (*Application) HandlePGNotificationPeersRemove ¶
func (app *Application) HandlePGNotificationPeersRemove(notification *pq.Notification) error
HandlePGNotificationPeersRemove responds to peers_remove channel.
func (*Application) ListenAllPGChannels ¶
func (app *Application) ListenAllPGChannels(listener *pq.ListenerConn) (bool, error)
ListenAllPGChannels listens to all predefined channels.
func (*Application) MiddlewareStruct ¶
func (app *Application) MiddlewareStruct() (*interpose.Middleware, error)
MiddlewareStruct configures all the middlewares that are in-use for all request handlers.
func (*Application) MigrateUpAll ¶
func (app *Application) MigrateUpAll() error
MigrateUpAll runs all migration files to be up-to-date.
func (*Application) NewHTTPServer ¶
func (app *Application) NewHTTPServer() (*graceful.Server, error)
NewHTTPServer returns an instance of HTTP server.
func (*Application) NewPGListener ¶
func (app *Application) NewPGListener(generalConfig config.GeneralConfig) (*pq.ListenerConn, <-chan *pq.Notification, error)
NewPGListener creates a new database connection for the purpose of listening events.
func (*Application) PGNotifyChecksRefetch ¶
func (app *Application) PGNotifyChecksRefetch() error
PGNotifyChecksRefetch sends message to checks_refetch channel.
func (*Application) PGNotifyPeersAdd ¶
func (app *Application) PGNotifyPeersAdd() error
PGNotifyPeersAdd sends message to peers_add channel.
func (*Application) PGNotifyPeersRemove ¶
func (app *Application) PGNotifyPeersRemove() error
PGNotifyPeersRemove sends message to peers_remove channel.
func (*Application) PruneAll ¶
func (app *Application) PruneAll()
PruneAll runs background job to prune all old timeseries data.
func (*Application) PruneTSCheckOnce ¶
func (app *Application) PruneTSCheckOnce(cluster *dal.ClusterRow) error
PruneTSCheckOnce deletes old ts_checks data.
func (*Application) PruneTSEventOnce ¶
func (app *Application) PruneTSEventOnce(cluster *dal.ClusterRow) error
PruneTSEventOnce deletes old ts_events data.
func (*Application) PruneTSExecutorLogOnce ¶
func (app *Application) PruneTSExecutorLogOnce(cluster *dal.ClusterRow) error
PruneTSExecutorLogOnce deletes old ts_executor_logs data.
func (*Application) PruneTSLogOnce ¶
func (app *Application) PruneTSLogOnce(cluster *dal.ClusterRow) error
PruneTSLogOnce deletes old ts_logs data.
func (*Application) PruneTSMetricAggr15mOnce ¶
func (app *Application) PruneTSMetricAggr15mOnce(cluster *dal.ClusterRow) error
PruneTSMetricAggr15mOnce deletes old ts_metrics_aggr_15m data.
func (*Application) PruneTSMetricOnce ¶
func (app *Application) PruneTSMetricOnce(cluster *dal.ClusterRow) error
PruneTSMetricOnce deletes old ts_metrics data.