summaryrefslogtreecommitdiff
path: root/app/struct.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/struct.go')
-rw-r--r--app/struct.go92
1 files changed, 92 insertions, 0 deletions
diff --git a/app/struct.go b/app/struct.go
new file mode 100644
index 0000000..80d6bf2
--- /dev/null
+++ b/app/struct.go
@@ -0,0 +1,92 @@
+package main
+
+import (
+ "time"
+)
+
+type User struct {
+ Id int64
+ Email string `sql:"unique"`
+ Name string `sql:"unique"`
+ Password string
+ Confirmed bool
+ ConfirmationKey string
+ Alerts []Alert
+ CreatedAt time.Time
+ DeletedAt time.Time
+ UpdatedAt time.Time
+}
+
+// Multiple accounts which are alerted
+type Alert struct {
+ Id int64
+ UserId int64
+ Email string
+ CreatedAt time.Time
+ DeletedAt time.Time
+ UpdatedAt time.Time
+}
+
+type Job struct {
+ Id int64
+ UserId int64
+ Name string
+ Url string
+ Versions []Version
+ Diff string
+ DiffLen int64
+ CreatedAt time.Time
+ DeletedAt time.Time
+ UpdatedAt time.Time
+}
+
+// Save history version of jobs
+type Version struct {
+ Id int64
+ JobId int64
+ Content string
+ Hash string
+ CreatedAt time.Time
+ DeletedAt time.Time
+ UpdatedAt time.Time
+}
+
+/* Maybe worth saving uptime history? */
+
+/*
+type Host struct {
+ Id int64
+ Host string
+ Url string
+ // Protocoll string // e.g. http
+ Monitored bool // disable monitoring on error
+ Private bool
+ Status string
+ StatusCode int64
+ Success bool
+ Reason string // Connection failure
+ Description string
+ /*
+ Date time.Time
+ Include string // Website must include this string
+ Except string // Website must not include this string
+ Alert bool // True to send alert on failure
+ DeletedAt time.Time
+*/
+/*
+ CreatedAt time.Time
+ UpdatedAt time.Time
+ Class string
+}
+*/
+
+/*
+type Messages struct {
+ Success []interface{}
+ Error []interface{}
+ Hosts []Host
+ moreScripts []string
+ NextRun time.Time
+ Sticky string
+}
+*/