{"id":37808976,"url":"https://github.com/wrfly/ecp","last_synced_at":"2026-01-16T15:32:56.372Z","repository":{"id":57487300,"uuid":"135253975","full_name":"wrfly/ecp","owner":"wrfly","description":"environment config parser | fill up the struct through the way you like","archived":false,"fork":false,"pushed_at":"2023-11-20T10:05:56.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T19:57:29.729Z","etag":null,"topics":["config","env","parser"],"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/wrfly.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}},"created_at":"2018-05-29T06:54:32.000Z","updated_at":"2023-06-26T03:25:21.000Z","dependencies_parsed_at":"2023-11-20T11:28:17.544Z","dependency_job_id":null,"html_url":"https://github.com/wrfly/ecp","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/wrfly/ecp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fecp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fecp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fecp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fecp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrfly","download_url":"https://codeload.github.com/wrfly/ecp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fecp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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","env","parser"],"created_at":"2026-01-16T15:32:56.265Z","updated_at":"2026-01-16T15:32:56.351Z","avatar_url":"https://github.com/wrfly.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ecp\n\n\u003e Environment config parser\n\nIf you run your application in a container and deploy it via a docker-compose file, then you may need this tool\nfor parsing configuration easily instead of mounting an external config file. You can simply set some environments\nand then `ecp` will help you fill the configs. Or, you can `COPY` a \"default\" config file to the image, and change some\nvariables by overwriting the keys via environments.\n\nThe environment config keys can be auto generated or set by the `yaml` or `env` tag.\n\nThe only thing you should do is importing this package, and `Parse` your config.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/wrfly/ecp)](https://goreportcard.com/report/github.com/wrfly/ecp)\n[![Build Status](https://travis-ci.org/wrfly/ecp.svg?branch=master)](https://travis-ci.org/wrfly/ecp)\n[![GoDoc](https://godoc.org/github.com/wrfly/ecp?status.svg)](https://godoc.org/github.com/wrfly/ecp)\n[![license](https://img.shields.io/github/license/wrfly/ecp.svg)](https://github.com/wrfly/ecp/blob/master/LICENSE)\n\n## Usage Example\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    \"github.com/wrfly/ecp\"\n)\n\ntype Conf struct {\n    LogLevel string `default:\"debug\"`\n    Port     int    `env:\"PORT\"`\n}\n\nfunc main() {\n    config := \u0026Conf{}\n    if err := ecp.Parse(config); err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"default log level: [ %s ]\\n\", config.LogLevel)\n    fmt.Println()\n\n    // set some env\n    envs := map[string]string{\n        \"LOGLEVEL\": \"info\",\n        \"PORT\":         \"1234\",\n    }\n    for k, v := range envs {\n        fmt.Printf(\"export %s=%s\\n\", k, v)\n        os.Setenv(k, v)\n    }\n    fmt.Println()\n\n    // then parse configuration from environments\n    if err := ecp.Parse(config, \"ECP\"); err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"new log level: [ %s ], port: [ %d ]\\n\",\n        config.LogLevel, config.Port)\n    fmt.Println()\n\n    // and list all the env keys\n    envLists := ecp.List(config, \"ecp\")\n    for _, k := range envLists {\n        fmt.Println(k)\n    }\n}\n```\n\nOutputs:\n\n```txt\ndefault log level: [ debug ]\n\nexport LOGLEVEL=info\nexport PORT=1234\n\nnew log level: [ info ], port: [ 1234 ]\n\nLOGLEVEL=debug\nPORT=\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrfly%2Fecp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrfly%2Fecp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrfly%2Fecp/lists"}