Go implementation of the XDG Base Directory Specification and XDG user directories

Overview

xdg

Build Status Code coverage pkg.go.dev documentation MIT license Awesome Go Go report card GitHub issues Buy me a coffee

Provides an implementation of the XDG Base Directory Specification. The specification defines a set of standard paths for storing application files, including data and configuration files. For portability and flexibility reasons, applications should use the XDG defined locations instead of hardcoding paths.

The package also includes the locations of well known user directories and an implementation of the state directory proposal. Windows, macOS and most flavors of Unix are supported.

Full documentation can be found at: https://pkg.go.dev/github.com/adrg/xdg.

Installation

go get github.com/adrg/xdg

Default locations

The package defines sensible defaults for XDG variables which are empty or not present in the environment.

XDG Base Directory

Unix macOS Windows
XDG_DATA_HOME ~/.local/share ~/Library/Application Support %LOCALAPPDATA%
XDG_DATA_DIRS /usr/local/share
/usr/share
/Library/Application Support %APPDATA%\Roaming
%PROGRAMDATA%
XDG_CONFIG_HOME ~/.config ~/Library/Preferences %LOCALAPPDATA%
XDG_CONFIG_DIRS /etc/xdg /Library/Preferences %PROGRAMDATA%
XDG_CACHE_HOME ~/.cache ~/Library/Caches %LOCALAPPDATA%\cache
XDG_RUNTIME_DIR /run/user/UID ~/Library/Application Support %LOCALAPPDATA%

XDG user directories

Unix macOS Windows
XDG_DESKTOP_DIR ~/Desktop ~/Desktop %USERPROFILE%/Desktop
XDG_DOWNLOAD_DIR ~/Downloads ~/Downloads %USERPROFILE%/Downloads
XDG_DOCUMENTS_DIR ~/Documents ~/Documents %USERPROFILE%/Documents
XDG_MUSIC_DIR ~/Music ~/Music %USERPROFILE%/Music
XDG_PICTURES_DIR ~/Pictures ~/Pictures %USERPROFILE%/Pictures
XDG_VIDEOS_DIR ~/Videos ~/Movies %USERPROFILE%/Videos
XDG_TEMPLATES_DIR ~/Templates ~/Templates %USERPROFILE%/Templates
XDG_PUBLICSHARE_DIR ~/Public ~/Public %PUBLIC%

Non-standard directories

State directory

Unix
  • ~/.local/state
macOS
  • ~/Library/Application Support
Windows
  • %LOCALAPPDATA%

Application directories

Unix
  • $XDG_DATA_HOME/applications
  • ~/.local/share/applications
  • /usr/local/share/applications
  • /usr/share/applications
  • $XDG_DATA_DIRS/applications
macOS
  • /Applications
Windows
  • %APPDATA%\Roaming\Microsoft\Windows\Start Menu\Programs

Font directories

Unix
  • $XDG_DATA_HOME/fonts
  • ~/.fonts
  • ~/.local/share/fonts
  • /usr/local/share/fonts
  • /usr/share/fonts
  • $XDG_DATA_DIRS/fonts
macOS
  • ~/Library/Fonts
  • /Library/Fonts
  • /System/Library/Fonts
  • /Network/Library/Fonts
Windows
  • %windir%\Fonts
  • %LOCALAPPDATA%\Microsoft\Windows\Fonts

Usage

XDG Base Directory

package main

import (
	"log"

	"github.com/adrg/xdg"
)

func main() {
	// XDG Base Directory paths.
	log.Println("Home data directory:", xdg.DataHome)
	log.Println("Data directories:", xdg.DataDirs)
	log.Println("Home config directory:", xdg.ConfigHome)
	log.Println("Config directories:", xdg.ConfigDirs)
	log.Println("Cache directory:", xdg.CacheHome)
	log.Println("Runtime directory:", xdg.RuntimeDir)

	// Non-standard directories.
	log.Println("Home state directory:", xdg.StateHome)
	log.Println("Application directories:", xdg.ApplicationDirs)
	log.Println("Font directories:", xdg.FontDirs)

	// Obtain a suitable location for application config files.
	// ConfigFile takes one parameter which must contain the name of the file,
	// but it can also contain a set of parent directories. If the directories
	// don't exist, they will be created relative to the base config directory.
	configFilePath, err := xdg.ConfigFile("appname/config.yaml")
	if err != nil {
		log.Fatal(err)
	}
	log.Println("Save the config file at:", configFilePath)

	// For other types of application files use:
	// xdg.DataFile()
	// xdg.CacheFile()
	// xdg.RuntimeFile()
	// xdg.StateFile()

	// Finding application config files.
	// SearchConfigFile takes one parameter which must contain the name of
	// the file, but it can also contain a set of parent directories relative
	// to the config search paths (xdg.ConfigHome and xdg.ConfigDirs).
	configFilePath, err = xdg.SearchConfigFile("appname/config.yaml")
	if err != nil {
		log.Fatal(err)
	}
	log.Println("Config file was found at:", configFilePath)

	// For other types of application files use:
	// xdg.SearchDataFile()
	// xdg.SearchCacheFile()
	// xdg.SearchRuntimeFile()
	// xdg.SearchStateFile()
}

