feat: make server options a struct (#615)

This commit is contained in:
Henrique Dias authored and GitHub committed 2019-01-08 10:29:09 +00:00
1 parent 73b8d2ee7e
commit 0e7abaa7fb
13 files changed
+159 -90

No files matched your search

+11 -2
View File
@@ -8,8 +8,6 @@ type AuthMethod string
// Settings contain the main settings of the application.
type Settings struct {
Key []byte `json:"key"`
BaseURL string `json:"baseURL"`
Root string `json:"root"`
Signup bool `json:"signup"`
Defaults UserDefaults `json:"defaults"`
AuthMethod AuthMethod `json:"authMethod"`
@@ -19,6 +17,17 @@ type Settings struct {
Rules []rules.Rule `json:"rules"`
}
// Server specific settings.
type Server struct {
Root string `json:"root"`
BaseURL string `json:"baseURL"`
TLSKey string `json:"tlsKey"`
TLSCert string `json:"tlsCert"`
Port string `json:"port"`
Address string `json:"address"`
Log string `json:"log"`
}
// GetRules implements rules.Provider.
func (s *Settings) GetRules() []rules.Rule {
return s.Rules