source: code/trunk/config/config.go@ 130

Last change on this file since 130 was 127, checked in by asciimoo, 5 years ago

[mod] create own module for config

File size: 569 bytes
Line 
1package config
2
3import (
4 "os"
5)
6
7type Config struct {
8 Debug bool
9 ListenAddress string
10 Key string
11 IPV6 bool
12 RequestTimeout uint
13}
14
15var DefaultConfig *Config
16
17func init() {
18 default_listen_addr := os.Getenv("MORTY_ADDRESS")
19 if default_listen_addr == "" {
20 default_listen_addr = "127.0.0.1:3000"
21 }
22 default_key := os.Getenv("MORTY_KEY")
23 DefaultConfig = &Config{
24 Debug: os.Getenv("DEBUG") != "false",
25 ListenAddress: default_listen_addr,
26 Key: default_key,
27 IPV6: true,
28 RequestTimeout: 5,
29 }
30}
Note: See TracBrowser for help on using the repository browser.