XDG user directories

package main

import (
	"log"

	"github.com/adrg/xdg"
)

func main() {
	// XDG user directories.
	log.Println("Desktop directory:", xdg.UserDirs.Desktop)
	log.Println("Download directory:", xdg.UserDirs.Download)
	log.Println("Documents directory:", xdg.UserDirs.Documents)
	log.Println("Music directory:", xdg.UserDirs.Music)
	log.Println("Pictures directory:", xdg.UserDirs.Pictures)
	log.Println("Videos directory:", xdg.UserDirs.Videos)
	log.Println("Templates directory:", xdg.UserDirs.Templates)
	log.Println("Public directory:", xdg.UserDirs.PublicShare)
}

Stargazers over time

Stargazers over time

Contributing

Contributions in the form of pull requests, issues or just general feedback, are always welcome.
See CONTRIBUTING.MD.

Contributors: adrg, wichert, bouncepaw, gabriel-vasile, KalleDK.

References

For more information see:

License

Copyright (c) 2014 Adrian-George Bostan.

This project is licensed under the MIT license. See LICENSE for more details.

Comments
  • Fix link and socket detection in search methods

    Fix link and socket detection in search methods

    Since we don't use the result and only want to know if the target exists, we can do even less processing of the target by using Lstat. That is, don't resolve links, don't call file relevant stat methods on non-files like sockets, etc. Just check if they exist. This specifically resolves an issue with os.Stat returning an error if the path is a Unix domain socket, on Windows (despite the path being valid and usable).

    For example, this: https://github.com/golang/go/issues/33357#issuecomment-516847781 will return CreateFile server.sock: The file cannot be accessed by the system. While changing to Lstat returns information on the target without error. I'm experiencing this same issue with my own Go program which is creating and using valid Unix sockets, but they're not being found by xdg.SearchRuntimeFile, xdg.SearchConfigFile, etc.

    This specific issue with Stat may need to be fixed upstream, but using Lstat here may still make sense for symlinks, and other types. *(Unless this goes against some xdg expectation, I'm not sure)

    opened by djdv 14
  • Added XDG_STATE_HOME

    Added XDG_STATE_HOME

    XDG_STATE_HOME is to enable people to split mutable and immutable data, such that immutable date stays in XDG_DATA_HOME, but applications can use XDG_STATE_HOME to store what normally would be stored in /var/lib/app

    Better description of the problem https://github.com/ayekat/dotfiles/issues/30

    Links

    • https://wiki.debian.org/XDGBaseDirectorySpecification#Proposal:_STATE_directory
    • https://lists.freedesktop.org/pipermail/xdg/2009-February/010191.html
    • https://lists.freedesktop.org/pipermail/xdg/2012-December/012598.html
    • https://lists.freedesktop.org/archives/xdg/2016-December/013803.html
    • ActiveState/appdirs@ea0701d

    … and more! (search the web for XDG_STATE_HOME)

    opened by KalleDK 6
  • Internal improvements

    Internal improvements

    • Add workaround for os.Stat bugs on Windows, described by issues:
      • https://github.com/golang/go/issues/33357
      • https://github.com/microsoft/Windows-Containers/issues/97
      • https://github.com/golang/go/issues/34900
    • Enable build for js/wasm
    • Minor internal refactoring
    • Improve testing

    On some versions of Windows, os.Stat returns an error for Unix sockets. Also, seems like on all Windows versions, it returns an error for symbolic links to directories.

    opened by adrg 4
  • Support more XDG directories

    Support more XDG directories

    Please also support those directories:

    • USER_DIRECTORY_DESKTOP
    • USER_DIRECTORY_DOCUMENTS
    • USER_DIRECTORY_DOWNLOAD
    • USER_DIRECTORY_MUSIC
    • USER_DIRECTORY_PICTURES
    • USER_DIRECTORY_PUBLIC_SHARE
    • USER_DIRECTORY_TEMPLATES
    • USER_DIRECTORY_VIDEOS
    • USER_N_DIRECTORIES
    opened by probonopd 4
  • Plan 9 support

    Plan 9 support

    When building my project Mycorrhiza, a user complained that it doesn't build on Plan 9 operating system. From the error messages I understood that the problem is that initBaseDirs and initUserDirs is not implemented for Plan 9, I'd love to see that implemented.

    enhancement 
    opened by bouncepaw 3
  • createPath might be doing to much

    createPath might be doing to much

    We should check if that path exists, as we shouldn't create this "part" of the folder imho.

    As in all the folders in the name variable is okay to create, but the folders in the paths could be system folders.

    A "constructed" case would be a root user running a program with this, might end up creating /usr/local/share, even if /usr/share is the only path there.

    I understand that this would create a problem with paths like ~/.local/state as that wouldn't be created, and I could see a reason for that to be created.

    A solution to this might be a few functions to create the XDG_BASE places, and let createPath only handle the relative part.

    func main() {
      // For homes that we need to create files in
      xdg.CreateCacheHome()
      xdg.CreateConfigHome()
    }
    

    https://github.com/adrg/xdg/blob/aad56aee3b6d35da74f30725a6c356560a61f1cd/utils.go#L63-L71

    opened by KalleDK 3
  • Remove might be a bit to harsh

    Remove might be a bit to harsh

    https://github.com/adrg/xdg/blob/aad56aee3b6d35da74f30725a6c356560a61f1cd/base_dirs.go#L57-L60

    Shouldn't this just give an error? It feels like deleting a file without "consent" is a bit harsh.

    opened by KalleDK 3
  • Bump github.com/stretchr/testify from 1.8.0 to 1.8.1

    Bump github.com/stretchr/testify from 1.8.0 to 1.8.1

    Bumps github.com/stretchr/testify from 1.8.0 to 1.8.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies go 
    opened by dependabot[bot] 2
  • Bump github.com/stretchr/testify from 1.7.4 to 1.7.5

    Bump github.com/stretchr/testify from 1.7.4 to 1.7.5

    Bumps github.com/stretchr/testify from 1.7.4 to 1.7.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies go 
    opened by dependabot[bot] 2
  • Bump github.com/stretchr/testify from 1.7.1 to 1.7.3

    Bump github.com/stretchr/testify from 1.7.1 to 1.7.3

    Bumps github.com/stretchr/testify from 1.7.1 to 1.7.3.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies go 
    opened by dependabot[bot] 2
  • Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bumps github.com/stretchr/testify from 1.7.1 to 1.7.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies go 
    opened by dependabot[bot] 2
  • Fix #29: Parse ~/.config/user-dirs.dirs file

    Fix #29: Parse ~/.config/user-dirs.dirs file

    Read ~/.config/user-dirs.dirs if exist, inject in env var if not already present

    Test TestDefaultUserDirs will fail if localized file found.

    Workaround without this merge:

    func LoadlinuxXDG() {
    	var (
    		homeDir string
    		err     error
    	)
    
    	if homeDir, err = os.UserHomeDir(); err != nil {
    		fmt.Fprintln(os.Stderr, err)
    		return
    	}
    
    	userDirFile := path.Join(homeDir, ".config/user-dirs.dirs")
    
    	if _, err = os.Stat(userDirFile); err != nil {
    		return
    	}
    
    	cfg, err := ini.Load(userDirFile)
    	if err != nil {
    		return
    	}
    
    	// Load xdg env
    	for _, key := range cfg.Section("").Keys() {
    		value := strings.Replace(key.Value(), "$HOME", homeDir, 1)
    		os.Setenv(key.Name(), value)
    	}
    
    	xdg.Reload()
    }
    
    opened by ax1036 0
  • xdg: Add the hability to initialize a new BaseDir with different FS behind

    xdg: Add the hability to initialize a new BaseDir with different FS behind

    This allows to not only use the machine FS but any other supported by afero.Fs in this case.

    This is a PoC PR as I want to be sure this is a correct way to do it in your opinion, for me it looks clean and requires no changes for people already using this lib.

    The idea behind is to have the BaseDirectories be able to be initialized with an afero.Fs and make it public so anyone could choose what to do. By default the baseDir is initialized with afero.NewOsFs() which uses the stdlib of GO for os so it works as it worked before.

    Another solution would be to have a global variable with the FS to use but I really hate to use global variables for this things, and having a way to initialize different xdg with different FS makes it easy to use IMO.

    We could also make the variable BaseDir public or add a public function to change that value instead of having the New but I had the same feeling of global things not beeing that useful and easy to use/understand.

    If this changes where to be on the right way there are a few things still to be done:

    • Change all the test to use afero.NewMemMapFs which is an in-memory implementation of a FS, quite useful for testing.
    • Update the documentation
    • Potentially update the examples?

    Whenever you have time take a look and if it's ok I'll continue with the things I mention to finish or any other thing you may want or suggestion to change :).

    Closes #35

    opened by xescugc 1
  • Parse ~/.config/user-dirs.dirs file

    Parse ~/.config/user-dirs.dirs file

    I am testing this library using fedora and arch Linux and it seems like none of the distributions are setting the env vars for XDG User Directories.

    [a@localhost-live test]$ cat /home/a/.config/user-dirs.dirs
    # This file is written by xdg-user-dirs-update
    # If you want to change or add directories, just edit the line you're
    # interested in. All local changes will be retained on the next run.
    # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
    # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
    # absolute path. No other format is supported.
    # 
    XDG_DESKTOP_DIR="$HOME/Pulpit"
    XDG_DOWNLOAD_DIR="$HOME/Pobrane"
    XDG_TEMPLATES_DIR="$HOME/Szablony"
    XDG_PUBLICSHARE_DIR="$HOME/Publiczny"
    XDG_DOCUMENTS_DIR="$HOME/Dokumenty"
    XDG_MUSIC_DIR="$HOME/Muzyka"
    XDG_PICTURES_DIR="$HOME/Obrazy"
    XDG_VIDEOS_DIR="$HOME/Wideo"
    [a@localhost-live test]$ ./main 
    2022/02/04 18:14:32 Desktop directory: /home/a/Desktop
    2022/02/04 18:14:32 Download directory: /home/a/Downloads
    2022/02/04 18:14:32 Documents directory: /home/a/Documents
    2022/02/04 18:14:32 Music directory: /home/a/Music
    2022/02/04 18:14:32 Pictures directory: /home/a/Pictures
    2022/02/04 18:14:32 Videos directory: /home/a/Videos
    2022/02/04 18:14:32 Templates directory: /home/a/Templates
    2022/02/04 18:14:32 Public directory: /home/a/Public
    

    Firefox for example reads the ~/.config/user-dirs.dirs directly.

    [a@localhost-live test]$ cat firefox-strace | grep .config/user-dirs
    openat(AT_FDCWD, "/home/a/.config/user-dirs.dirs", O_RDONLY) = 53
    
    opened by mateusz834 5
  • Add base support for XDG base user executable dir

    Add base support for XDG base user executable dir

    https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

    There is a single base directory relative to which user-specific executable files may be written.

    User-specific executable files may be stored in $HOME/.local/bin.

    opened by scop 4
