{"id":20643879,"url":"https://github.com/adjust/goenv","last_synced_at":"2025-07-14T16:06:02.365Z","repository":{"id":6002976,"uuid":"7226022","full_name":"adjust/goenv","owner":"adjust","description":"go boilerplate code","archived":false,"fork":false,"pushed_at":"2023-08-11T10:18:06.000Z","size":50,"stargazers_count":23,"open_issues_count":0,"forks_count":9,"subscribers_count":66,"default_branch":"master","last_synced_at":"2025-04-16T02:05:21.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adjust.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2012-12-18T15:54:53.000Z","updated_at":"2022-09-01T06:57:21.000Z","dependencies_parsed_at":"2024-06-19T00:15:05.346Z","dependency_job_id":"a5ebb4ad-3e7b-48de-b69b-e9ea11fc8b52","html_url":"https://github.com/adjust/goenv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adjust/goenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fgoenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fgoenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fgoenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fgoenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adjust","download_url":"https://codeload.github.com/adjust/goenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fgoenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265314360,"owners_count":23745252,"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-16T16:14:10.896Z","updated_at":"2025-07-14T16:06:02.337Z","avatar_url":"https://github.com/adjust.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#goenv\n\nThis is a nifty little package to help reduce the boilerplate code of our go apps and make them behave more like rails.\n\n##Features\n- rails style `config/config.yaml` to configure different databases. (see `example.yaml`)\n- `GO_ENV` similar to `RAILS_ENV` to have development, testing and production databases\n- default `log/server.log` for log output\n- prefab ExitHandler to make your app handle SIGHUP correctly\n\n##How to use\nGet it\n\n    go get github.com/adjust/goenv\n\n###General\nImport it\n\n    import github.com/adjust/goenv\n\nUse it\n\n    redis_host, redis_port, redis_db := goenv.GetRedis()\n\n###Exit Handler\nTo make your app quit on SIGHUP and execute some function before closing use a custom exit handler.\n\n    type MyExitHandler struct {\n    }\n\n    func (self *MyExitHandler) OnExit() {\n        log.Println(\"running sig handler\")\n        //do something like cleanup or saving progress...\n    }\n\n    func main() {\n        goenv.SetExitHandler(\u0026MyExitHandler{})\n    }\n\n##How to extend database config functions\nEasy: Just fork and create a new file (good place is to start with a `postgres.go` copy) with a function returning the parameters you want.\n\n## License\n\nThis Software is licensed under the MIT License.\n\nCopyright (c) 2012 adjust GmbH,\nhttp://www.adjust.com\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fgoenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadjust%2Fgoenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fgoenv/lists"}