pallet.crate.network-service documentation

Crate for working with network services

wait-for-http-status

[session url status & {:keys [max-retries standoff url-name cookie insecure ssl-version], :or {max-retries 5, standoff 2, url-name url}}]

Wait for a url to respond with the given HTTP status code.

Options: - :standoff time between checking HTTP status (seconds) - :max-retries number of times to test HTTP status before erroring - :url-name name of url to use in messages (defaults to url)

wait-for-port-listen

[session port & {:keys [max-retries standoff service-name], :or {max-retries 5, standoff 2, service-name (str "port " port)}}]

Wait for the network port port to be in a listening state.

Options: - :standoff time between checking port state (seconds) - :max-retries number of times to test port state before erroring - :service-name name of service to use in messages (defaults to port)

wait-for-port-response

[session port message response-regex & {:keys [host timeout max-retries standoff service-name], :or {host "localhost", max-retries 5, standoff 2, timeout 2, service-name (str "port " port)}}]

Wait for a port to respond to a message with a given response regex.

Options: - :host host to check (defaults to localhost) - :timeout time to wait for a response (default 2 secs) - :standoff time between checking HTTP status (seconds) - :max-retries number of times to test HTTP status before erroring - :service-name name of service to use in messages (defaults to port)