Documentation ¶
Index ¶
- Variables
- func Persist(c *container.Registry, i interface{}) error
- func PersistKey(c *container.Registry, key string, i interface{}) error
- type Bundle
- type CookieOptions
- type GobSerializer
- type IdGenerator
- type Manager
- type RandGenerator
- type Serializer
- type Session
- func (c *Session) Contains(key string) (contains bool)
- func (c *Session) Get(name string) (value interface{})
- func (c *Session) ID() string
- func (c *Session) Lookup(name string) (data interface{}, found bool)
- func (c *Session) Set(name string, val interface{})
- func (c *Session) Unset(keys ...string)
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultManager = New(time.Hour, time.Hour*2, file.New("./resources/sessions"), GobSerializer{}, RandGenerator{}) DefaultCookieOptions = &CookieOptions{ Name: "__gsid", } )
View Source
var (
SessionType = reflect.TypeOf((*Session)(nil))
)
Functions ¶
Types ¶
type Bundle ¶
type Bundle struct { CookieOptions *CookieOptions Manager *Manager }
type CookieOptions ¶
type GobSerializer ¶
type GobSerializer struct{}
func (GobSerializer) Serialize ¶
func (serializer GobSerializer) Serialize(src interface{}, writer io.Writer) error
func (GobSerializer) Unserialize ¶
func (serializer GobSerializer) Unserialize(dst interface{}, reader io.Reader) error
type IdGenerator ¶
IdGenerator this interface represents an id generator
type Manager ¶
type Manager struct { Global *container.Registry Generator IdGenerator Store Store Serializer Serializer Duration time.Duration // contains filtered or unexported fields }
func New ¶
func New(gcEvery time.Duration, duration time.Duration, store Store, serializer Serializer, generator IdGenerator) *Manager
New returns a new session
type RandGenerator ¶
type RandGenerator struct{}
func (RandGenerator) Generate ¶
func (RandGenerator) Generate(id, name string) string
type Serializer ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.