Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client uses `userAgent` and `proxy` on all nequests throughout its life. If you need to change them, simply create a new Client. Please note that your can use this Client concurrently as long as the writer is cincurrent safe. But updating it's configuration is not concurrent safe.
func NewClient ¶
func NewClient(logger logrus.FieldLogger, config ...Conf) (httpClient *Client, err error)
NewClient will use `config` to setup the Client. See helpers.go to find out what you can use. If no configuration has passes, it behaves like a normal client.
func (*Client) NewRequest ¶
NewRequest creates the request object and sets the user-agent if is set
func (*Client) UpdateConf ¶
UpdateConf lets you update the configuration at runtime It panics if the conf variable is nil
type Conf ¶
type Conf func(client *Client)
Conf can be passed to NewClient for customizing the Client. (See helpers.go) You can set the following settings: proxy user-agent timeout
func SetFileOutput ¶
SetFileOutput writes the output to a file. It exits the program if the file is not writable This client does not close your file and you should do that yourself.
func SetProxy ¶
SetProxy can be passed to the NewClient to configure the proxy. Usage: NewClient(SetProxy(url))
func SetTimeout ¶
SetTimeout can be passed to the NewClient to configure connection timeout. Usage: NewClient(SetTimeout(timeout))
func SetUserAgent ¶
SetUserAgent can be passed to the NewClient to configure the user-agent string. Usage: NewClient(SetUserAgent(userAgent))
func SetWriter ¶
func SetWriter(w io.WriteCloser) Conf
SetWriter defined the output of the operation. The default is stdout. This client does not close your writer and you should do that yourself.