pub struct ShepPaths {}Expand description
Resolved filesystem layout for one shep home
All paths are derived from $SHEP_HOME (default <home>/.shep); nothing
here touches the filesystem. The root itself is created by the CLI’s own
ensure_home, for the commands that need it before any daemon exists
(startup above all), and everything under it by
shep_daemon::boot::init_dirs on each boot.
Fields§
§home: PathBufRoot: $SHEP_HOME
daemon_config: PathBufDaemon config: shep.toml
dogs_config: PathBufA dog’s own settings: dogs.toml
Separate from Self::daemon_config rather than a section inside
it, so lookout can write a dog’s config without writing into the
daemon’s own hand-authored file.
snapshot: PathBufFlock snapshot (muster roll): flock.json
logs: PathBufLog directory
pids: PathBufPid-file directory
run: PathBufRuntime dir (sockets; created 0700)
socket: PathBufThe control address the client dials and the daemon answers on.
Unix: a filesystem path, run/shep.sock, naming a real AF_UNIX
socket file. Windows: Self::pipe_name, path-shaped but naming an
object in the kernel’s pipe namespace, not a file on any volume.
Never derive a directory from this field: socket.parent() is
meaningless on Windows. A pipe has no directory entry to watch, so
“has the daemon gone” needs a connect attempt there, not
Path::exists.
barks: PathBufBark history ring: barks.jsonl
kv: PathBufKey/value store: kv.json
overrides: PathBufOperator override store: overrides.json
secrets: PathBufSecret store: secrets.json
secrets_cache: PathBufCached provider values: secrets-cache.json
Derived and safe to delete, unlike Self::secrets: a provider dog
rewrites it on its next push.
Implementations§
Source§impl ShepPaths
impl ShepPaths
Sourcepub fn pipe_name(&self) -> String
pub fn pipe_name(&self) -> String
Windows named-pipe identity for this home:
\\.\pipe\shep-<sanitized>-<digest>
The sanitized stem is not unique alone: \, :, ., _ and a
literal - all collapse to -, so C:\a\b and C:\a-b sanitize to
one string. The digest of the full home path is what keeps two homes
distinct; without it a collision would not error, it would refuse the
second daemon as already running and let its CLI drive the first
home’s flock.
Changing this derivation breaks any already-running daemon: it stays bound under a name a client built afterward would never dial.
Sourcepub fn resolve(env: &dyn Fn(&str) -> Option<String>, home_dir: &Path) -> Self
pub fn resolve(env: &dyn Fn(&str) -> Option<String>, home_dir: &Path) -> Self
Resolves the layout from an environment lookup and the user’s home dir
Self::socket resolves per-platform: a socket file under run/ on
unix, Self::pipe_name on Windows. Everything else is identical.
Trait Implementations§
impl Eq for ShepPaths
impl StructuralPartialEq for ShepPaths
Auto Trait Implementations§
impl Freeze for ShepPaths
impl RefUnwindSafe for ShepPaths
impl Send for ShepPaths
impl Sync for ShepPaths
impl Unpin for ShepPaths
impl UnsafeUnpin for ShepPaths
impl UnwindSafe for ShepPaths
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.