session

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Unlicense 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 IProvider)

Register makes a session provider available by the provided name. If a Register is called twice with the same name or if the driver is nil, it panics.

Types

type IProvider

type IProvider interface {
	SessionInit(sid string) (*SessionBase, error)
	SessionRead(sid string) (*SessionBase, error)
	SessionDestroy(sid string) error
	SessionGC(maxLifeTime int64)
}

type SessionBase

type SessionBase struct {
	TimeAccessed time.Time // last access time
	// contains filtered or unexported fields
}

func NewSession

func NewSession(sid string) *SessionBase

func (*SessionBase) Clear

func (s *SessionBase) Clear()

func (*SessionBase) Get

func (s *SessionBase) Get(key interface{}) interface{}

func (*SessionBase) GetBool

func (s *SessionBase) GetBool(key interface{}) bool

func (*SessionBase) GetFloat64

func (s *SessionBase) GetFloat64(key interface{}) float64

func (*SessionBase) GetInt64

func (s *SessionBase) GetInt64(key interface{}) int64

func (*SessionBase) GetString

func (s *SessionBase) GetString(key interface{}) string

func (*SessionBase) GetTime

func (s *SessionBase) GetTime(key interface{}) time.Time

func (*SessionBase) Remove

func (s *SessionBase) Remove(key interface{}) error

func (*SessionBase) SessionID

func (s *SessionBase) SessionID() string

func (*SessionBase) Set

func (s *SessionBase) Set(key interface{}, value interface{}) error

type SessionManager

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

func GetSessionManager

func GetSessionManager() *SessionManager

get default memory sessionmanager.

func (*SessionManager) SessionStart

func (manager *SessionManager) SessionStart(w http.ResponseWriter, r *http.Request) (session *SessionBase)

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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