{"id":20388585,"url":"https://github.com/efureev/gorilla-redisstore","last_synced_at":"2025-07-24T05:35:31.515Z","repository":{"id":90771330,"uuid":"217030329","full_name":"efureev/gorilla-redisstore","owner":"efureev","description":"Gorilla Sessions Store","archived":false,"fork":false,"pushed_at":"2019-10-23T14:16:46.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T12:42:26.895Z","etag":null,"topics":["gorilla-sessions","session","store"],"latest_commit_sha":null,"homepage":null,"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/efureev.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}},"created_at":"2019-10-23T10:26:46.000Z","updated_at":"2019-10-23T14:16:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"841ce3e3-2b56-4f3b-9c58-8b06ed79caf8","html_url":"https://github.com/efureev/gorilla-redisstore","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/efureev/gorilla-redisstore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgorilla-redisstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgorilla-redisstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgorilla-redisstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgorilla-redisstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efureev","download_url":"https://codeload.github.com/efureev/gorilla-redisstore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fgorilla-redisstore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266796853,"owners_count":23985486,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gorilla-sessions","session","store"],"created_at":"2024-11-15T03:11:41.700Z","updated_at":"2025-07-24T05:35:31.490Z","avatar_url":"https://github.com/efureev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/efureev/gorilla-redisstore.svg?branch=master)](https://travis-ci.com/efureev/gorilla-redisstore)\n[![Maintainability](https://api.codeclimate.com/v1/badges/9cd3fd42c3ea8615db3b/maintainability)](https://codeclimate.com/github/efureev/gorilla-redisstore/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/9cd3fd42c3ea8615db3b/test_coverage)](https://codeclimate.com/github/efureev/gorilla-redisstore/test_coverage)\n[![Go Report Card](https://goreportcard.com/badge/github.com/efureev/gorilla-redisstore)](https://goreportcard.com/report/github.com/efureev/gorilla-redisstoree)\n\n# RedisStore\n\n## Install\n```bash\ngo get -u github.com/efureev/redisstore\n```\n\nA [`Gorilla Sessions Store`](https://www.gorillatoolkit.org/pkg/sessions#Store) implementation backed by Redis.\n\nIt uses [`go-redis`](https://github.com/go-redis/redis) as client to connect to Redis.\n\n## Example\n```go\n\npackage main\n\nimport (\n    \"github.com/go-redis/redis/v7\"\n    \"github.com/gorilla/sessions\"\n    \"github.com/efureev/redisstore\"\n    \"log\"\n    \"net/http\"\n    \"net/http/httptest\"\n)\n\nfunc main() {\n\n    client := redis.NewClient(\u0026redis.Options{\n        Addr:     \"localhost:6379\",\n    })\n\n    // New default RedisStore\n    store, err := redisstore.NewRedisStore(client)\n    if err != nil {\n        log.Fatal(\"failed to create redis store: \", err)\n    }\n\n    // Example changing configuration for sessions\n    store.KeyPrefix(\"session_\")\n    store.Options(sessions.Options{\n        Path:   \"/path\",\n        Domain: \"example.com\",\n        MaxAge: 86400 * 60,\n    })\n\n    // Request y writer for testing\n    req, _ := http.NewRequest(\"GET\", \"http://www.example.com\", nil)\n    w := httptest.NewRecorder()\n\n    // Get session\n    session, err := store.Get(req, \"session-key\")\n    if err != nil {\n        log.Fatal(\"failed getting session: \", err)\n    }\n\n    // Add a value\n    session.Values[\"foo\"] = \"bar\"\n\n    // Save session\n    if err = sessions.Save(req, w); err != nil {\n        log.Fatal(\"failed saving session: \", err)\n    }\n\n    // Delete session (MaxAge \u003c= 0)\n    session.Options.MaxAge = -1\n    if err = sessions.Save(req, w); err != nil {\n        log.Fatal(\"failed deleting session: \", err)\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Fgorilla-redisstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefureev%2Fgorilla-redisstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Fgorilla-redisstore/lists"}