iris/adaptors/sessions/sessiondb
Gerasimos (Makis) Maropoulos 9a3c4f4c0a Add an example for httprouter_test, gofmt everything and misspel fixes.
Former-commit-id: e69ffdf9bba4c7e8c3df45c015b3363cc3fc59b6
2017-02-17 10:45:47 +02:00
..
redis Add an example for httprouter_test, gofmt everything and misspel fixes. 2017-02-17 10:45:47 +02:00
README.md SessionsPolicy and sessions adaptor, history and _example written. 2017-02-15 20:06:19 +02:00

Session databases

Find more databases at github.com/kataras/go-sessions/sessiondb.

This folder contains only the redis database because the rest (two so far, 'file' and 'leveldb') were created by the Community. So go there and find more about them. Database is just an interface so you're able to UseDatabase(anyCompatibleDatabase). A Database should implement two functions, Load and Update.

Database interface

type Database interface {
	Load(string) map[string]interface{}
	Update(string, map[string]interface{})
}
import (
  "...myDatabase"
)
s := New(...)
s.UseDatabase(myDatabase) // <---

app := iris.New()
app.Adapt(s)

app.Listen(":8080")