|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| None | __init__ (self, UserData ud) |
| dict | snapshot_micro (self, str user, str doc_id, Snapshot data) |
| list[dict] | list_micro (self, str user, str doc_id, int limit=50) |
| Snapshot|None | get_micro (self, str user, str doc_id, str version_id) |
| Snapshot|None | latest_micro (self, str user, str doc_id) |
| dict | create_release (self, str user, str doc_id, str label, Snapshot data) |
| list[dict] | list_releases (self, str user, str doc_id) |
| Snapshot|None | get_release (self, str user, str doc_id, str label) |
Protected Member Functions | |
| Path | _doc_dir (self, str user, str doc_id) |
| Path | _sub (self, str user, str doc_id, str name) |
Protected Attributes | |
| _ud = ud | |
Filesystem version history under ``<root>/<user>/<app>/<id>/``.
Definition at line 72 of file storage.py.
| None stardesign.storage.LocalBackend.__init__ | ( | self, | |
| UserData | ud ) |
Definition at line 75 of file storage.py.
|
protected |
|
protected |
Definition at line 81 of file storage.py.
References _doc_dir().
Referenced by create_release(), get_micro(), get_release(), list_micro(), list_releases(), and snapshot_micro().
| dict stardesign.storage.LocalBackend.create_release | ( | self, | |
| str | user, | ||
| str | doc_id, | ||
| str | label, | ||
| Snapshot | data ) |
Definition at line 133 of file storage.py.
References stardesign.storage._atomic_write(), stardesign.storage._now_iso(), and _sub().
| Snapshot | None stardesign.storage.LocalBackend.get_micro | ( | self, | |
| str | user, | ||
| str | doc_id, | ||
| str | version_id ) |
Definition at line 123 of file storage.py.
References stardesign.storage._read_json(), and _sub().
Referenced by latest_micro().
| Snapshot | None stardesign.storage.LocalBackend.get_release | ( | self, | |
| str | user, | ||
| str | doc_id, | ||
| str | label ) |
Definition at line 154 of file storage.py.
References stardesign.storage._read_json(), and _sub().
| Snapshot | None stardesign.storage.LocalBackend.latest_micro | ( | self, | |
| str | user, | ||
| str | doc_id ) |
Definition at line 129 of file storage.py.
References get_micro(), and list_micro().
| list[dict] stardesign.storage.LocalBackend.list_micro | ( | self, | |
| str | user, | ||
| str | doc_id, | ||
| int | limit = 50 ) |
Snapshots newest first. Sorted on ``st_mtime_ns`` then the id, not on the formatted ``savedAt``: two snapshots written in the same filesystem timestamp tick otherwise come back in whatever order ``glob`` happened to yield. The id carries a nanosecond prefix (see :meth:`snapshot_micro`), so it breaks that tie in real write order rather than arbitrarily. Ids written before that prefix existed are fully random, but they are older files whose mtimes already separate them from anything new.
Definition at line 99 of file storage.py.
References _sub().
Referenced by latest_micro().
| list[dict] stardesign.storage.LocalBackend.list_releases | ( | self, | |
| str | user, | ||
| str | doc_id ) |
Definition at line 140 of file storage.py.
References _sub().
| dict stardesign.storage.LocalBackend.snapshot_micro | ( | self, | |
| str | user, | ||
| str | doc_id, | ||
| Snapshot | data ) |
Definition at line 86 of file storage.py.
References stardesign.storage._atomic_write(), stardesign.storage._now_iso(), and _sub().
|
protected |
Definition at line 76 of file storage.py.
Referenced by _doc_dir().