{"id":43071440,"url":"https://github.com/jhoelzel/jsonconfig","last_synced_at":"2026-01-31T13:54:14.411Z","repository":{"id":57575734,"uuid":"99473667","full_name":"jhoelzel/jsonconfig","owner":"jhoelzel","description":"jsonconfig is a simple golang package that reads a JSON configuration file from any path into a strongly typed struct and vice versa.","archived":false,"fork":false,"pushed_at":"2017-08-06T14:01:46.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T20:07:14.064Z","etag":null,"topics":["golang-package","json"],"latest_commit_sha":null,"homepage":"https://github.com/jhoelzel/jsonconfig","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/jhoelzel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-06T08:26:17.000Z","updated_at":"2020-03-16T13:23:20.000Z","dependencies_parsed_at":"2022-09-26T18:50:14.239Z","dependency_job_id":null,"html_url":"https://github.com/jhoelzel/jsonconfig","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jhoelzel/jsonconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoelzel%2Fjsonconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoelzel%2Fjsonconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoelzel%2Fjsonconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoelzel%2Fjsonconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhoelzel","download_url":"https://codeload.github.com/jhoelzel/jsonconfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhoelzel%2Fjsonconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28944789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T13:02:32.153Z","status":"ssl_error","status_checked_at":"2026-01-31T13:00:07.528Z","response_time":128,"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":["golang-package","json"],"created_at":"2026-01-31T13:54:13.898Z","updated_at":"2026-01-31T13:54:14.405Z","avatar_url":"https://github.com/jhoelzel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsonconfig\n\n**Package Name:** jsonconfig\n\n**Author      :** jhoelzel\n\n**URL         :** github.com/jhoelzel/jsonconfig\n\n**License     :** [MIT](LICENSE)\n\n**Version     :** 0.0.1 \n\nSummary\n--------------\n\njsonconfig is a simple golang package that reads a simple JSON configuration file from any path into a strongly typed struct and vice versa.\n\nWhy a JSON config file\n--------------\n\nMost of the time changing minor settings in your application is paramount, but most of the time they cause downtime. \njsonconfig enables you to adapt your configuration however you like by simply reloading the configuration as needed.\nFurthermore, using the JSON Format, enables you to not only change settings yourself with a simple text editor, but also have machines to the jobs for you ;)\n\nUsage\n--------------\n\n*in your code *\n\n```golang\nimport (\n\t\"github.com/jhoelzel/jsonconfig\"\n)\n\nvar config jsonconfig.Configuration\n\nfunc main() {\n    config = jsonconfig.Read(\"./config.json\")\n}\n```\n\nMethods\n--------------\n\n| Command | Description |\n| --- | --- |\n| jsonconfig.Read(\"./config.json\") | Read the json file from \"./config.json\" and return Configuration |\n| jsonconfig.Write(Configuration, \"./config.json\") | Write the Configuration to \"./config.json\" |\n| jsonconfig.Configuration | The \"Configuration\" Type |\n\nThe configuration File\n--------------\n\n*HowEverYouChooseToNameIt.json*\n\n```json\n{\n        \"Globals\": {\n                \"url\": \"https://yourdomain.tld\",\n                \"theme\": \"default\",\n                \"date_format\": \"m/d/Y\",\n                \"time_format\" : \"h:ia\",\n                \"decimal_seperator\" : \".\",\n                \"language\" : \"en_us\",\n                \"version\" : \"0.0.1\"\n        },\n        \"Admin\": {\n                \"email\": \"admin@yourdomain.tld\",\n                \"name\": \"Admin Adminicus\"\n        },\n        \"Emails\": {\n                \"name\": \"no-reply Server\",\n                \"host\": \"yourdomain.tld\",\n                \"port\": \"587\",\n                \"email\": \"no-reply@yourdomain.tld\",\n                \"username\": \"no-reply@yourdomain.tld\",\n                \"password\": \"...\",\n                \"mechanism\": \"TLS\"\n        },\n        \"Login\": {\n                \"username\": \"admin@yourdomain.tld\",\n                \"password\": \"VeryUnsecureClearTextPW\"\n        },\n        \"Database\": {\n                \"username\": \"root\",\n                \"password\": \"root\",\n                \"dbname\": \"testdb\",\n                \"host\": \"mysql.yourdomain.tld\",\n                \"port\": \"587\"\n        }\n\n}\n```\n\nBut your configuration flags suck!\n--------------\n\nWhile that topic is up for debate, this repository has been created to quickly build a new Package using Golang that works for me.\nYour needs may be different, but do not despair! You may simply hit the fork button and create your own version.\n\nTo do that change the following files:\n\n| [models.go](models.go)            | [main_test.go](main_test.go)                                 |\n| -------------        | ------------- \n| add new Models here  | make sure your new Models are also tested    |\n\n\nI have a better idea for X\n--------------\n\nPull requests are allways welcome =)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhoelzel%2Fjsonconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhoelzel%2Fjsonconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhoelzel%2Fjsonconfig/lists"}