session_mongo

package module
v0.0.0-...-fae8211 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2016 License: MIT Imports: 8 Imported by: 0

README

Mongo session store for session of restgo GoDoc

Install

go get github.com/restgo/session-mongo

Usage

app := restgo.App()

sessionOpts := `{
    "Secret"     :"secret",
    "Secure"     :false,
    "Path"       :"/",
    "HttpOnly"   :true,
    "CookieName" :"cookie-session",
    "MaxAge"     : 86400,
    "EncyptCookie": false
}`

mongoOpts := `{
    "Hosts"     :"localhost",
    "Database"  :"test",
    "Collection":"sessions",
    "Username"  :"",
    "Password"  :""
}`

app.Use(session.NewSessionManager(session_mongo.NewMongoSessionStore(mongoOpts), sessionOpts))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoSessionStore

type MongoSessionStore struct {
	// contains filtered or unexported fields
}

func NewMongoSessionStore

func NewMongoSessionStore(options string) *MongoSessionStore

create MongoSessionStore instance

func (*MongoSessionStore) Destroy

func (this *MongoSessionStore) Destroy(sid interface{}) error

func (*MongoSessionStore) Get

func (this *MongoSessionStore) Get(sid interface{}) (*session.Session, error)

func (*MongoSessionStore) Init

func (this *MongoSessionStore) Init(sessionOptions string) error

func (*MongoSessionStore) Save

func (this *MongoSessionStore) Save(session *session.Session) (interface{}, error)

func (*MongoSessionStore) SessionDestroy

func (this *MongoSessionStore) SessionDestroy(sid string) error

SessionDestroy delete mongodb session by id

func (*MongoSessionStore) StoreName

func (this *MongoSessionStore) StoreName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL