Initial dumb servers

This commit is contained in:
Bel LaPointe
2019-03-14 14:43:02 -06:00
commit 1f679f4c06
10 changed files with 381 additions and 0 deletions

34
server/config/config.go Normal file
View File

@@ -0,0 +1,34 @@
package config
import (
"fmt"
"local/storage"
"sync"
)
var config Config
var lock = &sync.RWMutex{}
type Config struct {
db string
DB storage.DB
Port string
Addr string
Username string
Password string
}
func Values() Config {
lock.RLock()
defer lock.RUnlock()
return config
}
func (c Config) String() string {
return fmt.Sprintf(
"port:%v db:%v addr:%v user:*** pass:***",
c.Port,
c.db,
c.Addr,
)
}