{"id":47677865,"url":"https://github.com/slice-soft/ss-keel-redis","last_synced_at":"2026-04-02T13:38:16.782Z","repository":{"id":345809612,"uuid":"1187439845","full_name":"slice-soft/ss-keel-redis","owner":"slice-soft","description":"Official Redis addon for Keel — Redis integration","archived":false,"fork":false,"pushed_at":"2026-03-21T01:37:58.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-21T10:37:14.971Z","etag":null,"topics":["addon","go","keel","redis","slicesoft"],"latest_commit_sha":null,"homepage":"https://docs.keel-go.dev/en/addons/ss-keel-redis/","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/slice-soft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-20T18:18:02.000Z","updated_at":"2026-03-21T01:37:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/slice-soft/ss-keel-redis","commit_stats":null,"previous_names":["slice-soft/ss-keel-redis"],"tags_count":7,"template":false,"template_full_name":"slice-soft/ss-keel-addon-template","purl":"pkg:github/slice-soft/ss-keel-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice-soft%2Fss-keel-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice-soft%2Fss-keel-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice-soft%2Fss-keel-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice-soft%2Fss-keel-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slice-soft","download_url":"https://codeload.github.com/slice-soft/ss-keel-redis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slice-soft%2Fss-keel-redis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["addon","go","keel","redis","slicesoft"],"created_at":"2026-04-02T13:38:16.588Z","updated_at":"2026-04-02T13:38:16.776Z","avatar_url":"https://github.com/slice-soft.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://cdn.slicesoft.dev/boat.svg\" width=\"400\" /\u003e\n\n# ss-keel-redis\nOfficial Redis cache addon for Keel — implements contracts.Cache via go-redis v9.\n\n[![CI](https://github.com/slice-soft/ss-keel-redis/actions/workflows/ci.yml/badge.svg)](https://github.com/slice-soft/ss-keel-redis/actions)\n[![Release](https://img.shields.io/github/v/release/slice-soft/ss-keel-redis)](https://github.com/slice-soft/ss-keel-redis/releases)\n![Go](https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go\u0026logoColor=white)\n[![Go Report Card](https://goreportcard.com/badge/github.com/slice-soft/ss-keel-redis)](https://goreportcard.com/report/github.com/slice-soft/ss-keel-redis)\n[![Go Reference](https://pkg.go.dev/badge/github.com/slice-soft/ss-keel-redis.svg)](https://pkg.go.dev/github.com/slice-soft/ss-keel-redis)\n![License](https://img.shields.io/badge/License-MIT-green)\n![Made in Colombia](https://img.shields.io/badge/Made%20in-Colombia-FCD116?labelColor=003893)\n\n\n## Cache addon for Keel\n\n`ss-keel-redis` adds Redis cache support to a [Keel](https://keel-go.dev) project via [go-redis v9](https://redis.uptrace.dev/).\nIt is the official addon for distributed caching in the Keel ecosystem and implements `contracts.Cache` from `ss-keel-core`.\n\n---\n\n## 🚀 Installation\n\n```bash\nkeel add redis\n```\n\nThe Keel CLI will:\n1. Add `github.com/slice-soft/ss-keel-redis` as a dependency.\n2. Create `cmd/setup_redis.go` and inject initialization code into `cmd/main.go`.\n3. Add a `REDIS_URL` environment variable example to both `.env` and `.env.example`.\n\n---\n\n## ⚙️ Configuration\n\n```go\nclient, err := ssredis.New(ssredis.Config{\n    URL:    config.GetEnvOrDefault(\"REDIS_URL\", \"redis://localhost:6379\"),\n    Logger: app.Logger(),\n})\nif err != nil {\n    app.Logger().Error(\"failed to start redis: %v\", err)\n}\ndefer client.Close()\n```\n\nThe `URL` field uses the standard Redis URL format: `redis://[:password@]host[:port][/db-number]`.\n\n---\n\n## 🔗 Connection pool\n\nPool defaults applied when not overridden:\n\n| Parameter | Default |\n|---|---|\n| `MaxActiveConns` | 10 |\n| `MinIdleConns` | 2 |\n| `MaxIdleConns` | 5 |\n| `ConnMaxIdleTime` | 5 min |\n| `ConnMaxLifetime` | 30 min |\n\nOverride via `Config.Pool`:\n\n```go\nclient, err := ssredis.New(ssredis.Config{\n    URL:    config.GetEnvOrDefault(\"REDIS_URL\", \"redis://localhost:6379\"),\n    Logger: app.Logger(),\n    Pool: ssredis.PoolConfig{\n        MaxActiveConns:  20,\n        MinIdleConns:    5,\n        ConnMaxLifetime: time.Hour,\n    },\n})\n```\n\n---\n\n## 📦 Cache operations\n\n`contracts.Cache` covers the four core operations:\n\n```go\nctx := context.Background()\n\n// Store a value with a TTL\nerr := client.Set(ctx, \"user:123\", []byte(`{\"name\":\"Alice\"}`), 5*time.Minute)\n\n// Retrieve — returns nil, nil when the key does not exist\nval, err := client.Get(ctx, \"user:123\")\n\n// Remove a key\nerr = client.Delete(ctx, \"user:123\")\n\n// Check existence without reading the value\nexists, err := client.Exists(ctx, \"user:123\")\n```\n\nA zero TTL in `Set` means no expiration.\n\n---\n\n## 🔧 Advanced operations\n\nUse `RDB()` to access the full go-redis client for pipelines, transactions, Lua scripts, and Pub/Sub:\n\n```go\npipe := client.RDB().Pipeline()\npipe.Incr(ctx, \"counter\")\npipe.Expire(ctx, \"counter\", time.Hour)\n_, err := pipe.Exec(ctx)\n```\n\n---\n\n## ❤️ Health checker\n\nRegister the Redis connection in the Keel health endpoint:\n\n```go\napp.RegisterHealthChecker(ssredis.NewHealthChecker(client))\n```\n\nThis exposes the Redis status under `GET /health`:\n\n```json\n{ \"redis\": \"UP\" }\n```\n\n---\n\n## 🤚 CI/CD and releases\n\n- **CI** runs on every pull request targeting `main` via `.github/workflows/ci.yml`.\n- **Releases** are created automatically on merge to `main` via `.github/workflows/release.yml` using Release Please.\n\n---\n\n## 💡 Recommendations\n\n* Use `REDIS_URL` for all environments; it keeps credentials out of code and plays well with secrets managers.\n* Accept `contracts.Cache` in your services — not `*ssredis.Client` — so you can swap the implementation in tests.\n* Register `NewHealthChecker` so Keel's `/health` endpoint always reflects real Redis connectivity.\n\n---\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for setup and repository-specific rules.\nThe base workflow, commit conventions, and community standards live in [ss-community](https://github.com/slice-soft/ss-community/blob/main/CONTRIBUTING.md).\n\n## Community\n\n| Document | |\n|---|---|\n| [CONTRIBUTING.md](https://github.com/slice-soft/ss-community/blob/main/CONTRIBUTING.md) | Workflow, commit conventions, and PR guidelines |\n| [GOVERNANCE.md](https://github.com/slice-soft/ss-community/blob/main/GOVERNANCE.md) | Decision-making, roles, and release process |\n| [CODE_OF_CONDUCT.md](https://github.com/slice-soft/ss-community/blob/main/CODE_OF_CONDUCT.md) | Community standards |\n| [VERSIONING.md](https://github.com/slice-soft/ss-community/blob/main/VERSIONING.md) | SemVer policy and breaking changes |\n| [SECURITY.md](https://github.com/slice-soft/ss-community/blob/main/SECURITY.md) | How to report vulnerabilities |\n| [MAINTAINERS.md](https://github.com/slice-soft/ss-community/blob/main/MAINTAINERS.md) | Active maintainers |\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Links\n\n- Website: [keel-go.dev](https://keel-go.dev)\n- GitHub: [github.com/slice-soft/ss-keel-redis](https://github.com/slice-soft/ss-keel-redis)\n- Documentation: [docs.keel-go.dev](https://docs.keel-go.dev)\n\n---\n\nMade by [SliceSoft](https://slicesoft.dev) — Colombia 💙\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslice-soft%2Fss-keel-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslice-soft%2Fss-keel-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslice-soft%2Fss-keel-redis/lists"}