summary refs log tree commit diff stats
path: root/types.go
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-05 15:36:23 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-05 15:36:23 -0400
commitfd43c61bd128ad77b22db0537a9a4eb58490b0b5 (patch)
tree4c5fa7b33fadbf7c3e14e69b7d68ce280bc3810a /types.go
parent4658fe82be3e9d95e93fa5c7c7ca64a15cf2f1a1 (diff)
downloadgetwtxt-fd43c61bd128ad77b22db0537a9a4eb58490b0b5.tar.gz
moved bulk of code to its own package to clean up source tree
Diffstat (limited to 'types.go')
-rw-r--r--types.go67
1 files changed, 0 insertions, 67 deletions
diff --git a/types.go b/types.go
deleted file mode 100644
index b32edd3..0000000
--- a/types.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package main
-
-import (
-	"database/sql"
-	"sync"
-	"time"
-
-	"github.com/syndtr/goleveldb/leveldb"
-)
-
-// content-type consts
-const txtutf8 = "text/plain; charset=utf-8"
-const htmlutf8 = "text/html; charset=utf-8"
-const cssutf8 = "text/css; charset=utf-8"
-
-// 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"`
-}
-
-type dbLevel struct {
-	db *leveldb.DB
-}
-
-type dbSqlite struct {
-	db *sql.DB
-}
-
-type dbase interface {
-	push() error
-	pull()
-}
-
-// RemoteRegistries holds a list of remote registries to
-// periodically scrape for new users. The remote registries
-// must have been added via POST like a user.
-type RemoteRegistries struct {
-	Mu   sync.RWMutex
-	List []string
-}
-
-// ipCtxKey is the Context value key for user IP addresses
-type ipCtxKey int
-
-const ctxKey ipCtxKey = iota