platformdir

package
v0.1.68 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 3 Imported by: 0

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

View Source
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

func CacheDir() (string, error)

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

func DataDir() (string, error)

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

func DataFile(name string) string

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.

Jump to

Keyboard shortcuts

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