go-plex-client
go-plex-client copied to clipboard
Make timeout configurable for all HTTP calls
Rather than hardcoding the timeout (3 seconds), seems like a good idea to make this parameter configurable depending on the client needs.
You can change it by accessing Plex.HTTPClient.Timeout
directly. Like so:
plexConn, _ := plex.New("abc", "123")
plexConn.HTTPClient.Timeout = time.Minute * 1
But yeah, what's the best way to change the parameters? Like just add an extra argument? plex.New("abc", "123", 1 * time.Minute)
@jrudio Not sure if it would be useful to just allow clients to configure the timeout. What you think about allowing clients to pass the whole http.Client
reference?