{"id":13411228,"url":"https://github.com/OpenPeeDeeP/xdg","last_synced_at":"2025-03-14T16:34:17.741Z","repository":{"id":57483129,"uuid":"97854070","full_name":"OpenPeeDeeP/xdg","owner":"OpenPeeDeeP","description":"A cross platform package that follows the XDG Standard","archived":false,"fork":false,"pushed_at":"2020-10-19T13:34:26.000Z","size":27,"stargazers_count":80,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-31T20:45:14.909Z","etag":null,"topics":["golang","golang-package","xdg-compliance"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenPeeDeeP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-20T15:58:29.000Z","updated_at":"2024-05-10T05:00:39.000Z","dependencies_parsed_at":"2022-08-27T21:02:20.353Z","dependency_job_id":null,"html_url":"https://github.com/OpenPeeDeeP/xdg","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenPeeDeeP%2Fxdg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenPeeDeeP%2Fxdg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenPeeDeeP%2Fxdg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenPeeDeeP%2Fxdg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenPeeDeeP","download_url":"https://codeload.github.com/OpenPeeDeeP/xdg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243611006,"owners_count":20319068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","golang-package","xdg-compliance"],"created_at":"2024-07-30T20:01:12.302Z","updated_at":"2025-03-14T16:34:17.425Z","avatar_url":"https://github.com/OpenPeeDeeP.png","language":"Go","funding_links":[],"categories":["Configuration","配置","配置管理","\u003cspan id=\"组态-configuration\"\u003e组态 Configuration\u003c/span\u003e","配置管理 `配置解析库`","Uncategorized"],"sub_categories":["Standard CLI","Advanced Console UIs","标准CLI","标准 CLI","高级控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高級控制台界面"],"readme":"# XDG [![Build status](https://ci.appveyor.com/api/projects/status/9eoupq9jgsu2p0jv?svg=true)](https://ci.appveyor.com/project/dixonwille/xdg) [![Build Status](https://travis-ci.org/OpenPeeDeeP/xdg.svg?branch=master)](https://travis-ci.org/OpenPeeDeeP/xdg) [![Go Report Card](https://goreportcard.com/badge/github.com/OpenPeeDeeP/xdg)](https://goreportcard.com/report/github.com/OpenPeeDeeP/xdg) [![GoDoc](https://godoc.org/github.com/OpenPeeDeeP/xdg?status.svg)](https://godoc.org/github.com/OpenPeeDeeP/xdg) [![codecov](https://codecov.io/gh/OpenPeeDeeP/xdg/branch/master/graph/badge.svg)](https://codecov.io/gh/OpenPeeDeeP/xdg)\n\nA cross platform package that tries to follow [XDG Standard](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) 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.\n\n## Locations Per OS\n\nThe 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.\n\n\u003e When creating `XDG` application the `Vendor` and `Application` names are appeneded to the end of the path to keep projects unique.\n\n|  | Linux(and BSD) | Mac | Windows |\n| ---: | :---: | :---: | :---: |\n| `XDG_DATA_DIRS` | [`/usr/local/share`, `/usr/share`] | [`/Library/Application Support`] | `%PROGRAMDATA%` |\n| `XDG_DATA_HOME` | `~/.local/share` | `~/Library/Application Support` | `%APPDATA%` |\n| `XDG_CONFIG_DIRS` | [`/etc/xdg`] | [`/Library/Application Support`] | `%PROGRAMDATA%` |\n| `XDG_CONFIG_HOME` | `~/.config` | `~/Library/Application Support` | `%APPDATA%` |\n| `XDG_CACHE_HOME` | `~/.cache` | `~/Library/Caches` | `%LOCALAPPDATA%` |\n\n## Notes\n\n- This package does not merge files if they exist across different directories.\n- 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`.\n- This package will not create any directories for you. In the standard, it states the following:\n\n\u003e 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenPeeDeeP%2Fxdg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenPeeDeeP%2Fxdg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenPeeDeeP%2Fxdg/lists"}