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

Last change on this file since 133 was 132, checked in by asciimoo, 5 years ago

Merge pull request #76 from dalf/redirect

[mod] follow HTTP redirect (only GET HTTP method)

File size: 615 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 FollowRedirect bool
14}
15
16var DefaultConfig *Config
17
18func init() {
19 default_listen_addr := os.Getenv("MORTY_ADDRESS")
20 if default_listen_addr == "" {
21 default_listen_addr = "127.0.0.1:3000"
22 }
23 default_key := os.Getenv("MORTY_KEY")
24 DefaultConfig = &Config{
25 Debug: os.Getenv("DEBUG") != "false",
26 ListenAddress: default_listen_addr,
27 Key: default_key,
28 IPV6: true,
29 RequestTimeout: 5,
30 FollowRedirect: false,
31 }
32}
Note: See TracBrowser for help on using the repository browser.