Releases(v0.4.0)
  • v0.4.0(Oct 27, 2021)

    Changelog

    Windows

    • Added support for Known Folders. Appropriate folders are now used as defaults for XDG environment variables which are not set.
    • Added more search directories for config files.
    • Added more search directories for applications.
    • The fallback path for templates is now %APPDATA%\Microsoft\Windows\Templates instead of the legacy %USERPROFILE%\Templates path.

    See https://github.com/adrg/xdg#default-locations for more details.

    Internal

    • Code coverage is now 100%.
    • Improved package structure.
    • Improved documentation.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.4(Sep 8, 2021)

  • v0.3.3(Apr 7, 2021)

    Changelog

    • Added workaround for os.Stat bugs on Windows, described by issues https://github.com/golang/go/issues/33357, https://github.com/microsoft/Windows-Containers/issues/97 and https://github.com/golang/go/issues/34900. On some Windows versions, os.Stat returns an error for valid socket files and for symbolic links to directories.
    • Enabled build for the js/wasm architecture
    • Minor internal refactoring
    • Improved testing
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Mar 10, 2021)

  • v0.3.1(Feb 22, 2021)

    Changelog

    • The default value for the XDG_CONFIG_HOME environment variable on macOS systems has been changed from ~/Library/Preferences to ~/Library/Application Support.
    • The default value for the XDG_CONFIG_DIRS environment variable on macOS systems has been changed from [/Library/Preferences] to [~/Library/Preferences, /Library/Application Support, /Library/Preferences].

    See more details regarding the change in PR https://github.com/adrg/xdg/pull/13.

    NOTE: the package will still find config files placed relative to the ~/Library/Preferences directory. However, if XDG_CONFIG_HOME is not set, it will suggest saving config files relative to the ~/Library/Application Support directory.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jan 13, 2021)

