{"id":31252476,"url":"https://github.com/bh90210/vagorillasessionsstores","last_synced_at":"2026-05-19T07:34:17.019Z","repository":{"id":110330049,"uuid":"261321125","full_name":"bh90210/vagorillasessionsstores","owner":"bh90210","description":"Various back-end stores for Gorilla Sessions (Badger, Mongo, Dgraph)","archived":false,"fork":false,"pushed_at":"2020-12-18T22:51:42.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-15T07:28:33.143Z","etag":null,"topics":["badgerdb","dgraph","go","golang","gorilla-sessions","mongodb","store"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bh90210.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":"2020-05-04T23:51:24.000Z","updated_at":"2024-02-04T22:20:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5c1a92d-7287-48eb-81b5-b6ccefdc3edd","html_url":"https://github.com/bh90210/vagorillasessionsstores","commit_stats":null,"previous_names":["bh90210/badgerstore"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/bh90210/vagorillasessionsstores","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh90210%2Fvagorillasessionsstores","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh90210%2Fvagorillasessionsstores/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh90210%2Fvagorillasessionsstores/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh90210%2Fvagorillasessionsstores/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bh90210","download_url":"https://codeload.github.com/bh90210/vagorillasessionsstores/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bh90210%2Fvagorillasessionsstores/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33206320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:16:55.748Z","status":"ssl_error","status_checked_at":"2026-05-19T07:16:54.366Z","response_time":58,"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":["badgerdb","dgraph","go","golang","gorilla-sessions","mongodb","store"],"created_at":"2025-09-23T06:28:26.413Z","updated_at":"2026-05-19T07:34:17.015Z","avatar_url":"https://github.com/bh90210.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vagorillasessionsstores [![GoDoc](https://godoc.org/github.com/bh90210/va-gorilla-sessions-store?status.svg)](https://godoc.org/github.com/bh90210/va-gorilla-sessions-store)\nCollection of various Gorilla Sessions back-end stores.\n\n# Install\n\n```bash\ngo get github.com/bh90210/vaGorillaSessionsStores\n```\n\n# Use\nErrors are excluded for brevity.\n\n## Badger\n_note: Badger will not work in distributed environments. Use it for local testing or single server scenarios._\n\n### Using the store is very simple:\n```go\nimport stores \"github.com/bh90210/vagorillasessionsstores\"\n\nstore, _ := stores.NewBadgerStore(\"/path/to/data\", []byte(os.Getenv(\"SESSION_KEY\")))\n```\nIf `path` is empty data will be stored in system's `tmp` directory.\n\n### Start a store with custom options (see [Badger's docs](https://dgraph.io/docs/badger) for more):\n```go\nimport stores \"github.com/bh90210/vagorillasessionsstores\"\n\nopts := badger.Options{\n\t\tDir: \"/data/dir\",\n}\nstore, _ := stores.NewBadgerStoreWithOpts(opts,[]byte(os.Getenv(\"SESSION_KEY\")))\n```\n### Help functions\nTwo helper functions for direct back-end session manipulation without http request. \n\n## Mongo\n\n### Starting a store entails passing credentials and client options (official go mongo driver is necessary):\n```go\nimport (\n\tstores \"github.com/bh90210/vagorillasessionsstores\"\n\t\"go.mongodb.org/mongo-driver/mongo\"\n\t\"go.mongodb.org/mongo-driver/mongo/options\"\n)\n\nvar cred options.Credential\n\ncred.AuthSource = \"YourAuthSource\"\ncred.Username = \"YourUserName\"\ncred.Password = \"YourPassword\"\n\nclientOptions := options.Client().ApplyURI(os.Getenv(\"MONGO_DB_URI\")).SetAuth(cred)\n\nctx := context.Background()\nclient, _ := mongo.Connect(ctx, opts)\n\nstore, _ := stores.NewMongoStore(client, \"databaseName\", \"collectionName\", []byte(os.Getenv(\"SESSION_KEY\")))\n```\n_If 'databaseName' \u0026 'collectionName' are left empty the defaults are used ('sessions' \u0026 'store')._\n\n## Dgraph\n\n_store uses dgo/v200_\n\nAssumed schema:\n```yaml\nsessionid: string @index(hash) .\nsessionvalue: string . \ntype Session {\n  sessionid\n  sessionvalue\n}\n```\n\n```go\nimport (\n\tstores \"github.com/bh90210/vagorillasessionsstores\"\n\t\"google.golang.org/grpc\"\n)\n\nconn, _err_ := grpc.Dial(\"127.0.0.1:9080\", grpc.WithInsecure())\n\nstore, _ := stores.NewDgraphStore(conn, []byte(os.Getenv(\"SESSION_KEY\")))\n```\n\nYou can also let schema initiation to the store:\n```go\nimport (\n\tstores \"github.com/bh90210/vagorillasessionsstores\"\n\t\"google.golang.org/grpc\"\n)\n\nconn, _err_ := grpc.Dial(\"127.0.0.1:9080\", grpc.WithInsecure())\n\nstore, _ := stores.NewDgraphStoreWithSchema(conn, []byte(os.Getenv(\"SESSION_KEY\")))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbh90210%2Fvagorillasessionsstores","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbh90210%2Fvagorillasessionsstores","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbh90210%2Fvagorillasessionsstores/lists"}