gofmt
parent
33872501cf
commit
00d2d6eb4e
4
etcd.go
4
etcd.go
|
@ -90,9 +90,9 @@ const (
|
||||||
const (
|
const (
|
||||||
ELECTIONTIMTOUT = 200 * time.Millisecond
|
ELECTIONTIMTOUT = 200 * time.Millisecond
|
||||||
HEARTBEATTIMEOUT = 50 * time.Millisecond
|
HEARTBEATTIMEOUT = 50 * time.Millisecond
|
||||||
|
|
||||||
// Timeout for internal raft http connection
|
// Timeout for internal raft http connection
|
||||||
// The original timeout for http is 45 seconds
|
// The original timeout for http is 45 seconds
|
||||||
// which is too long for our usage.
|
// which is too long for our usage.
|
||||||
HTTPTIMEOUT = time.Second
|
HTTPTIMEOUT = time.Second
|
||||||
)
|
)
|
||||||
|
|
|
@ -102,12 +102,12 @@ func (t transporter) GetLeaderClientAddress() string {
|
||||||
|
|
||||||
// Send server side POST request
|
// Send server side POST request
|
||||||
func (t transporter) Post(path string, body io.Reader) (*http.Response, error) {
|
func (t transporter) Post(path string, body io.Reader) (*http.Response, error) {
|
||||||
resp, err := t.client.Post(t.scheme + path, "application/json", body)
|
resp, err := t.client.Post(t.scheme+path, "application/json", body)
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send server side GET request
|
// Send server side GET request
|
||||||
func (t transporter) Get(path string) (*http.Response, error) {
|
func (t transporter) Get(path string) (*http.Response, error) {
|
||||||
resp, err := t.client.Get(t.scheme + path)
|
resp, err := t.client.Get(t.scheme + path)
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue