{"id":41744861,"url":"https://github.com/tinh-tinh/config","last_synced_at":"2026-01-25T00:48:10.511Z","repository":{"id":259356850,"uuid":"877342096","full_name":"tinh-tinh/config","owner":"tinh-tinh","description":"⚙️ Config Module for Tinh Tinh framwork","archived":false,"fork":false,"pushed_at":"2025-07-20T04:05:43.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-20T05:46:59.605Z","etag":null,"topics":["configuration","framework"],"latest_commit_sha":null,"homepage":"https://tinh-tinh.github.io/docs/docs/intergrations/config","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/tinh-tinh.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,"zenodo":null}},"created_at":"2024-10-23T13:43:20.000Z","updated_at":"2025-07-20T04:05:47.000Z","dependencies_parsed_at":"2025-05-02T01:34:12.578Z","dependency_job_id":null,"html_url":"https://github.com/tinh-tinh/config","commit_stats":null,"previous_names":["tinh-tinh/config"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tinh-tinh/config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinh-tinh%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinh-tinh%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinh-tinh%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinh-tinh%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinh-tinh","download_url":"https://codeload.github.com/tinh-tinh/config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinh-tinh%2Fconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28740271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"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":["configuration","framework"],"created_at":"2026-01-25T00:48:09.719Z","updated_at":"2026-01-25T00:48:10.503Z","avatar_url":"https://github.com/tinh-tinh.png","language":"Go","readme":"# Config Module for Tinh Tinh\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg alt=\"GitHub Release\" src=\"https://img.shields.io/github/v/release/tinh-tinh/config\"\u003e\n\u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/tinh-tinh/config\"\u003e\n\u003ca href=\"https://codecov.io/gh/tinh-tinh/config\" \u003e \n \u003cimg src=\"https://codecov.io/gh/tinh-tinh/config/graph/badge.svg?token=VK57E807N2\"/\u003e \n \u003c/a\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/tinh-tinh/config\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/tinh-tinh/config.svg\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://avatars.githubusercontent.com/u/178628733?s=400\u0026u=2a8230486a43595a03a6f9f204e54a0046ce0cc4\u0026v=4\" width=\"200\" alt=\"Tinh Tinh Logo\"\u003e\n\u003c/div\u003e\n\n## Install\n\n```bash\ngo get -u github.com/tinh-tinh/config/v2\n```\n\n## Overview\n\nThe Config module for the Tinh Tinh framework provides flexible configuration management for Go applications. It supports loading environment variables from `.env` files and struct-based configs from YAML, with first-class integration for dependency injection and modular apps.\n\n## Features\n\n- Load configuration from `.env`, `.yaml`, or `.yml` files\n- Strongly-typed config structs with tags for mapping, default values, and validation\n- Namespace-based config injection for multiple configs (e.g., database, cache)\n- Conditional module registration based on environment or custom logic\n- Supports default values and validation via struct tags\n- Seamless integration with Tinh Tinh modules and controllers\n\n## Quick Start\n\n### 1. Basic Usage with `.env`\n\n```go\nimport \"github.com/tinh-tinh/config/v2\"\n\ntype AppConfig struct {\n    NodeEnv   string        `mapstructure:\"NODE_ENV\"`\n    Port      int           `mapstructure:\"PORT\"`\n    ExpiresIn time.Duration `mapstructure:\"EXPIRES_IN\"`\n    Log       bool          `mapstructure:\"LOG\"`\n    Secret    string        `mapstructure:\"SECRET\"`\n}\n\ncfg, err := config.NewEnv[AppConfig](\".env\")\nif err != nil {\n    panic(err)\n}\nfmt.Println(cfg.Port)\n```\n\n### 2. Using with YAML\n\n```go\ntype YamlConfig struct {\n    Host string `yaml:\"host\"`\n    Port int    `yaml:\"port\"`\n}\n\ncfg, err := config.NewYaml[YamlConfig](\"config.yaml\")\nif err != nil {\n    panic(err)\n}\nfmt.Println(cfg.Host)\n```\n\n---\n\n## Tinh Tinh Module Integration\n\n### Register as a Global Config\n\n```go\nimport \"github.com/tinh-tinh/tinhtinh/v2/core\"\n\nappModule := core.NewModule(core.NewModuleOptions{\n    Imports: []core.Modules{\n        config.ForRoot[AppConfig](\".env\"),\n    },\n})\n```\n\n### Inject Config Anywhere\n\n```go\ncfg := config.Inject[AppConfig](module)\nfmt.Println(cfg.Port)\n```\n\n## Contributing\n\nWe welcome contributions! Please feel free to submit a Pull Request.\n\n## Support\n\nIf you encounter any issues or need help, you can:\n- Open an issue in the GitHub repository\n- Check our documentation\n- Join our community discussions\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinh-tinh%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinh-tinh%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinh-tinh%2Fconfig/lists"}