sessions

package
v0.0.0-...-eb842df Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Description: a session middleware based on mongodb, gorilla-session and gin-gonic Author: ZHU HAIHUA Since: 2016-04-07 20:20

 Description: a session middleware based on mysql, gorilla-session and gin-gonic  Author: ZHU HAIHUA  Since: 2016-04-07 22:34

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoStore

type MongoStore interface {
	ginsession.Store
}

func NewMongoStore

func NewMongoStore(s *mgo.Session, dbName, collectionName string, maxAge int, ensureTTL bool, keyPairs ...[]byte) MongoStore

NewMongoStore return a session store based on mongodb

type MySQLStore

type MySQLStore interface {
	ginsession.Store
}

func NewMySQLStore

func NewMySQLStore(endpoint, tableName string, keyPairs ...[]byte) (MySQLStore, error)

NewMySQLStore return a session store based on mysql

 by default the maxAge is 0, you can change the value by
   setting session.Options:

	    session.Options(Options{
	        MaxAge: 3600,
	        Domain: localhost,
			Path: "/foo/bar/bat",
		})

Jump to

Keyboard shortcuts

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