Skip to content
This repository has been archived by the owner. It is now read-only.
Go
Branch: master
Clone or download
Latest commit de93397 Feb 1, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore bug fix Feb 1, 2018
README.md session fixed May 15, 2015
nodb.go bug fix Feb 1, 2018
nodb_test.go init Mar 3, 2015

README.md

session-nodb Build Status

Session-nodb is a store of session middleware for Tango stored session data via nodb.

Installation

go get github.com/tango-contrib/session-nodb

Simple Example

package main

import (
    "github.com/lunny/tango"
    "github.com/tango-contrib/session"
    "github.com/tango-contrib/session-nodb"
)

type SessionAction struct {
    session.Session
}

func (a *SessionAction) Get() string {
    a.Session.Set("test", "1")
    return a.Session.Get("test").(string)
}

func main() {
    o := tango.Classic()
    store, _ := nodbstore.New(nodbstore.Options{
        Path:    "./nodbstore",
        DbIndex: 0,
        MaxAge:  30 * time.Minute,
    })
    o.Use(session.New(session.Options{
        Store: store,
        }))
    o.Get("/", new(SessionAction))
}

Getting Help

You can’t perform that action at this time.