{"id":18273264,"url":"https://github.com/spacetab-io/configuration-go","last_synced_at":"2026-02-15T03:03:00.199Z","repository":{"id":54025518,"uuid":"259665786","full_name":"spacetab-io/configuration-go","owner":"spacetab-io","description":"Configuration module for microservices written on Go","archived":false,"fork":false,"pushed_at":"2024-10-10T10:30:07.000Z","size":131,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-06T22:59:19.755Z","etag":null,"topics":["config","configuration","go","golang","golang-configuration","microservices"],"latest_commit_sha":null,"homepage":"","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/spacetab-io.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":"2020-04-28T14:48:07.000Z","updated_at":"2024-10-10T10:16:29.000Z","dependencies_parsed_at":"2024-12-22T17:41:35.254Z","dependency_job_id":"a0adb949-b0a8-479d-8301-458a5fc391fe","html_url":"https://github.com/spacetab-io/configuration-go","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/spacetab-io/configuration-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacetab-io%2Fconfiguration-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacetab-io%2Fconfiguration-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacetab-io%2Fconfiguration-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacetab-io%2Fconfiguration-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spacetab-io","download_url":"https://codeload.github.com/spacetab-io/configuration-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spacetab-io%2Fconfiguration-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278692924,"owners_count":26029405,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","golang","golang-configuration","microservices"],"created_at":"2024-11-05T12:05:48.033Z","updated_at":"2025-10-06T22:59:20.125Z","avatar_url":"https://github.com/spacetab-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Golang Microservice configuration module\n----------------------------------------\n\n[![codecov](https://codecov.io/gh/spacetab-io/configuration-go/graph/badge.svg)](https://codecov.io/gh/spacetab-io/configuration-go)\n\nConfiguration module for microservices written on Go.\nPreserves [corporate standards for services configuration](https://confluence.teamc.io/pages/viewpage.action?pageId=4227704).\n\n## Installation\n\nImport in your configuration file\n\n```go\npackage main\n\nimport (\n\tconfig \"github.com/spacetab-io/configuration-go\"\n)\n\n```\n\n## Usage\n\nSome agreements:\n\n1. Configuration must be declared as struct and reveals yaml structure\n2. Default config folder: `./configuration`. If you need to override, pass your path in `ReadConfig` function\n3. Stage is passed as `config.Stageable` implementation. In example below stageEnv is used to pass stage through env variable `STAGE`.\n\nCode example:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\tconfig \"github.com/spacetab-io/configuration-go\"\n\t\"github.com/spacetab-io/configuration-go/stage\"\n\t\"gopkg.in/yaml.v3\"\n)\n\n// ConfigStruct is your app config structure. This must be related to yaml config file structure. \n// Everything that is not in this struct will be passed and will not be processed.\n// Keep in mind that inheritance must be implemented with `struct{}`\ntype ConfigStruct struct {\n\tLog struct {\n\t\tLevel  string `yaml:\"level\"`\n\t\tDebug  bool   `yaml:\"debug\"`\n\t\tFormat string `yaml:\"yaml\"`\n\t} `yaml:\"log\"`\n\tDatabase struct {\n\t\tHost           string `yaml:\"host\"`\n\t\tPort           string `yaml:\"port\"`\n\t\tUser           string `yaml:\"user\"`\n\t\tPass           string `yaml:\"password\"`\n\t\tName           string `yaml:\"name\"`\n\t\tSslMode        string `yaml:\"sslMode\"`\n\t\tLogs           bool   `yaml:\"logs\"`\n\t\tMigrateOnStart bool   `yaml:\"migrateOnStart\"`\n\t\tMigrationPath  string `yaml:\"migrationsPath\"`\n\t} `yaml:\"db\"`\n\tHttp struct {\n\t\tHost string `yaml:\"host\"`\n\t\tPort string `yaml:\"port\"`\n\t} `yaml:\"ws\"`\n}\n\nfunc main() {\n\t// config.Read receives stage as config.Stageable implementation.\n\t// You can use envStage to pass stage name via ENV param STAGE.\n\t// In NewEnvStage you can pass fallback value if STAGE param is empty.\n\tenvStage := config.NewEnvStage(\"development\")\n\t// Reading ALL config files in defaults configuration folder and recursively merge them with STAGE configs\n\tconfigBytes, err := config.Read(context.TODO(), envStage, config.WithConfigPath(\"./configuration\"))\n\tif err != nil {\n\t\tlog.Fatalf(\"config reading error: %+v\", err)\n\t}\n\n\tvar cfg ConfigStruct\n\t// unmarshal config into Config structure \n\terr = yaml.Unmarshal(configBytes, \u0026cfg)\n\tif err != nil {\n\t\tlog.Fatalf(\"config unmarshal error: %+v\", err)\n\t}\n\n\tfmt.Printf(\"config: %+v\", cfg)\n} \n```\n\n## License\n\nThe MIT License\n\nCopyright © 2024 SpaceTab.io, Inc. https://spacetab.io\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"\nSoftware\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the\nfollowing conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacetab-io%2Fconfiguration-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspacetab-io%2Fconfiguration-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspacetab-io%2Fconfiguration-go/lists"}