Help us shape the future of Go! Take the 2026 Go Developer Survey

platform

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package platform provides platform-specific configuration paths. On macOS: ~/Library/Application Support/git-treeline/ On Linux: $XDG_CONFIG_HOME/git-treeline/ (or ~/.config/) On Windows: %APPDATA%/git-treeline/

Set GTL_HOME to override the config directory entirely. This is useful for development/testing to avoid colliding with the installed binary.

Index

Constants

View Source
const (
	// DirMode is the permission for the git-treeline data directory.
	// Owner-only: the directory contains credentials (redis URLs) and
	// the registry that drives proxy routing.
	DirMode os.FileMode = 0o700

	// PrivateFileMode is the permission for files that may contain
	// credentials or routing state (config.json, registry.json).
	PrivateFileMode os.FileMode = 0o600
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

func ConfigFile

func ConfigFile() string

func DevSuffix

func DevSuffix() string

DevSuffix returns ".dev" when GTL_HOME is set, empty string otherwise. Used by the service layer to namespace LaunchAgent labels and pf anchors.

func EnsureConfigDir

func EnsureConfigDir() error

EnsureConfigDir creates the config directory with DirMode if it doesn't exist, and tightens permissions on an existing directory if it's too open.

func IsDevMode

func IsDevMode() bool

IsDevMode returns true when GTL_HOME is set, indicating this instance should use an isolated state directory.

func RegistryFile

func RegistryFile() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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