Tis module used as base fo configuration apps.By default, it expands into the inside of the application.

Tis module used as base fo configuration apps.By default, it expands into the inside of the application. Also, module c reads a dictionary of secrets from the application directory by its AppName and extension json.

LordTor 0 Dec 7, 2021
go implementation of lightbend's HOCON configuration library https://github.com/lightbend/config

HOCON (Human-Optimized Config Object Notation) Configuration library for working with the Lightbend's HOCON format. HOCON is a human-friendly JSON sup

Gürkan Kaymak 54 Dec 3, 2022
BDJuno (shorthand for BigDipper Juno) is the Juno implementation for BigDipper.

BDJuno BDJuno (shorthand for BigDipper Juno) is the Juno implementation for BigDipper. It extends the custom Juno behavior by adding different handler

Andrew Scott 1 Jan 28, 2022
Library providing routines to merge and validate JSON, YAML and/or TOML files

CONFLATE Library providing routines to merge and validate JSON, YAML, TOML files and/or structs (godoc) Typical use case: Make your application config

Andy 26 Sep 26, 2022
goconfig uses a struct as input and populates the fields of this struct with parameters from command line, environment variables and configuration file.

goconfig goconfig uses a struct as input and populates the fields of this struct with parameters from command line, environment variables and configur

Go Sidekick 2 Dec 15, 2022
⚙️ Dead Simple Config Management, load and persist config without having to think about where and how.

