session

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewSessionManager

func NewSessionManager(cookieName string, maxLifeTime int64) *Manager

NewSessionManager return a session manager

func (*Manager) Delete

func (m *Manager) Delete(sessionID string, key interface{})

Delete delete value by key

func (*Manager) End

func (m *Manager) End(w http.ResponseWriter, r *http.Request)

End end session

delete sessionID from cookie and map

func (*Manager) Extension

func (m *Manager) Extension(w http.ResponseWriter, r *http.Request) string

Extension

func (*Manager) GC

func (m *Manager) GC()

GC session gc

func (*Manager) Get

func (m *Manager) Get(sessionID string, key interface{}) (interface{}, bool)

Get get session value

func (*Manager) Set

func (m *Manager) Set(sessionID string, key, value interface{})

Set set session

func (*Manager) Start

func (m *Manager) Start(w http.ResponseWriter, r *http.Request) string

Start Start session return sessionID

type Session

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

Jump to

Keyboard shortcuts

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