mirror of
https://github.com/sstent/containers.git
synced 2026-01-25 16:41:51 +00:00
33 lines
615 B
Go
33 lines
615 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
type Config struct {
|
|
Debug bool
|
|
ListenAddress string
|
|
Key string
|
|
IPV6 bool
|
|
RequestTimeout uint
|
|
FollowRedirect bool
|
|
}
|
|
|
|
var DefaultConfig *Config
|
|
|
|
func init() {
|
|
default_listen_addr := os.Getenv("MORTY_ADDRESS")
|
|
if default_listen_addr == "" {
|
|
default_listen_addr = "127.0.0.1:3000"
|
|
}
|
|
default_key := os.Getenv("MORTY_KEY")
|
|
DefaultConfig = &Config{
|
|
Debug: os.Getenv("DEBUG") != "false",
|
|
ListenAddress: default_listen_addr,
|
|
Key: default_key,
|
|
IPV6: true,
|
|
RequestTimeout: 5,
|
|
FollowRedirect: false,
|
|
}
|
|
}
|