Skip to main content

Crate borg_web

Crate borg_web 

Source
Expand description

borg web [--port 7979] [--dir DIR]: a live page of the collective’s knowledge and usage statistics, on 127.0.0.1 only.

It reads the stores the way borg top does (files, no IPC with borg mesh serve), so local collectives show too. /api/events is a server-sent event stream: a 1 s watch on the store files tells the page which views changed, and the page refetches only those. Once a minute it publishes this node’s daily rollups (borg stats.rs) so the mesh can spread them.

/api/update is borg itself: this borg’s version, the last release check (borg update.rs), and the members by version with what an older protocol misses (borg protocol.rs). The page shows a banner from it when a newer release exists or a member’s protocol differs from this node’s.

The binary (main.rs) parses the command line and serves router; tests drive it in process.

Modules§

learning
/api/learning: whether learning works in this collective, week by week, from the logs Borg keeps anyway (no state of its own, so the history is there from the first view).

Structs§

App
Mind
One collective the page can show.

Constants§

USAGE

Functions§

minds
Every collective on this machine, and the one dir routes to (else the first).
publish
Publishes this node’s rollups and redacted outcomes of every collective once a minute (stats.rs rollup, outcome.rs publish).
router
update_view
What /api/update serves for the collective name at home: this borg (borg, its mesh protocol protocol), the last release check (latest, checked_ms, error; all null before the first) and whether its release is newer (update, false while check is off: BORG_UPDATE_CHECK=off), then the members this node knows of. Each member has its key, its engineer when known and name (the engineer, else its short key), borg (null: older than 0.7, it sent none), the protocol its last session agreed on, syncs (false: nothing syncs with it, it speaks a protocol this node does not) and note: what it misses on an older protocol (protocol.rs NOTES), or why nothing syncs; null on this node’s footing. Without mesh/ there are no members.