Documentation
¶
Overview ¶
Package platformdir resolves the OS-conventional per-user directories for GoModel's durable data and caches, used when no explicit path is configured. Binary installs (install.sh / Homebrew / install.ps1) run from arbitrary working directories, so CWD-relative defaults would scatter state; these follow each platform's convention instead.
Index ¶
Constants ¶
const LocalDataDir = "data"
LocalDataDir is the project-local data directory. Deployments that already have one — the Docker image, anyone running from a checkout — keep their state there, so upgrades never move a database or a pid file out from under an operator.
Variables ¶
This section is empty.
Functions ¶
func CacheDir ¶
CacheDir returns the directory for re-creatable caches such as the model catalog:
Linux $XDG_CACHE_HOME/gomodel (default ~/.cache/gomodel) macOS ~/Library/Caches/gomodel Windows %LocalAppData%\gomodel\cache
func DataDir ¶
DataDir returns the directory for durable application data such as the SQLite database:
Linux $XDG_DATA_HOME/gomodel (default ~/.local/share/gomodel) macOS ~/Library/Application Support/gomodel Windows %LocalAppData%\gomodel
func DataFile ¶ added in v0.1.68
DataFile returns where a durable data file called name belongs: inside LocalDataDir when that directory exists next to the process, otherwise inside DataDir. Callers share this rule so a deployment's files stay together instead of some landing project-local and others in the per-user directory.
The local form is spelled with a forward slash on every platform, which Windows accepts, so it stays comparable to the legacy path constants built the same way.
Types ¶
This section is empty.