Skip to main content

Module client

Module client 

Source
Expand description

Handler of link checking operations.

This module defines two structs, Client and ClientBuilder. Client handles incoming requests and returns responses. ClientBuilder exposes a finer level of granularity for building a Client.

For convenience, a free function check is provided for ad-hoc link checks.

Structsยง

Client
Handles incoming requests and returns responses.
ClientBuilder
Builder for Client.

Constantsยง

CONNECT_TIMEOUT ๐Ÿ”’
A timeout for only the connect phase of a Client.
DEFAULT_MAX_REDIRECTS
Default number of redirects before a request is deemed as failed, 5.
DEFAULT_MAX_RETRIES
Default number of retries before a request is deemed as failed, 3.
DEFAULT_RETRY_WAIT_TIME_SECS
Default wait time in seconds between retries, 1.
DEFAULT_TIMEOUT_SECS
Default timeout in seconds before a request is deemed as failed, 20.
DEFAULT_USER_AGENT
Default user agent, lychee-<PKG_VERSION>.
TCP_KEEPALIVE ๐Ÿ”’
TCP keepalive.

Functionsยง

check
A shorthand function to check a single URI.
redirect_policy ๐Ÿ”’
Create our custom redirect::Policy in order to stop following redirects once max_redirects is reached and to record redirections for reporting.