mysqlstore

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

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const DDL = "CREATE TABLE IF NOT EXISTS %s (" +
	"	`id` char(64) NOT NULL," +
	"	`data` longblob NOT NULL," +
	"	`created` int(11) unsigned NOT NULL DEFAULT '0'," +
	"	`modified` int(11) unsigned NOT NULL DEFAULT '0'," +
	"	`expires` int(11) unsigned NOT NULL DEFAULT '0'," +
	"	PRIMARY KEY (`id`)" +
	"  ) ENGINE=InnoDB;"

Variables

View Source
var DefaultMaxReconnect = 5

Functions

func New

func New(cfg *Options) sessions.Store

func Reg

func Reg(store sessions.Store, args ...string)

func RegWithOptions

func RegWithOptions(opts *Options, args ...string) sessions.Store

Types

type MySQLStore

type MySQLStore struct {
	*sqlstore.SQLStore
}

func NewMySQLStore

func NewMySQLStore(cfg *Options) (*MySQLStore, error)

NewMySQLStore takes the following paramaters endpoint - A sql.Open style endpoint tableName - table where sessions are to be saved. Required fields are created automatically if the table doesnot exist. path - path for Set-Cookie header maxAge codecs

func NewMySQLStoreFromConnection

func NewMySQLStoreFromConnection(db *sql.DB, cfg *Options) (*MySQLStore, error)

NewMySQLStoreFromConnection .

type Options

type Options struct {
	Config dbconfig.Config `json:"-"`
	sqlstore.Options
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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