{"id":19041053,"url":"https://github.com/everythingme/disposable-redis","last_synced_at":"2025-04-23T21:26:24.761Z","repository":{"id":25704647,"uuid":"29141255","full_name":"EverythingMe/disposable-redis","owner":"EverythingMe","description":"Create disposable redis servers on the fly for testing","archived":false,"fork":false,"pushed_at":"2016-02-29T19:50:04.000Z","size":7,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-18T06:51:05.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EverythingMe.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}},"created_at":"2015-01-12T15:16:38.000Z","updated_at":"2021-10-19T16:39:31.000Z","dependencies_parsed_at":"2022-07-24T07:01:50.709Z","dependency_job_id":null,"html_url":"https://github.com/EverythingMe/disposable-redis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fdisposable-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fdisposable-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fdisposable-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingMe%2Fdisposable-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EverythingMe","download_url":"https://codeload.github.com/EverythingMe/disposable-redis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250516358,"owners_count":21443610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T22:26:40.985Z","updated_at":"2025-04-23T21:26:24.739Z","avatar_url":"https://github.com/EverythingMe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Disposable-Redis\n## Create disposable instances of redis server on random ports\n\nThis can be used for testing redis dependent code without having to make\nassumptions on if and where redis server is running, or fear of corrupting data.\n\nYou just create a redis server instance, run your code against it as if it were a mock, and then remove it without a trace. \nThe only assumption here is that you have `redis-server` available in your path.\n\nFor full documentation see [http://godoc.org/github.com/EverythingMe/disposable-redis](http://godoc.org/github.com/EverythingMe/disposable-redis)\n\n\n## Example:\n\n```go\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\tdisposable \"github.com/EverythingMe/disposable-redis\"\n\tredigo \"github.com/garyburd/redigo/redis\"\n)\n\nfunc ExampleServer() {\n\n\t// create a new server on a random port\n\tr, err := disposable.NewServerRandomPort()\n\tif err != nil {\n\t\tpanic(\"Could not create random server\")\n\t}\n\n\t// we must remember to kill it at the end, or we'll have zombie redises\n\tdefer r.Stop()\n\n\t// wait for our server to be ready for serving, for at least 50 ms.\n\t// This gives redis time to initialize itself and listen\n\tif err = r.WaitReady(50 * time.Millisecond); err != nil {\n\t\tpanic(\"Couldn't connect to instance\")\n\t}\n\n\t//now we can just connect and talk to it\n\tconn, err := redigo.Dial(\"tcp\", r.Addr())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(redigo.String(conn.Do(\"SET\", \"foo\", \"bar\")))\n\t//Output: OK \u003cnil\u003e\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverythingme%2Fdisposable-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverythingme%2Fdisposable-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverythingme%2Fdisposable-redis/lists"}