{"id":20724669,"url":"https://github.com/arhea/go-mock-redis","last_synced_at":"2026-05-25T00:02:25.949Z","repository":{"id":210413439,"uuid":"726501779","full_name":"arhea/go-mock-redis","owner":"arhea","description":"Provides convenient test helpers for mocking Redis containers and Redis clients.","archived":false,"fork":false,"pushed_at":"2024-03-11T23:21:35.000Z","size":61,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T11:52:11.904Z","etag":null,"topics":["golang","golang-module","golang-package","test","testcon","testcontainers-go"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/arhea/go-mock-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/arhea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["arhea"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-12-02T15:27:13.000Z","updated_at":"2023-12-02T17:44:15.000Z","dependencies_parsed_at":"2025-03-11T08:43:16.733Z","dependency_job_id":"5f501f38-82fb-4519-b1d2-667a78760fd2","html_url":"https://github.com/arhea/go-mock-redis","commit_stats":null,"previous_names":["arhea/go-mock-redis"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/arhea/go-mock-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arhea%2Fgo-mock-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arhea%2Fgo-mock-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arhea%2Fgo-mock-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arhea%2Fgo-mock-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arhea","download_url":"https://codeload.github.com/arhea/go-mock-redis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arhea%2Fgo-mock-redis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33455026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"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":["golang","golang-module","golang-package","test","testcon","testcontainers-go"],"created_at":"2024-11-17T04:15:56.887Z","updated_at":"2026-05-25T00:02:25.908Z","avatar_url":"https://github.com/arhea.png","language":"Go","funding_links":["https://github.com/sponsors/arhea"],"categories":[],"sub_categories":[],"readme":"# Mock Redis\n\n![Tests](https://github.com/arhea/go-mock-redis/actions/workflows/main.yml/badge.svg?branch=main) ![goreportcard](https://goreportcard.com/badge/github.com/arhea/go-mock-redis)\n\nProvide a mock Redis instance and optionally a mock Redis client for testing purposes. This library is built so you can\nmock Redis instances using real Redis containers. You will need to have Docker running on your local machine or within\nyour CI environment.\n\nThis library is built on top of [testcontainers](https://testcontainers.com/).\n\n## Usage\n\nCreating a mock instance for creating a customer connection.\n\n```golang\nfunc TestXXX(t *testing.T) {\n\tctx := context.Background()\n\n\tmock, err := mockredis.NewInstance(ctx, t)\n\n\tif err != nil {\n\t\tt.Fatalf(\"creating the instance: %v\", err)\n\t\treturn\n\t}\n\n\t// close the mock\n\tdefer mock.Close(ctx)\n\n\t// ... my test code\n}\n```\n\nCreating a mock redis client for interacting with Redis.\n\n```golang\nfunc TestXXX(t *testing.T) {\n\tctx := context.Background()\n\n\tmock, err := mockredis.NewClient(ctx, t)\n\n\tif err != nil {\n\t\tt.Fatalf(\"creating the client: %v\", err)\n\t\treturn\n\t}\n\n\t// close the mock\n\tdefer mock.Close(ctx)\n\n    redisClient := mock.Client()\n\n\t// ... my test code\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farhea%2Fgo-mock-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farhea%2Fgo-mock-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farhea%2Fgo-mock-redis/lists"}