Documentation ¶
Index ¶
- Constants
- func ClientError(w http.ResponseWriter, r *http.Request, status int)
- func NewHandlers(repo *DBRepo, a *config.AppConfig)
- func ServerError(w http.ResponseWriter, r *http.Request, err error)
- type ByHost
- type DBRepo
- func (repo *DBRepo) AdminDashboard(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) AllHealthyServices(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) AllHosts(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) AllPendingServices(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) AllProblemServices(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) AllUsers(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) AllWarningServices(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) Events(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) Host(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) ListEntries(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) Login(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) LoginScreen(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) Logout(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) OneUser(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) PostHost(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) PostOneUser(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) PostSettings(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) PusherAuth(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) ScheduledCheck(hostServiceID int)
- func (repo *DBRepo) SendPrivateMessage(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) SetSystemPref(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) Settings(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) StartMonitoring()
- func (repo *DBRepo) TestCheck(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) ToggleMonitoring(w http.ResponseWriter, r *http.Request)
- func (repo *DBRepo) ToggleServiceForHost(w http.ResponseWriter, r *http.Request)
Constants ¶
const ( // HTTP is the unencrypted web service check HTTP = 1 // HTTPS is the encrypted web service check HTTPS = 2 // SSLCertificate is ssl certificate check SSLCertificate = 3 )
Variables ¶
This section is empty.
Functions ¶
func ClientError ¶
func ClientError(w http.ResponseWriter, r *http.Request, status int)
ClientError will display error page for client error i.e. bad request
func NewHandlers ¶
NewHandlers creates the handlers
func ServerError ¶
func ServerError(w http.ResponseWriter, r *http.Request, err error)
ServerError will display error page for internal server error
Types ¶
type DBRepo ¶
type DBRepo struct { App *config.AppConfig DB repository.DatabaseRepo }
DBRepo is the db repo
var Repo *DBRepo
Repo is the repository
func NewPostgresqlHandlers ¶
NewPostgresqlHandlers creates db repo for postgres
func (*DBRepo) AdminDashboard ¶
func (repo *DBRepo) AdminDashboard(w http.ResponseWriter, r *http.Request)
AdminDashboard displays the dashboard
func (*DBRepo) AllHealthyServices ¶
func (repo *DBRepo) AllHealthyServices(w http.ResponseWriter, r *http.Request)
AllHealthyServices lists all healthy services
func (*DBRepo) AllHosts ¶
func (repo *DBRepo) AllHosts(w http.ResponseWriter, r *http.Request)
AllHosts displays list of all hosts
func (*DBRepo) AllPendingServices ¶
func (repo *DBRepo) AllPendingServices(w http.ResponseWriter, r *http.Request)
AllPendingServices lists all pending services
func (*DBRepo) AllProblemServices ¶
func (repo *DBRepo) AllProblemServices(w http.ResponseWriter, r *http.Request)
AllProblemServices lists all problem services
func (*DBRepo) AllUsers ¶
func (repo *DBRepo) AllUsers(w http.ResponseWriter, r *http.Request)
AllUsers lists all admin users
func (*DBRepo) AllWarningServices ¶
func (repo *DBRepo) AllWarningServices(w http.ResponseWriter, r *http.Request)
AllWarningServices lists all warning services
func (*DBRepo) DeleteUser ¶
func (repo *DBRepo) DeleteUser(w http.ResponseWriter, r *http.Request)
DeleteUser soft deletes a user
func (*DBRepo) Events ¶
func (repo *DBRepo) Events(w http.ResponseWriter, r *http.Request)
Events displays the events page
func (*DBRepo) Host ¶
func (repo *DBRepo) Host(w http.ResponseWriter, r *http.Request)
Host shows the host add/edit form
func (*DBRepo) ListEntries ¶
func (repo *DBRepo) ListEntries(w http.ResponseWriter, r *http.Request)
ListEntries lists schedule entries
func (*DBRepo) Login ¶
func (repo *DBRepo) Login(w http.ResponseWriter, r *http.Request)
Login attempts to log the user in
func (*DBRepo) LoginScreen ¶
func (repo *DBRepo) LoginScreen(w http.ResponseWriter, r *http.Request)
LoginScreen shows the home (login) screen
func (*DBRepo) Logout ¶
func (repo *DBRepo) Logout(w http.ResponseWriter, r *http.Request)
Logout logs the user out
func (*DBRepo) OneUser ¶
func (repo *DBRepo) OneUser(w http.ResponseWriter, r *http.Request)
OneUser displays the add/edit user page
func (*DBRepo) PostHost ¶
func (repo *DBRepo) PostHost(w http.ResponseWriter, r *http.Request)
PostHost handles posting of host form
func (*DBRepo) PostOneUser ¶
func (repo *DBRepo) PostOneUser(w http.ResponseWriter, r *http.Request)
PostOneUser adds/edits a user
func (*DBRepo) PostSettings ¶
func (repo *DBRepo) PostSettings(w http.ResponseWriter, r *http.Request)
PostSettings saves site settings
func (*DBRepo) PusherAuth ¶
func (repo *DBRepo) PusherAuth(w http.ResponseWriter, r *http.Request)
PusherAuth authenticates the user to our pusher server
func (*DBRepo) ScheduledCheck ¶
ScheduledCheck performs a scheduled check on a host service by id
func (*DBRepo) SendPrivateMessage ¶
func (repo *DBRepo) SendPrivateMessage(w http.ResponseWriter, r *http.Request)
SendPrivateMessage is sample code for sending to private channel
func (*DBRepo) SetSystemPref ¶
func (repo *DBRepo) SetSystemPref(w http.ResponseWriter, r *http.Request)
SetSystemPref sets a given system preference to supplied value, and returns JSON response
func (*DBRepo) Settings ¶
func (repo *DBRepo) Settings(w http.ResponseWriter, r *http.Request)
Settings displays the settings page
func (*DBRepo) StartMonitoring ¶
func (repo *DBRepo) StartMonitoring()
StartMonitoring starts the monitoring process
func (*DBRepo) TestCheck ¶
func (repo *DBRepo) TestCheck(w http.ResponseWriter, r *http.Request)
TestCheck manually tests a host service and sends JSON response
func (*DBRepo) ToggleMonitoring ¶
func (repo *DBRepo) ToggleMonitoring(w http.ResponseWriter, r *http.Request)
ToggleMonitoring turns monitoring on and off
func (*DBRepo) ToggleServiceForHost ¶
func (repo *DBRepo) ToggleServiceForHost(w http.ResponseWriter, r *http.Request)
ToggleServiceForHost turns a host service on or off (active or inactive)