configdir

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath added in v0.11.0

func DefaultPath() string

DefaultPath returns the platform-default config directory, ignoring any override. Exposed so callers (e.g. --dev mode) can derive a sibling dir.

func Path

func Path() string

Path returns the platform-appropriate configuration directory for kojo.

  • Override set via Set(): that path
  • Windows: %APPDATA%\kojo
  • Others: ~/.config/kojo

func Set added in v0.11.0

func Set(path string)

Set overrides the config directory path. Must be called at most once, before any subsystem accesses Path(). Subsequent calls are ignored so the resolved directory cannot change under a running process.

Types

type Lock added in v0.11.0

type Lock struct {
	// contains filtered or unexported fields
}

Lock holds an exclusive advisory lock on a kojo config directory. The lock is released by the kernel when the holding process exits (including on crash) or when Release is called explicitly.

func Acquire added in v0.11.0

func Acquire(dir string) (*Lock, error)

Acquire takes an exclusive, non-blocking advisory lock on <dir>/kojo.lock. Returns an error if another process currently holds the lock. The caller must call Release on shutdown.

func (*Lock) Release added in v0.11.0

func (l *Lock) Release() error

Release closes the lock file, releasing the advisory lock.

Jump to

Keyboard shortcuts

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