-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig.go
31 lines (26 loc) · 813 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"log"
"github.com/BurntSushi/toml"
)
type Config struct {
InfoHost string `toml:"info_host"`
UpstreamDNS string `toml:"upstream_dns"`
Hosts []HostOptions `toml:"host"`
}
type HostOptions struct {
Name string `toml:"name"`
FromGoogleCache *bool `toml:"from_google_cache,omitempty"`
SocialReferer *bool `toml:"social_referer,omitempty"`
GooglebotUA *bool `toml:"googlebot_ua,omitempty"`
GooglebotIP *bool `toml:"googlebot_ip,omitempty"`
DisableCookies *bool `toml:"disable_cookies,omitempty"`
DisableJS *bool `toml:"disable_js,omitempty"`
InjectHTML *string `toml:"inject_html,omitempty"`
}
func parseConfigFile() {
_, err := toml.DecodeFile("config.toml", &config)
if err != nil {
log.Fatal(err)
}
}