Registry / database / antonlindstrom-pgstore

antonlindstrom-pgstore

JSON →
library0.0.0-20220421113606-e3a6e3fed12agogounverified

A PostgreSQL-backed session store for the Gorilla web toolkit.

go get github.com/antonlindstrom/pgstore
INSTALL
IMPORT
SIG · ANTONLINDSTROM-PGS
A
antonlindstrom-pgstore
databasegov0.0.0-20220421113606-e3a6e3fed12a
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pgstore
github.com/antonlindstrom/pgstore

Use PostgreSQL as a session store for Gorilla sessions.

package main import ( "github.com/antonlindstrom/pgstore" "net/http" ) func main() { store, _ := pgstore.NewPGStore("postgres://user:pass@localhost/dbname", []byte("secret-key")) defer store.Close() http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { session, _ := store.Get(r, "session-name") session.Values["foo"] = "bar" session.Save(r, w) }) http.ListenAndServe(":8080", nil) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20220421113606-e3a6e3fed12alatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
antonlindstrom-pgstore — go get antonlindstrom-pgstore · libregistry