From 218d04ca12051c4330156fc1f3290f27bb24c155 Mon Sep 17 00:00:00 2001 From: Horus_Arch Date: Thu, 12 Feb 2015 18:48:08 +0100 Subject: Initial commit. With basic database schema. --- app/controllers/app.go | 11 +++++++++++ app/controllers/db.go | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 app/controllers/app.go create mode 100644 app/controllers/db.go (limited to 'app/controllers') diff --git a/app/controllers/app.go b/app/controllers/app.go new file mode 100644 index 0000000..e76d76b --- /dev/null +++ b/app/controllers/app.go @@ -0,0 +1,11 @@ +package controllers + +import "github.com/revel/revel" + +type App struct { + *revel.Controller +} + +func (c App) Index() revel.Result { + return c.Render() +} diff --git a/app/controllers/db.go b/app/controllers/db.go new file mode 100644 index 0000000..f1ff18a --- /dev/null +++ b/app/controllers/db.go @@ -0,0 +1,37 @@ +package controllers + +import ( + "github.com/jinzhu/gorm" + _ "github.com/mattn/go-sqlite3" + "github.com/revel/revel" +) + +/* Maybe worth saving uptime history? */ + +type Hosts struct { + Id int64 + UserId int64 + Url string + Protocoll string // e.g. http + Private bool + Response int64 + Date time.Time + Success bool + Include string // Website must include this string + Except string // Website must not include this string + Reason string // Include, Exclude, Connection failure + Alert bool // True to send alert on failure + CreatedAt time.Time + DeletedAt time.Time + UpdatedAt time.Time +} + +type User struct { + Id int64 + Name string + Email string + Password string + CreatedAt time.Time + DeletedAt time.Time + UpdatedAt time.Time +} -- cgit v1.2.3