xdg alternatives and similar packages
Based on the "Configuration" category.
Alternatively, view xdg alternatives based on common mentions on social networks and blogs.
-
koanf
Simple, extremely lightweight, extensible, configuration management library for Go. Support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper. -
konfig
Composable, observable and performant config handling for Go for the distributed processing era -
gookit/config
📝 Go configuration manage(load,get,set,export). support JSON, YAML, TOML, Properties, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名 -
gcfg
read INI-style configuration files into Go structs; supports user-defined types and subsections -
goConfig
DISCONTINUED. goconfig uses a struct as input and populates the fields of this struct with parameters from command line, environment variables and configuration file. -
joshbetz/config
🛠 A configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP. -
configuro
An opinionated configuration loading framework for Containerized and Cloud-Native applications. -
hocon
go implementation of lightbend's HOCON configuration library https://github.com/lightbend/config -
configure
Configure is a Go package that gives you easy configuration of your project through redundancy -
Genv
Genv is a library for Go (golang) that makes it easy to read and use environment variables in your projects. It also allows environment variables to be loaded from the .env file. -
swap
Instantiate/configure structs recursively, based on build environment. (YAML, TOML, JSON and env).
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of xdg or a related project?
Popular Comparisons
README
XDG
A cross platform package that tries to follow XDG Standard when possible. Since XDG is linux specific, I am only able to follow standards to the T on linux. But for the other operating systems I am finding similar best practice locations for the files.
Locations Per OS
The following table shows what is used if the envrionment variable is not set. If the variable is set then this package uses that. Linux follows the default standards. Mac does when it comes to the home directory but for system wide it uses the standard /Library/Application Support
. As for Windows, the variable defaults are just other environment variables set up by the operation system.
When creating
XDG
application theVendor
andApplication
names are appeneded to the end of the path to keep projects unique.
Linux(and BSD) | Mac | Windows | |
---|---|---|---|
XDG_DATA_DIRS |
[/usr/local/share , /usr/share ] |
[/Library/Application Support ] |
%PROGRAMDATA% |
XDG_DATA_HOME |
~/.local/share |
~/Library/Application Support |
%APPDATA% |
XDG_CONFIG_DIRS |
[/etc/xdg ] |
[/Library/Application Support ] |
%PROGRAMDATA% |
XDG_CONFIG_HOME |
~/.config |
~/Library/Application Support |
%APPDATA% |
XDG_CACHE_HOME |
~/.cache |
~/Library/Caches |
%LOCALAPPDATA% |
Notes
- This package does not merge files if they exist across different directories.
- The
Query
methods search through the system variables,DIRS
, first (when using environment variables first in the variable has presidence). It then checks home variables,HOME
. - This package will not create any directories for you. In the standard, it states the following:
If, when attempting to write a file, the destination directory is non-existant an attempt should be made to create it with permission
0700
. If the destination directory exists already the permissions should not be changed. The application should be prepared to handle the case where the file could not be written, either because the directory was non-existant and could not be created, or for any other reason. In such case it may chose to present an error message to the user.