{"id":13411184,"url":"https://github.com/tucnak/store","last_synced_at":"2025-09-03T00:48:13.387Z","repository":{"id":53877232,"uuid":"43611359","full_name":"tucnak/store","owner":"tucnak","description":"A dead simple configuration manager for Go applications","archived":false,"fork":false,"pushed_at":"2023-07-14T15:44:13.000Z","size":13,"stargazers_count":276,"open_issues_count":4,"forks_count":21,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T05:08:46.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tucnak.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-10-03T19:17:28.000Z","updated_at":"2025-03-23T06:19:44.000Z","dependencies_parsed_at":"2024-01-08T14:30:53.336Z","dependency_job_id":"882c1475-eae3-44a3-95e9-168c401cbf45","html_url":"https://github.com/tucnak/store","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tucnak%2Fstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tucnak%2Fstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tucnak%2Fstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tucnak%2Fstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tucnak","download_url":"https://codeload.github.com/tucnak/store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445669,"owners_count":20939958,"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":[],"created_at":"2024-07-30T20:01:12.001Z","updated_at":"2025-04-06T07:11:24.544Z","avatar_url":"https://github.com/tucnak.png","language":"Go","funding_links":[],"categories":["配置","Configuration","配置管理","Uncategorized","\u003cspan id=\"组态-configuration\"\u003e组态 Configuration\u003c/span\u003e"],"sub_categories":["标准CLI","Standard CLI","Advanced Console UIs","高级控制台界面","标准 CLI","高級控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# Store\n\u003eStore is a dead simple configuration manager for Go applications.\n\n[![GoDoc](https://godoc.org/github.com/tucnak/store?status.svg)](https://godoc.org/github.com/tucnak/store)\n\nI didn't like existing configuration management solutions like [globalconf](https://github.com/rakyll/globalconf), [tachyon](https://github.com/vektra/tachyon) or [viper](https://github.com/spf13/viper). First two just don't feel right and viper, imo, a little overcomplicated—definitely offering too much for small things. Store supports either JSON, TOML or YAML out-of-the-box and lets you register practically any other configuration format. It persists all of your configurations in either $XDG_CONFIG_HOME or $HOME on Linux and in %APPDATA%\non Windows.\n\nLook, when I say it's dead simple, I actually mean it:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/tucnak/store\"\n)\n\nfunc init() {\n\t// You must init store with some truly unique path first!\n\tstore.Init(\"cats-n-dogs/project-hotel\")\n}\n\ntype Cat struct {\n\tName   string `toml:\"naym\"`\n\tClever bool   `toml:\"ayy\"`\n}\n\ntype Hotel struct {\n\tName string\n\tCats []Cat `toml:\"guests\"`\n\n\tOpens  *time.Time\n\tCloses *time.Time\n}\n\nfunc main() {\n\tvar hotel Hotel\n\n\tif err := store.Load(\"hotel.toml\", \u0026hotel); err != nil {\n\t\tlog.Println(\"failed to load the cat hotel:\", err)\n\t\treturn\n\t}\n\n\t// ...\n\n\tif err := store.Save(\"hotel.toml\", \u0026hotel); err != nil {\n\t\tlog.Println(\"failed to save the cat hotel:\", err)\n\t\treturn\n\t}\n}\n```\n\nStore supports any other formats via the handy registration system: register the format once and you'd be able to Load and Save files in it afterwards:\n```go\nstore.Register(\"ini\", ini.Marshal, ini.Unmarshal)\n\nerr := store.Load(\"configuration.ini\", \u0026object)\n// ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftucnak%2Fstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftucnak%2Fstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftucnak%2Fstore/lists"}