daemon

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package daemon runs the per-mount background sync loop and manages its lifecycle (detached start, pidfile, graceful stop).

The loop scans the working folder every scan-interval (cheap: size+mtime against the state cache) and talks to the remote every remote-interval — or immediately after local changes, so edits propagate quickly without hammering the object store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogPath

func LogPath(volDir string) string

func PidPath

func PidPath(volDir string) string

The volume store is keyed by the mount id, so exactly one daemon runs per mount and its pid/log live in the store dir.

func Run

func Run(folder string, scanInterval, remoteInterval time.Duration) error

Run is the daemon main loop, executed in the foreground of the (usually detached) `bdrive daemon run` process.

func Running

func Running(volDir string) (int, bool)

Running reports the daemon pid for a mount if one is alive.

func Start

func Start(folder, volDir string, scanInterval, remoteInterval time.Duration) (int, error)

Start launches a detached daemon for the folder (no-op if already running).

func Stop

func Stop(volDir string) (bool, error)

Stop terminates the daemon for a mount and waits for it to exit.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL