mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
format code
This commit is contained in:
parent
f9bd43d299
commit
e421c27afc
@ -9,8 +9,9 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"golang.org/x/net/proxy"
|
||||
|
||||
"github.com/bitly/go-simplejson"
|
||||
"golang.org/x/net/proxy"
|
||||
)
|
||||
|
||||
func getCurrentIP(url string) (string, error) {
|
||||
@ -193,7 +194,7 @@ func postData(url string, content url.Values) (string, error) {
|
||||
}
|
||||
|
||||
values := generateHeader(content)
|
||||
req, _ := http.NewRequest("POST", "https://dnsapi.cn" + url, strings.NewReader(values.Encode()))
|
||||
req, _ := http.NewRequest("POST", "https://dnsapi.cn"+url, strings.NewReader(values.Encode()))
|
||||
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
req.Header.Set("User-Agent", fmt.Sprintf("GoDNS/0.1 (%s)", configuration.Email))
|
||||
|
18
settings.go
18
settings.go
@ -14,15 +14,15 @@ type Domain struct {
|
||||
|
||||
//Settings struct
|
||||
type Settings struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
LoginToken string `json:"login_token"`
|
||||
Domains []Domain `json:"domains"`
|
||||
IPUrl string `json:"ip_url"`
|
||||
LogPath string `json:"log_path"`
|
||||
LogSize int `json:"log_size"`
|
||||
LogNum int `json:"log_num"`
|
||||
Socks5Proxy string `json:"socks5_proxy"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
LoginToken string `json:"login_token"`
|
||||
Domains []Domain `json:"domains"`
|
||||
IPUrl string `json:"ip_url"`
|
||||
LogPath string `json:"log_path"`
|
||||
LogSize int `json:"log_size"`
|
||||
LogNum int `json:"log_num"`
|
||||
Socks5Proxy string `json:"socks5_proxy"`
|
||||
}
|
||||
|
||||
//LoadSettings -- Load settings from config file
|
||||
|
Loading…
x
Reference in New Issue
Block a user