summary refs log tree commit diff stats
path: root/svc/conf.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-06 15:25:02 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-08 02:29:17 -0400
commit469542518c4bb4db00774734c9cb257cd0050076 (patch)
treeed42f78dbc593102fc9b027962c465153e7d36d0 /svc/conf.go
parent3fe7510b7617780e6bcd7bd9a5575f11f59b6e15 (diff)
downloadgetwtxt-469542518c4bb4db00774734c9cb257cd0050076.tar.gz
moved type declarations into respective files
Diffstat (limited to 'svc/conf.go')
-rw-r--r--svc/conf.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/svc/conf.go b/svc/conf.go
index 4a75011..24ff305 100644
--- a/svc/conf.go
+++ b/svc/conf.go
@@ -6,12 +6,40 @@ import (
 	"os"
 	"path/filepath"
 	"strings"
+	"sync"
 	"time"
 
 	"github.com/fsnotify/fsnotify"
 	"github.com/spf13/viper"
 )
 
+// Configuration object definition
+type Configuration struct {
+	Mu            sync.RWMutex
+	Port          int           `yaml:"ListenPort"`
+	LogFile       string        `yaml:"LogFile"`
+	DBType        string        `yaml:"DatabaseType"`
+	DBPath        string        `yaml:"DatabasePath"`
+	AssetsDir     string        `yaml:"-"`
+	StdoutLogging bool          `yaml:"StdoutLogging"`
+	Version       string        `yaml:"-"`
+	CacheInterval time.Duration `yaml:"StatusFetchInterval"`
+	DBInterval    time.Duration `yaml:"DatabasePushInterval"`
+	LastCache     time.Time     `yaml:"-"`
+	LastPush      time.Time     `yaml:"-"`
+	Instance      `yaml:"Instance"`
+}
+
+// Instance refers to this specific instance of getwtxt
+type Instance struct {
+	Vers  string `yaml:"-"`
+	Name  string `yaml:"Instance.SiteName"`
+	URL   string `yaml:"Instance.URL"`
+	Owner string `yaml:"Instance.OwnerName"`
+	Mail  string `yaml:"Instance.Email"`
+	Desc  string `yaml:"Instance.Description"`
+}
+
 func initTemplates() *template.Template {
 	confObj.Mu.RLock()
 	assetsDir := confObj.AssetsDir