A session store backend for gorilla/sessions - src.
Depends on the aerospike-client-go Aerospike library.
go get github.com/theaidem/aerostore
Available on godoc.org.
Full documentation on underlying interface.
// Fetch new store.
// "test" is a namespace of Aerospike cluster
// "sessions" is a set of Aerospike cluster
store, err := NewAeroStore("test", "sessions", "127.0.0.1", 3000, []byte("something-very-secret"))
if err != nil {
panic(err)
}
defer store.Close()
// Get a session.
session, err = store.Get(req, "session-key")
if err != nil {
log.Error(err.Error())
}
// Add a value.
session.Values["foo"] = "bar"
// Save.
if err = sessions.Save(req, rsp); err != nil {
log.Fatalf("Error saving session: %v", err)
}