Configo Dead Simple Config Management, load and persist config without having to think about where and how. Install go get github.com/UltiRequiem/conf

Eliaz Bobadilla 8 Apr 6, 2022
Simple, useful and opinionated config loader.

aconfig Simple, useful and opinionated config loader. Rationale There are many solutions regarding configuration loading in Go. I was looking for a si

cristaltech 420 Dec 26, 2022
✨Clean and minimalistic environment configuration reader for Golang

Clean Env Minimalistic configuration reader Overview This is a simple configuration reading tool. It just does the following: reads and parses configu

Ilya Kaznacheev 857 Jan 8, 2023
An opinionated configuration loading framework for Containerized and Cloud-Native applications.

Opinionated configuration loading framework for Containerized and 12-Factor compliant applications. Read configurations from Environment Variables, an

Sherif Abdel-Naby 82 Dec 16, 2022
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.

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

Şakir Şensoy 31 Dec 21, 2022
go-up! A simple configuration library with recursive placeholders resolution and no magic.

go-up! A simple configuration library with placeholders resolution and no magic. go-up provides a simple way to configure an application from multiple

Francesco 39 Nov 23, 2022
Harvest configuration, watch and notify subscriber

Harvester Harvester is a configuration library which helps setting up and monitoring configuration values in order to dynamically reconfigure your app

Beat Labs 124 Dec 26, 2022
Package ini provides INI file read and write functionality in Go.

INI Package ini provides INI file read and write functionality in Go. Features Load from multiple data sources(file, []byte, io.Reader and io.ReadClos

INI 3.1k Dec 29, 2022
🛠 A configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP

config A small configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP. Example func main() {

Josh Betz 213 Dec 11, 2022
Composable, observable and performant config handling for Go for the distributed processing era

Konfig Composable, observable and performant config handling for Go. Written for larger distributed systems where you may have plenty of configuration

Lalamove 634 Dec 11, 2022
A better way to marshal and unmarshal YAML in Golang

YAML marshaling and unmarshaling support for Go Introduction A wrapper around go-yaml designed to enable a better way of handling YAML when marshaling

Sam Ghods 965 Jan 4, 2023
Manage local application configuration files using templates and data from etcd or consul

confd confd is a lightweight configuration management tool focused on: keeping local configuration files up-to-date using data stored in etcd, consul,

Kelsey Hightower 8k Dec 27, 2022
TOML parser and encoder library for Golang

TOML parser and encoder library for Golang TOML parser and encoder library for Golang. This library is compatible with TOML version v0.4.0. Installati

Naoya Inada 290 Oct 11, 2022