Documentation ¶
Overview ¶
Package application allows the creation of Application struct. There's only one Application per main().
Index ¶
- type Application
- func (app *Application) CheckAndRunTriggers()
- func (app *Application) FullAddr() string
- func (app *Application) GetContext() context.Context
- func (app *Application) MessageBusHandlers() map[string]func(msg string)
- func (app *Application) MigrateAllCassandra(direction string) error
- func (app *Application) MigrateAllPG(direction string) error
- func (app *Application) Mux() *chi.Mux
- func (app *Application) NewHTTPServer() (*graceful.Server, error)
- func (app *Application) NewHandlerInstruments() map[string]chan int64
- func (app *Application) NewMessageBus(generalConfig config.GeneralConfig) (*messagebus.MessageBus, error)
- func (app *Application) NewMetricsRegistry(handlerInstruments map[string]chan int64, ...) metrics.Registry
- func (app *Application) PruneAll()
- func (app *Application) PruneTSCheckOnce(clusterID int64) (err error)
- func (app *Application) PruneTSEventOnce(clusterID int64) (err error)
- func (app *Application) PruneTSLogOnce(clusterID int64) (err error)
- func (app *Application) PruneTSMetricOnce(clusterID int64) (err error)
- func (app *Application) SendHeartbeat()
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 PGDBConfig *config.PGDBConfig CassandraDBConfig *config.CassandraDBConfig Mailers map[string]*mailer.Mailer HandlerInstruments map[string]chan int64 LatencyGauges map[string]metrics.Gauge MetricsRegistry metrics.Registry MessageBus *messagebus.MessageBus Peers *gocache.Cache RefetchChecksChan chan bool OutLogger *logrus.Logger ErrLogger *logrus.Logger sync.RWMutex // 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()
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) GetContext ¶
func (app *Application) GetContext() context.Context
func (*Application) MessageBusHandlers ¶
func (app *Application) MessageBusHandlers() map[string]func(msg string)
func (*Application) MigrateAllCassandra ¶
func (app *Application) MigrateAllCassandra(direction string) error
func (*Application) MigrateAllPG ¶
func (app *Application) MigrateAllPG(direction string) error
MigrateUpAll runs all migration files to be up-to-date.
func (*Application) Mux ¶
func (app *Application) Mux() *chi.Mux
Mux routes HTTP requests to their appropriate handlers
func (*Application) NewHTTPServer ¶
func (app *Application) NewHTTPServer() (*graceful.Server, error)
NewHTTPServer returns an instance of HTTP server.
func (*Application) NewHandlerInstruments ¶
func (app *Application) NewHandlerInstruments() map[string]chan int64
NewHandlerInstruments creates channels for recording latencies.
func (*Application) NewMessageBus ¶
func (app *Application) NewMessageBus(generalConfig config.GeneralConfig) (*messagebus.MessageBus, error)
NewMessageBus creates a new MessageBus instance.
func (*Application) NewMetricsRegistry ¶
func (app *Application) NewMetricsRegistry(handlerInstruments map[string]chan int64, latencyGauges map[string]metrics.Gauge) metrics.Registry
func (*Application) PruneAll ¶
func (app *Application) PruneAll()
PruneAll runs background job to prune all old timeseries data.
func (*Application) PruneTSCheckOnce ¶
func (app *Application) PruneTSCheckOnce(clusterID int64) (err error)
PruneTSCheckOnce deletes old ts_checks data.
func (*Application) PruneTSEventOnce ¶
func (app *Application) PruneTSEventOnce(clusterID int64) (err error)
PruneTSEventOnce deletes old ts_events data.
func (*Application) PruneTSLogOnce ¶
func (app *Application) PruneTSLogOnce(clusterID int64) (err error)
PruneTSLogOnce deletes old ts_logs data.
func (*Application) PruneTSMetricOnce ¶
func (app *Application) PruneTSMetricOnce(clusterID int64) (err error)
PruneTSMetricOnce deletes old ts_metrics data.
func (*Application) SendHeartbeat ¶
func (app *Application) SendHeartbeat()
SendHeartbeat every 30 seconds over message bus.