Expand description
Probes, sends, HTTP requests and file follows, run from where the software runs.
Panoramic copies the courier binary into each container and pod and runs it there through exec, so it reaches a
listener the way a peer would. A probe from outside proves nothing: the Docker port proxy accepts a connection even
when nothing listens inside. For host process groups, panoramic calls this library in-process instead.
The courier has four operations, and only four:
probe: whether something accepts a connection at atcp,httporgrpcaddress, whether a Unix socket exists and accepts, or whether a named pipe exists. A probe cannot confirm a UDP listener, so it refusesudp.send: opens one connection, or sends one datagram, and writes the bytes as given.http_get: makes one plain-HTTPGETrequest and returns the status and body. The courier does not speak TLS.follow: streams a log file’s contents as they are written, so an image needs neithershnortail.
§Addresses
An Address is written as the URL a consumer receives: tcp://<host>:<port>, udp://<host>:<port>,
http://<host>:<port>, grpc://<host>:<port>, unix://<path> for a stream socket, unixgram://<path> for a
datagram socket, and pipe://<name> for the named pipe \\.\pipe\<name> on Windows.
§Command line
courier --deadline <duration> probe <address>
courier --deadline <duration> send <address> [--payload-hex <hex>] < payload
courier --deadline <duration> http <address> [--path <path>]
courier --deadline <duration> follow <path>--deadline is required, and is a whole number with a unit: ms, s or m, as in 500ms, 10s or 2m. It
bounds the whole operation, including name resolution, but not reading the input of send or writing the output of
http. For follow, it is how long to follow: reaching it after the file was found is the normal end, even while
output is being written.
probewrites nothing to standard output.sendreads its payload from standard input until end of file, then writes it. With--payload-hex, the payload is the bytes its digits spell, and standard input is not read. It writes nothing to standard output.httprequests--path(default/) and writes the status code on one line, then the body exactly as received.followwaits for the file to exist, then writes its contents from the start, as they arrive.
The library’s limit is the same deadline, with one gap. Name resolution runs getaddrinfo on a blocking thread,
and the deadline abandons the lookup without stopping it, so the thread stays busy until the resolver answers. The
binary exits without waiting for it.
On failure, the courier writes one line to standard error, starting with courier: . Bad arguments instead get an
error and usage text on standard error.
§Exit codes
0: the operation completed. Forhttp, a response arrived, whatever its status.1: the software refused or is not there yet. A name does not resolve, nothing accepted, a read or write failed, the deadline passed, or an HTTP response was malformed. A peer’s name may not resolve until the peer starts.2: a harness problem. The arguments were bad, the operation does not support the address, or reading input or writing output failed.- Any other status, such as
101from a panic or none from a signal, is a harness problem.
Error::fault makes the same split for library callers.
Structs§
- Host
Port - A host name or IP address, and a port.
- Http
Response - A response to
http_get.
Enums§
- Address
- Where a courier operation goes, written as a URL.
- Error
- An error from a courier operation.
- Fault
- Who an
Errorblames.