{"id":18247014,"url":"https://github.com/osspkg/go-config","last_synced_at":"2025-04-08T19:35:19.517Z","repository":{"id":250630924,"uuid":"834976546","full_name":"osspkg/go-config","owner":"osspkg","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-25T12:50:36.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-25T13:52:35.457Z","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osspkg.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-28T21:58:14.000Z","updated_at":"2024-08-25T12:41:57.000Z","dependencies_parsed_at":"2024-08-25T14:01:22.733Z","dependency_job_id":null,"html_url":"https://github.com/osspkg/go-config","commit_stats":null,"previous_names":["osspkg/go-config"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osspkg","download_url":"https://codeload.github.com/osspkg/go-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247912955,"owners_count":21017067,"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-11-05T09:28:35.861Z","updated_at":"2025-04-08T19:35:19.492Z","avatar_url":"https://github.com/osspkg.png","language":"Go","readme":"# Config Resolver\n\nUpdating the config through resolver variables.\n\n## Config example\n\nupdate config via ENV\n\n```text\n@env(key#defaut value)\n```\n\n```yaml\nenvs:\n  home: \"@env(HOME#/tmp/home)\"\n  path: \"@env(PATH#/usr/local/bin)\"\n```\n\n```go\nimport (\n  \"go.osspkg.com/config\"\n  \"go.osspkg.com/config/env\"\n)\n\ntype (\n  ConfigItem struct {\n    Home string `yaml:\"home\"`\n    Path string `yaml:\"path\"`\n  }\n  Config struct {\n    Envs testConfigItem `yaml:\"envs\"`\n  }\n)\n\nfunc main() {\n  conf := Config{}\n  \n  res := config.NewConfigResolve(\n    env.New(), // env resolver \n  )\n  res.OpenFile(\"./config.yaml\") // open config file\n  res.Build() // prepare config with resolvers\n  res.Decode(\u0026conf) // decoding config\n  \n  fmt.Println(conf.Envs.Home)\n  fmt.Println(conf.Envs.Path)\n}\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosspkg%2Fgo-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosspkg%2Fgo-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosspkg%2Fgo-config/lists"}