{"id":44359200,"url":"https://github.com/ah-its-andy/goconf","last_synced_at":"2026-02-11T17:14:55.985Z","repository":{"id":134790220,"uuid":"490517540","full_name":"ah-its-andy/goconf","owner":"ah-its-andy","description":"Configuration providers for go inspired by .net core configuration libs. Extensible and easy to use.","archived":false,"fork":false,"pushed_at":"2022-05-16T07:18:31.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T10:17:13.821Z","etag":null,"topics":["config","configuration","go","go-configuration","goconf","golang","ini","json","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ah-its-andy.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":"2022-05-10T02:42:10.000Z","updated_at":"2022-11-03T07:09:50.000Z","dependencies_parsed_at":"2024-06-20T09:25:36.260Z","dependency_job_id":"9ccc9ecc-f942-4786-97d4-85229bb1fa05","html_url":"https://github.com/ah-its-andy/goconf","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ah-its-andy/goconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-its-andy%2Fgoconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-its-andy%2Fgoconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-its-andy%2Fgoconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-its-andy%2Fgoconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ah-its-andy","download_url":"https://codeload.github.com/ah-its-andy/goconf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ah-its-andy%2Fgoconf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29338974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T16:14:43.024Z","status":"ssl_error","status_checked_at":"2026-02-11T16:14:15.258Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["config","configuration","go","go-configuration","goconf","golang","ini","json","yaml"],"created_at":"2026-02-11T17:14:55.248Z","updated_at":"2026-02-11T17:14:55.977Z","avatar_url":"https://github.com/ah-its-andy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goconf\nConfiguration providers for go inspired by .net core configuration libs. Extensible and easy to use.\n\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/ah-its-andy/goconf?style=flat-square)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/ah-its-andy/goconf)](https://github.com/gookit/goutil)\n[![GoDoc](https://godoc.org/github.com/ah-its-andy/goconf?status.svg)](https://pkg.go.dev/github.com/ah-its-andy/goconf)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ah-its-andy/goconf)](https://goreportcard.com/report/github.com/ah-its-andy/goconf)\n[![Unit-Tests](https://github.com/ah-its-andy/goconf/workflows/Unit-Tests/badge.svg)](https://github.com/ah-its-andy/goconf/actions)\n\n## Supportives:\n- Memory source\n- Environment variables\n- JSON file\n- YAML file\n- INI file\n\n## Features:\n- Multi providers support (merge sources)\n- Extensible providers support (new providers can be added easily, even only one function to implement a new provider using file from local filesystem)\n- Get value by full path with key delimiter (e.g. `application.bind_addr.port`)\n- Cast value to specialized type with `TypeConversionFunc`\n- Bind configuration section to struct\n\n## Usage\n- package: `github.com/ah-its-andy/goconf`\n```go\n// initialize on application startup\ngoconf.Init(func(b goconf.Builder) {\n\tb.AddSource(physicalfile.Yaml(/*yaml file path, absolute or relative  both supported*/)))\n     .AddSource(physicalfile.Json(/*json file path, absolute or relative  both supported*/))\n     .AddSource(goconf.EnvironmentVariable(/*prefix for filter environment variables*/))\n     .AddSource(goconf.Memory(/*config map*/))\n})\n\n// use it anywhere\nbindAddr, ok := goconf.GetString(\"application.bind_addr.addr\") //Get string value\n\nbindAddrWithDefault := goconf.GetStringOrDefault(\"application.bind_addr.addr\", \"default value\") //returns default value when key is not found\n\ncastValue, ok := goconf.Cast(\"application.bind_addr.port\", goconf.IntConversion) //cast value to int\n\ncastValueWithDefault := goconf.CastOrDefault(\"application.bind_addr.port\", 0 /*default value*/, goconf.IntConversion) //cast value to int, returns default value when key is not found\n\nsection:= gocinf.GetSection(\"application\") //get section\n\nvar application fakeStruct.Application\nerr := section.Bind(\u0026application) //bind section to struct\n\n```\n\n## Refer\n- [github.com/mitchellh/mapstructure](https://github.com/mitchellh/mapstructure) for binding struct\n- [gopkg.in/yaml.v2](https://gopkg.in/yaml.v2) for yaml file support\n- [github.com/stretchr/testify](https://github.com/stretchr/testify) for testing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fah-its-andy%2Fgoconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fah-its-andy%2Fgoconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fah-its-andy%2Fgoconf/lists"}