Skip to main content

Module at_login

Module at_login 

Source
Expand description

Syncing from login (technical design): nibkeep-sync, a program without a window that starts when the person logs in, holds the sync role of the libraries they chose, as an app holds it while unlocked. Every NibKeep program reads and writes the list of those libraries alike, in the person’s folder of settings; the service follows it, and writes beside it what it does for each.

Modules§

app
What an app does with syncing from login (technical design): the switch, which has the copy of nibkeep-sync that the app ships beside its program sync a library whenever the person is logged in; and what the app does as it starts. Only on computers.

Structs§

AtLogin
The list of libraries to sync from login, and the copy of nibkeep-sync that serves them.
AtLoginStatus
What syncing from login does for a library, as a program shows it.
LoginEntry
The login entry that starts nibkeep-sync when the person logs in: the platform’s own, where the person finds the programs that start with their session. Each computer has one of its own, named as its folder of state is, so that a program that syncs dotfolders, or a roaming profile, never makes one computer’s turning off remove another’s.
Served
A library that the service syncs from login.
ServiceOptions
How the service runs.
ServiceStatus
What the service does for each library it serves, which it writes beside the list.
TurnedOff
What turning syncing from login off did.
TurnedOn
What turning syncing from login on did.

Enums§

EntryOutcome
What became of the login entry.
EntryState
What the login entry says.
ServiceEnded
Why the service ended.
Serving
What the service does for a library.

Constants§

ENGINE_VERSION
The engine’s version, which the engines file records of each program, and a copy of nibkeep-sync tells, so that the newest runs.
SERVICE_PROGRAM
What the service names itself in a replica’s records, and the name of its program.

Functions§

app_started
What an app does as it starts, where the list holds libraries and the login entry is on, or the platform has none: names own, its copy of nibkeep-sync, if the listed one is gone or older, pointing the login entry along; and returns the copy to start, if any: its own, just named, which waits for the one that runs to end, or the listed one, where none runs, as after a crash. Where the person turned the entry off, or removed it, it does nothing, so that the copy that runs, as one that turning on started, goes on.
name_own_copy
Names own, this program’s copy of nibkeep-sync, in the list, where the list names none, or one that is gone, as after its app was removed, or one older than own, as version_of tells of each; and points the login entry at it, if there is one, leaving it off if the person turned it off: whether it named it. A copy of the same version stays, so that two programs do not take it from each other, and so does one that does not tell its version in time, as one that a scanner of viruses holds up.
newer
Whether version a is newer than b, comparing their numbers in turn.
serve_at_login
Runs the service: takes the lock on sync-at-login.running, or waits for the copy that holds it while the list names this one; then holds the sync role of each library on the list, each on a thread of its own, following the list as it changes, and writes what it does for each, until stopped, or the list is empty or names another copy. now is the wall clock, and rng makes randomness for each thread.
service_running
Whether a copy of nibkeep-sync runs for the person: whether one holds the lock on sync-at-login.running, which this takes for a moment to tell.
service_version
The engine’s version that a copy of nibkeep-sync tells, or None if it tells none within a few seconds, as one that is gone.
settings_folder
This computer’s folder within NibKeep’s folder of state for the person, where the list and the files beside it are: in ~/.local/state/nibkeep on Linux (or $XDG_STATE_HOME/nibkeep), %LOCALAPPDATA%\NibKeep on Windows, which no roaming profile carries, and ~/Library/Application Support/NibKeep on macOS. It is named by a hash of the computer’s ID, so that a program that syncs the home folder between computers makes no two of them write the same file. Or the folder that NIBKEEP_STATE names, as tests name one. None where there is no home folder.
start_service
Starts a copy of nibkeep-sync, apart from this program, so that it runs on when this one ends.
status
What syncing from login does for the library in directory, or the one whose replica here is replica, as after its folder was named another way: as far as it can be read, for a program to show; a list that cannot be read counts as one without it. Of a library that is off, nothing more is read.
turn_off
Turns syncing from login off for the library in directory, or, if the list has none there, for replica, as after the library’s folder was moved. The service lets go of its role once it reads the list, and ends if it was the last. Once the list, written, holds no library, the login entry goes too, while the list is locked; so a later turning off removes an entry left by one that failed to. Where there is no list, nothing is written, and the entry is left alone.
turn_on
Turns syncing from login on for a library: adds it to the list; names own, this program’s copy of nibkeep-sync, if it is newer than the one listed, as version_of tells; and, once the list is written, makes the login entry start the listed copy, leaving it off if the person turned it off. The entry changes while the list is locked, so that turning another library off meanwhile never removes it. A login entry that cannot be made leaves the library on the list, and is told.

Type Aliases§

KeyringLocked
Whether the keystore holds its entry of a service and an account locked.
VersionOf
What tells the engine’s version of a copy of nibkeep-sync, as service_version does.