Skip to content

Instantly share code, notes, and snippets.

@bschaeffer
Last active July 8, 2020 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bschaeffer/d8ddc8ef4fc5b40db8db1dcf675946e4 to your computer and use it in GitHub Desktop.
Save bschaeffer/d8ddc8ef4fc5b40db8db1dcf675946e4 to your computer and use it in GitHub Desktop.
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