session

package
v0.0.0-...-4362469 Latest Latest
Warning

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

Go to latest
Published: May 8, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, provider Provider)

Types

type Manager

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

func NewManager

func NewManager(provideName, cookieName string, maxlifetime int64) (*Manager, error)

func (*Manager) GC

func (manager *Manager) GC()

func (*Manager) SessionDestroy

func (manager *Manager) SessionDestroy(w ResponseWriter, r *Request)

func (*Manager) SessionStart

func (manager *Manager) SessionStart(w ResponseWriter, r *Request) (session Session)

type Provider

type Provider interface {
	SessionInit(sid string) (Session, error)
	SessionRead(sid string) (Session, error)
	SessionDestroy(sid string) error
	SessionGC(maxLifeTime int64)
}

type Session

type Session interface {
	Set(key, value interface{}) error
	Get(key interface{}) interface{}
	Delete(key interface{}) error
	SessionID() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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