{"id":47978726,"url":"https://github.com/zoobz-io/fig","last_synced_at":"2026-04-04T10:59:38.766Z","repository":{"id":334593384,"uuid":"1141436463","full_name":"zoobz-io/fig","owner":"zoobz-io","description":"Struct tags in, configuration out","archived":false,"fork":false,"pushed_at":"2026-03-20T03:20:05.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T10:59:32.872Z","etag":null,"topics":["configuration","environment-variables","go","golang","secrets","struct-tags","zoobzio"],"latest_commit_sha":null,"homepage":"https://fig.zoobz.io","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/zoobz-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-24T21:01:59.000Z","updated_at":"2026-03-20T03:12:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zoobz-io/fig","commit_stats":null,"previous_names":["zoobzio/fig","zoobz-io/fig"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/zoobz-io/fig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobz-io%2Ffig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobz-io%2Ffig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobz-io%2Ffig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobz-io%2Ffig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoobz-io","download_url":"https://codeload.github.com/zoobz-io/fig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoobz-io%2Ffig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31397056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":["configuration","environment-variables","go","golang","secrets","struct-tags","zoobzio"],"created_at":"2026-04-04T10:59:37.225Z","updated_at":"2026-04-04T10:59:38.749Z","avatar_url":"https://github.com/zoobz-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fig\n\n[![CI](https://github.com/zoobz-io/fig/actions/workflows/ci.yml/badge.svg)](https://github.com/zoobz-io/fig/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/zoobz-io/fig/branch/main/graph/badge.svg)](https://codecov.io/gh/zoobz-io/fig)\n[![Go Report Card](https://goreportcard.com/badge/github.com/zoobz-io/fig)](https://goreportcard.com/report/github.com/zoobz-io/fig)\n[![CodeQL](https://github.com/zoobz-io/fig/actions/workflows/codeql.yml/badge.svg)](https://github.com/zoobz-io/fig/actions/workflows/codeql.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/zoobz-io/fig.svg)](https://pkg.go.dev/github.com/zoobz-io/fig)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/zoobz-io/fig)](go.mod)\n[![Release](https://img.shields.io/github/v/release/zoobz-io/fig)](https://github.com/zoobz-io/fig/releases/latest)\n\nStruct tags in, configuration out.\n\nfig loads configuration from environment variables, secret providers, and defaults using Go struct tags. One function call, predictable resolution order.\n\n## Install\n\n```bash\ngo get github.com/zoobz-io/fig\n```\n\nRequires Go 1.24+.\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n    \"log\"\n\n    \"github.com/zoobz-io/fig\"\n)\n\ntype Config struct {\n    Host     string   `env:\"APP_HOST\" default:\"localhost\"`\n    Port     int      `env:\"APP_PORT\" default:\"8080\"`\n    Password string   `secret:\"db/password\"`\n    Tags     []string `env:\"APP_TAGS\"`\n    APIKey   string   `env:\"API_KEY\" required:\"true\"`\n}\n\nfunc main() {\n    var cfg Config\n    if err := fig.Load(\u0026cfg); err != nil {\n        log.Fatal(err)\n    }\n    // cfg is now populated\n}\n```\n\nResolution order: `secret` → `env` → `default` → zero value.\n\n## Capabilities\n\n| Feature | Description |\n|---------|-------------|\n| Environment variables | `env:\"VAR_NAME\"` tag |\n| Secret providers | `secret:\"path/to/secret\"` tag with pluggable backends |\n| Default values | `default:\"value\"` tag |\n| Required fields | `required:\"true\"` tag |\n| Nested structs | Automatic recursion into embedded structs |\n| Validation | Implement `Validator` interface for custom checks |\n| Context support | `LoadContext` for secret provider timeouts |\n\n### Supported Types\n\n`string`, `int`, `int8-64`, `uint`, `uint8-64`, `float32`, `float64`, `bool`, `time.Duration`, `[]string` (comma-separated), and any type implementing `encoding.TextUnmarshaler`.\n\n## Secret Providers\n\nPass a provider implementing `SecretProvider` to load secrets:\n\n```go\ntype SecretProvider interface {\n    Get(ctx context.Context, key string) (string, error)\n}\n```\n\n### Available Providers\n\nEach provider is a separate module — import only what you need:\n\n```bash\n# AWS Secrets Manager\ngo get github.com/zoobz-io/fig/awssm\n\n# GCP Secret Manager\ngo get github.com/zoobz-io/fig/gcpsm\n\n# HashiCorp Vault\ngo get github.com/zoobz-io/fig/vault\n```\n\n```go\nimport \"github.com/zoobz-io/fig/vault\"\n\np, err := vault.New()\nif err != nil {\n    log.Fatal(err)\n}\nfig.Load(\u0026cfg, p)\n```\n\nSecrets take precedence over environment variables, allowing secure overrides.\n\n## Validation\n\nImplement the `Validator` interface for custom validation after loading:\n\n```go\nfunc (c *Config) Validate() error {\n    if c.Port \u003c= 0 || c.Port \u003e 65535 {\n        return errors.New(\"port must be between 1 and 65535\")\n    }\n    return nil\n}\n```\n\n## Why fig?\n\nNo config files. No YAML. No JSON. No builder chains. One function, one resolution order, done.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoobz-io%2Ffig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoobz-io%2Ffig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoobz-io%2Ffig/lists"}