README.md
1# Tailer
2
3This directory contains the functionality for monitoring
4[remote files](https://docs.lnav.org/en/latest/usage.html#remote-files). The
5name "tailer" refers to the binary that is transferred to the remote host that
6takes care of tailing files and sending the contents back to the host that is
7running the main lnav binary. To ease integration with lnav's existing
8functionality, the remote files are mirrored locally. The tailer also
9supports interactive use by providing previews of file contents and
10TAB-completion possibilities.
11
12## Files
13
14The important files in this directory are:
15
16- [tailer.main.c](tailer.main.c) - The main() implementation for the tailer.
17- [tailer.looper.hh](tailer.looper.hh) - The service in the main lnav binary
18 that transfers tailers to hosts and communicates with them.
19- [tailer.h](tailer.h) and [tailerpp.hh](tailerpp.hh) - Utility libraries for
20 the tailer protocol.
21- tailer.ape - The [αcτµαlly pδrταblε εxεcµταblε](https://justine.lol/ape.html)
22 build of the tailer. This binary is produced by a GitHub Action and checked
23 in so the build process doesn't need to be supported on lots of platforms.
24
25## Flow
26
27When a remote-path is passed to lnav, the
28[file_collection.hh](../file_collection.hh) logic forwards the request to the
29`tailer::looper` service. This service makes two connections to the remote
30host using the `ssh` command so that the user's custom configurations will be
31used. The first connection is used to transfer the "tailer.ape" binary and
32make it executable. The second connection starts the tailer and uses
33stdin/stdout for a binary protocol and stderr for logging. The tailer then
34waits for requests to open files, preview files, and get possible paths for
35TAB-completions.
36