paths

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package paths resolves Daisybell's on-disk layout. Everything Daisybell owns lives under one home directory (default ~/.daisybell) so that the managed browser and its profile are always isolated from the user's own browsers.

Index

Constants

View Source
const DefaultProfileName = "default"

DefaultProfileName is the profile used when neither --profile nor --profile-dir is given.

View Source
const EnvHome = "DAISYBELL_HOME"

EnvHome overrides the Daisybell home directory (default ~/.daisybell).

Variables

This section is empty.

Functions

func MapsKey

func MapsKey(name, dir string) string

MapsKey is the directory of a profile's site maps under Maps: the profile's name, or for a --profile-dir outside the profiles directory (no name) "dir-" and the first 12 hex digits of the SHA-256 of its absolute path, so two such directories never share a map and the path itself is not written anywhere.

func SystemBrowserProfile

func SystemBrowserProfile(dir string) (browser string, ok bool)

SystemBrowserProfile reports whether dir is, or lies inside, the user data directory of a system browser (Chrome, Edge, Brave, Arc, Vivaldi, Opera, Firefox, Safari…) and which one. SPEC §2.1: Daisybell never runs on the human's own browser profile, so --profile-dir there is refused. Matching ignores case (macOS and Windows file systems do) and follows symlinks when the directory exists.

func ValidName

func ValidName(name string) bool

ValidName reports whether name is a safe profile or session name: it becomes a directory or a file name, so lowercase letters, digits, - and _ only, at most 40, starting with a letter or a digit (no dots, no slashes, no "..").

func Within

func Within(home, dir string) bool

Within reports whether dir is home or lies inside it (after cleaning; symlinks are not resolved). --profile-dir outside the Daisybell home gets a warning.

Types

type Layout

type Layout struct {
	Home     string // ~/.daisybell
	Browsers string // ~/.daisybell/browsers/<version>/...
	Profiles string // ~/.daisybell/profiles/<name>
}

Layout is the set of directories Daisybell uses.

func Default

func Default() (Layout, error)

Default returns the layout rooted at $DAISYBELL_HOME or ~/.daisybell.

func FromHome

func FromHome(home string) Layout

FromHome returns the layout rooted at home.

func (Layout) DefaultProfile

func (l Layout) DefaultProfile() string

DefaultProfile is the persistent profile directory used when no --profile-dir is given.

func (Layout) Extension

func (l Layout) Extension() string

Extension holds the unpacked Cockpit extension builds (~/.daisybell/extension/<hash>).

func (Layout) Maps

func (l Layout) Maps() string

Maps holds the learned site maps, one directory per profile (~/.daisybell/maps/<profile key>/<host>.json, see MapsKey).

func (Layout) Profile

func (l Layout) Profile(name string) string

Profile is the directory of a named profile (~/.daisybell/profiles/<name>). The caller validates name with ValidName first.

func (Layout) Recordings

func (l Layout) Recordings() string

Recordings holds the session recordings (~/.daisybell/recordings/<session-id>).

func (Layout) Retouches

func (l Layout) Retouches() string

Retouches holds the per-site CSS the human kept (~/.daisybell/retouches/<host>.css).

func (Layout) Sessions

func (l Layout) Sessions() string

Sessions holds the saved sessions (~/.daisybell/sessions/<name>.json, 0600): plaintext cookies and localStorage, never inside a profile, a recording or a log.

Jump to

Keyboard shortcuts

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