session

package
v0.0.0-...-316850d Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2013 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COOKIE_KEY_PREFIX  = "hm-"
	SESSION_COOKIE_KEY = "sessionid"
)

cookie

View Source
const (
	SESSION_SURVIVAL_SECONDS     = 60 * 60 * 24 // session live seconds
	SESSION_MAP_KEY              = "hmsessionmap"
	SESSION_KEY_PREFIX           = "hmsession-"
	SESSION_GRANTORS_KEY         = "grantors"
	SESSION_GROUP_KEY            = "group"
	SESSION_SURVIVAL_SECONDS_KEY = "survival_seconds"
)

session

Variables

This section is empty.

Functions

This section is empty.

Types

type MyCookie

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

func (*MyCookie) Delete

func (self *MyCookie) Delete(cookieName string, w http.ResponseWriter) bool

func (*MyCookie) Get

func (self *MyCookie) Get(r *http.Request) map[string]string

func (*MyCookie) GetOne

func (self *MyCookie) GetOne(name string, r *http.Request) (value string)

func (*MyCookie) Set

func (self *MyCookie) Set(
	w http.ResponseWriter,
	data map[string]string,
	maxAge int) bool

func (*MyCookie) SetOne

func (self *MyCookie) SetOne(
	w http.ResponseWriter,
	name string,
	value string,
	maxAge int) bool

type MySession

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

func GetMatchedSession

func GetMatchedSession(w http.ResponseWriter, r *http.Request) (*MySession, error)

func NewSession

func NewSession(grantors string, longTerm bool, w http.ResponseWriter, r *http.Request) (*MySession, error)

func (*MySession) Delete

func (self *MySession) Delete(name string) error

func (*MySession) Destroy

func (self *MySession) Destroy() (bool, error)

func (*MySession) Get

func (self *MySession) Get(name string) (string, error)

func (*MySession) GetAll

func (self *MySession) GetAll() (map[string]string, error)

func (*MySession) Initialize

func (self *MySession) Initialize(
	grantors string,

	survivalSeconds int,
	w http.ResponseWriter,
	r *http.Request) error

func (*MySession) Key

func (self *MySession) Key() string

func (*MySession) SessionID

func (self *MySession) SessionID() string

func (*MySession) Set

func (self *MySession) Set(name string, value string) error

func (*MySession) SetBatch

func (self *MySession) SetBatch(contentMap map[string]string) error

Jump to

Keyboard shortcuts

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