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

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