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

Last change on this file since 146 was 142, checked in by Izuru Yakumo, 22 months ago

Rebrand to Yukari's Gap

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 1.0 KB
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 FollowRedirect bool
14 MaxConnsPerHost uint
15 UrlParameter string
16 HashParameter string
17}
18
19var DefaultConfig *Config
20
21func init() {
22 default_listen_addr := os.Getenv("YUKARI_ADDRESS")
23 if default_listen_addr == "" {
24 default_listen_addr = "127.0.0.1:3000"
25 }
26 default_url_parameter := os.Getenv("YUKARI_URL_PARAM")
27 if default_url_parameter == "" {
28 default_url_parameter = "yukariurl"
29 }
30 default_hash_parameter := os.Getenv("YUKARI_HASH_PARAM")
31 if default_hash_parameter == "" {
32 default_hash_parameter = "yukarihash"
33 }
34 default_key := os.Getenv("YUKARI_KEY")
35 DefaultConfig = &Config{
36 Debug: os.Getenv("DEBUG") != "false",
37 ListenAddress: default_listen_addr,
38 Key: default_key,
39 IPV6: true,
40 RequestTimeout: 5,
41 FollowRedirect: false,
42 MaxConnsPerHost: 4,
43 UrlParameter: default_url_parameter,
44 HashParameter: default_hash_parameter,
45 }
46}
Note: See TracBrowser for help on using the repository browser.