Documentation ¶
Overview ¶
Uptime is a small, lightweight service that tracks the status of Rotational services and watches for outages. This package is intended to be a stand-alone service and has limited tests since it is not a mission critical application.
Index ¶
- func DateEqual(date1, date2 time.Time) bool
- type CSSColor
- type CSSIcon
- type IncidentContext
- type IncidentDayContext
- type Monitor
- type Server
- func (s *Server) Index(c *gin.Context)
- func (s *Server) NotAllowed(c *gin.Context)
- func (s *Server) NotFound(c *gin.Context)
- func (s *Server) Routes(router *gin.Engine) (err error)
- func (s *Server) Setup() (err error)
- func (s *Server) Started() (err error)
- func (s *Server) Stop(ctx context.Context) (err error)
- type ServiceGroupContext
- type ServiceStateContext
- type StatusPageContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IncidentContext ¶
type IncidentContext struct { Description string StartTime time.Time EndTime time.Time StatusColor CSSColor StatusIcon CSSIcon }
func (IncidentContext) TimeFormat ¶
func (i IncidentContext) TimeFormat() string
type IncidentDayContext ¶
type IncidentDayContext struct { Date time.Time Incidents []IncidentContext }
type Monitor ¶
Monitor wraps several service monitors to routinely conduct health checks and save the status (if changed) to the database.
func NewMonitor ¶
NewMonitor loads the services definition from the path on disk and creates monitors for each of them to perform heartbeat checks on the specified interval.
func (*Monitor) CheckStatus ¶
Check status executes the service status for the specified monitor, saves the status to disk if it has changed and creates any incidents if required. It then updates the service pointer to save the current status after all monitor checks have happened.
type Server ¶
func (*Server) NotAllowed ¶
type ServiceGroupContext ¶
type ServiceGroupContext struct { Title string ServiceStates []ServiceStateContext }
type ServiceStateContext ¶
type StatusPageContext ¶
type StatusPageContext struct { StatusMessage string StatusColor CSSColor ServiceGroups []ServiceGroupContext IncidentHistory []IncidentDayContext }
StatusPageContext is used to render the content into the index page for the uptime HTML status page (info page). Note that the template uses Bootstrap CSS classes for status colors and other properties, which is enforced using the CSSColor type.
Directories ¶
Path | Synopsis |
---|---|
Package health implements health check clients to return server system statuses.
|
Package health implements health check clients to return server system statuses. |
Package services provides an Info and Service data structure that is used for two purposes: loading configuration information from disk and storing status information in the database.
|
Package services provides an Info and Service data structure that is used for two purposes: loading configuration information from disk and storing status information in the database. |