diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-05-20 23:01:13 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-05-21 03:42:18 -0400 |
commit | bd23ef0959496aba4c6fc8ca2b3969bbf17aa9d5 (patch) | |
tree | 7b388de8cdf89b6c1db180122678f5559aacdf9a /types.go | |
parent | df1d1efa19aed5bc6553c7c0a0b4b7dfe20e3bd0 (diff) | |
download | getwtxt-bd23ef0959496aba4c6fc8ca2b3969bbf17aa9d5.tar.gz |
added cache update / db push intervals to conf;
made confObj concurrency-safe via sync.RWMutex; new config values related to db/cache
Diffstat (limited to 'types.go')
-rw-r--r-- | types.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/types.go b/types.go index 018e26e..1aaf7a8 100644 --- a/types.go +++ b/types.go @@ -1,6 +1,9 @@ package main -import "sync" +import ( + "sync" + "time" +) // content-type consts const txtutf8 = "text/plain; charset=utf-8" @@ -9,10 +12,16 @@ const cssutf8 = "text/css; charset=utf-8" // config object definition type configuration struct { + mu sync.RWMutex port int - logfile string + logFile string + dbPath string stdoutLogging bool version string + cacheInterval time.Duration + dbInterval time.Duration + lastCache time.Time + lastPush time.Time Instance } |