package
0.80.63
Repository: https://github.com/britannic/statping.git
Documentation: pkg.go.dev

# Packages

Package notifier contains the main functionality for the Statping Notification system Example Notifier Below is an example of a Notifier with multiple Form values to custom your inputs.

# Functions

AllCheckins returns all checkin in system.
AllIncidents will return all incidents and updates recorded.
AuthUser will return the User and a boolean if authentication was correct.
CheckHash returns true if the password matches with a hashed bcrypt password.
CloseDB will close the database connection if available.
CountFailures returns the total count of failures for all services.
CountUsers returns the amount of users.
DatabaseMaintence will automatically delete old records from 'failures' and 'hits' this function is currently set to delete records 7+ days old every 60 minutes.
Dbtimestamp will return a SQL query for grouping by date.
DefaultPort accepts a database type and returns its default port.
DeleteAllSince will delete a specific table's records based on a time.
DeleteConfig will delete the 'config.yml' file.
EnvToConfig converts environment variables to a DbConfig variable.
ExportChartsJs renders the charts for the index page.
ExportSettings will export a JSON file containing all of the settings below: - Core - Notifiers - Checkins - Users - Services - Groups - Messages.
GetLocalIP returns the non loopback local IP of the host.
GraphDataRaw will return all the hits between 2 times for a Service.
InitApp will initialize Statping.
InsertLargeSampleData will create the example/dummy services for testing the Statping server.
InsertNotifierDB inject the Statping database instance to the Notifier package.
InsertSampleData will create the example/dummy services for a brand new Statping installation.
InsertSampleHits will create a couple new hits for the sample services.
LoadConfigFile will attempt to load the 'config.yml' file in a specific directory.
LoadUsingEnv will attempt to load database configs based on environment variables.
NewCore return a new *core.Core struct.
ReturnCheckin converts *types.Checking to *core.Checkin.
ReturnCheckinHit converts *types.checkinHit to *core.checkinHit.
ReturnMessage will convert *types.Message to *core.Message.
ReturnService will convert *types.Service to *core.Service.
ReturnUser returns *core.User based off a *types.User.
SampleData runs all the sample data for a new Statping installation.
SelectAllUsers returns all users.
SelectCheckin will find a Checkin based on the API supplied.
SelectCore will return the CoreApp global variable and the settings/configs for Statping.
SelectGroup returns a *core.Group.
SelectGroups returns all groups.
SelectMessage returns a Message based on the ID passed.
SelectMessages returns all messages.
SelectService returns a *core.Service from in memory.
SelectServiceLink returns a *core.Service from the service permalink.
SelectServiceMessages returns all messages for a service.
No description provided by the author
SelectUser returns the User based on the User's ID.
SelectUsername returns the User based on the User's username.
No description provided by the author
UpdateCore will update the CoreApp variable inside of the 'core' table in database.

# Variables

Configs holds all of the config.yml and database info.
CoreApp is a global variable that contains many elements.
No description provided by the author
DbSession stores the Statping database session.
No description provided by the author
SetupMode will be true if Statping does not have a database connection.
VERSION is set on build automatically by setting a -ldflag.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
DateScan struct is for creating the charts.js graph JSON array.
DateScanObj struct is for creating the charts.js graph JSON array.
ErrorResponse is used for HTTP errors to show to User.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

DbConfig stores the config.yml file for the statup configuration.
GroupOrder will reorder the groups based on 'order_id' (Order).
No description provided by the author
No description provided by the author
ServiceOrder will reorder the services based on 'order_id' (Order).