statping/types/types.go

50 lines
1.7 KiB
Go
Raw Normal View History

2018-08-16 06:22:20 +00:00
// Statup
// Copyright (C) 2018. Hunter Long and the project contributors
// Written by Hunter Long <info@socialeck.com> and the project contributors
//
// https://github.com/hunterlong/statup
//
// The licenses for most software and other practical works are designed
// to take away your freedom to share and change the works. By contrast,
// the GNU General Public License is intended to guarantee your freedom to
// share and change all versions of a program--to make sure it remains free
// software for all its users.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
2018-06-23 04:17:57 +00:00
package types
2018-06-30 00:57:05 +00:00
import (
"time"
)
// Hit struct is a 'successful' ping or web response entry for a service.
type Hit struct {
Id int64 `gorm:"primary_key;column:id"`
2018-09-12 04:14:22 +00:00
Service int64 `gorm:"column:service"`
Latency float64 `gorm:"column:latency"`
2018-10-02 07:26:49 +00:00
PingTime float64 `gorm:"column:ping_time"`
CreatedAt time.Time `gorm:"column:created_at"`
}
// DbConfig struct is used for the database connection and creates the 'config.yml' file
type DbConfig struct {
DbConn string `yaml:"connection"`
DbHost string `yaml:"host"`
DbUser string `yaml:"user"`
DbPass string `yaml:"password"`
DbData string `yaml:"database"`
2018-10-11 16:53:13 +00:00
DbPort int64 `yaml:"port"`
ApiKey string `yaml:"api_key"`
ApiSecret string `yaml:"api_secret"`
Project string `yaml:"-"`
Description string `yaml:"-"`
Domain string `yaml:"-"`
Username string `yaml:"-"`
Password string `yaml:"-"`
Email string `yaml:"-"`
Error error `yaml:"-"`
Location string `yaml:"location"`
}