appdirs

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package appdirs resolves vmflow-owned configuration locations without tying them to the executable directory.

Index

Constants

View Source
const (
	ConfigFilename    = "config.yaml"
	ManagedMarkerName = ".vmflow-managed"

	LinuxSystemConfigPath  = "/etc/vmflow/config.yaml"
	DarwinSystemConfigPath = "/Library/Application Support/vmflow/config.yaml"
	WindowsProgramData     = `C:\ProgramData`
)

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath(scope Scope) (string, error)

ConfigPath returns the canonical config path for scope on the current OS.

func IsCanonicalConfigPath

func IsCanonicalConfigPath(candidate string, scope Scope) bool

IsCanonicalConfigPath reports whether candidate is the current machine's canonical path for scope. It is used before placing an ownership marker so a custom -config directory is never claimed by vmflow.

func ManagedMarkerPath

func ManagedMarkerPath(configPath string) string

ManagedMarkerPath returns the ownership marker beside a config file.

func SystemConfigPath

func SystemConfigPath() (string, error)

SystemConfigPath returns the config path used by the native system service.

func UserConfigPath

func UserConfigPath() (string, error)

UserConfigPath returns the config path used by vmflow run and user-scoped initialization.

Types

type Scope

type Scope uint8

Scope identifies whether configuration belongs to a user-run process or to the machine-wide native service.

const (
	User Scope = iota
	System
)

Jump to

Keyboard shortcuts

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