turbobytes / geoipdb

GeoIP related related helper functions for TurboBytes stack
MIT License
0 stars 2 forks source link

Timeout #11

Closed coolparadox closed 7 years ago

coolparadox commented 7 years ago

@sajal The timeout branch was created on top of _static_iptest branch, so there are common commits at the beginning.

Fixes #5

coolparadox commented 7 years ago

As a side note, I could not find a quick solution for testing the timeout parameter. Should we open an issue for investigating a way of testing the library with delayed network access?

sajal commented 7 years ago

Yes make an issue for for it. We can circle back to it when figuring out http timing tests for CNC

sajal commented 7 years ago

func NewHandler(timeoutMS int64) (Handler, error)

Whenever accepting such input, please use type time.Duration . That way user can express it however they want instead of being forced to think in milliseconds.

coolparadox commented 7 years ago

Created #12 for testing timeouts

coolparadox commented 7 years ago

@sajal Back using time.Duration in NewHandler().

Moreover, when a value zero is passed as timeout, it now means "no timeout", as it's the default behaviour for http.Client and dns.Client.