forked from cockpit-project/cockpit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This channel should support all of the existing usecases of both fslist1 and fswatch1, while presenting a significantly easier-to-consume API contained within a single channel. The core concept is that the state of a directory and all of its files can be represented with the value of a JSON document containing attributes about those files. When something changes, the document is modified. This works by sending RFC 7396 JSON Merge Patches as messages on the channel. This is the same format that we already use for manifest overrides. We add a somewhat evil extra helper alongside our current patch function, which does the same thing, but modifies-in-place and also modifies the provided patch, removing redundant information. This is done using JsonDocument/JsonDict, which makes it a bit harder to use from a typing standpoint, but prevents us from having to make copies of large sets of data when only one item has changed. There is no client API provided yet because this new channel type is only supported in the Python bridge, with no intent to add it to the C bridge. We're developing a client-side API as part of cockpit-navigator and will move it to `cockpit.js` when it's ready. Add many unit tests — coverage is nearly complete.
- Loading branch information
1 parent
a1a507c
commit 0bb7438
Showing
5 changed files
with
668 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.