Last active
July 8, 2020 12:44
-
-
Save bschaeffer/d8ddc8ef4fc5b40db8db1dcf675946e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type httpClient struct { | |
stats outputs.Observer | |
endpoint string | |
client *http.Client | |
} | |
func (h *httpClient) String() string { | |
return "fshttp" | |
} | |
func (h *httpClient) Connect() error { | |
h.client = &http.Client{ | |
Timeout: 2 * time.Second, | |
Transport: &http.Transport{ | |
Dial: (&net.Dialer{Timeout: 2 * time.Second}).Dial, | |
}, | |
} | |
return nil | |
} | |
func (h *httpClient) Close() error { | |
h.client = nil | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment