sessions

package
v0.0.0-...-f5f780e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2013 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package session provide an interface to handle web application session.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	SetCookieName(name string)
	CookieName() string
	SetExpiration(time.Duration)
	Expiration() time.Duration
	SetMatchRemoteAddr(match bool)
	MatchRemoteAddr() bool
	SetMatchUserAgent(match bool)
	MatchUserAgent() bool

	Set(name string, val interface{}) error
	Get(name string) interface{}
	GetInt(name string) int
	GetBool(name string) bool
	GetString(name string) string
	Delete(name ...string) error
	DeleteAll(flash bool) error

	SetFlash(name string, val interface{}) error
	GetFlash(name string) interface{}
	GetFlashInt(name string) int
	GetFlashBool(name string) bool
	GetFlashString(name string) string

	Destroy() error
}

Provider is the interface for the session management system

type SessionEntry

type SessionEntry struct {
	Id           string `bson:"_id" datastore:"-"`
	RemoteAddr   string
	UserAgent    string
	LastActivity time.Time
	Data         map[string]interface{}
	FlashData    map[string]interface{}
}

SessionEntry is a piece of infomation you save in database (or mem-cache) to handle sessions n general.

func NewSessionEntry

func NewSessionEntry(addr, agent string) *SessionEntry

NewSessionEntry return a new SessionEntry

Jump to

Keyboard shortcuts

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