Documentation
¶
Overview ¶
Package sync provides file-watching and S3-syncing for static assets. It performs an initial one-shot upload of all files in a directory, then optionally watches for filesystem changes and syncs them continuously.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Key ¶
Key converts a filesystem path into an S3 object key relative to dir. Returns "" for paths that should be skipped (e.g. .gitkeep).
func SyncAll ¶
SyncAll performs a one-shot upload of every file under dir to the storage backend. If the store implements BucketEnsurer, the bucket is created first.
func WatchAndSync ¶
WatchAndSync watches dir for filesystem changes and syncs them to the storage backend. It blocks until ctx is cancelled or the watcher errors.
Types ¶
type BucketEnsurer ¶
BucketEnsurer is optionally implemented by storage backends that need their bucket created before first use (e.g. S3/RustFS in dev mode).