Documentation
¶
Overview ¶
Package datadir decides where the server keeps its database when --db is not given.
A database that silently lands in whatever folder the program was started from loses its history as soon as someone starts it from elsewhere. So, in order:
- --db, when given;
- the CIPHERHORIZON_DB environment variable;
- a cipherhorizon.db already in the working directory (where versions before 0.1.0 put it), so an upgrade never appears to lose data;
- the operating system's per-user data folder: Windows %LOCALAPPDATA%\CipherHorizon\cipherhorizon.db macOS ~/Library/Application Support/CipherHorizon/cipherhorizon.db Linux $XDG_DATA_HOME/cipherhorizon/cipherhorizon.db (~/.local/share/cipherhorizon/...)
Services and containers name the path explicitly (/var/lib/cipherhorizon, /data, %ProgramData%\CipherHorizon), so they never depend on this.
Index ¶
Constants ¶
const EnvVar = "CIPHERHORIZON_DB"
EnvVar names the environment variable that overrides the default location.
const File = "cipherhorizon.db"
File is the database's file name.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
DefaultPath is the per-user location, without creating anything (for help text).