sessions

package
v0.0.0-...-4c8c1f2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2013 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2012 The Toys Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2012 The Toys Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound error = errors.New("session: entry not found in database")
	ErrNoCookie error = errors.New("session: session cookie not found")
	ErrInvalid  error = errors.New("session: invalid session data")
)

Functions

This section is empty.

Types

type MgoProvider

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

func (*MgoProvider) CookieName

func (p *MgoProvider) CookieName() string

func (*MgoProvider) Delete

func (p *MgoProvider) Delete(name ...string) error

func (*MgoProvider) DeleteAll

func (p *MgoProvider) DeleteAll(flash bool) error

func (*MgoProvider) Destroy

func (p *MgoProvider) Destroy() error

func (*MgoProvider) Expiration

func (p *MgoProvider) Expiration() int

func (*MgoProvider) Get

func (p *MgoProvider) Get(name string) interface{}

func (*MgoProvider) GetBool

func (p *MgoProvider) GetBool(name string) bool

func (*MgoProvider) GetFlash

func (p *MgoProvider) GetFlash(name string) interface{}

func (*MgoProvider) GetFlashBool

func (p *MgoProvider) GetFlashBool(name string) bool

func (*MgoProvider) GetFlashInt

func (p *MgoProvider) GetFlashInt(name string) int

func (*MgoProvider) GetFlashString

func (p *MgoProvider) GetFlashString(name string) string

func (*MgoProvider) GetInt

func (p *MgoProvider) GetInt(name string) int

func (*MgoProvider) GetString

func (p *MgoProvider) GetString(name string) string

func (*MgoProvider) MatchRemoteAddr

func (p *MgoProvider) MatchRemoteAddr() bool

func (*MgoProvider) MatchUserAgent

func (p *MgoProvider) MatchUserAgent() bool

func (*MgoProvider) Set

func (p *MgoProvider) Set(name string, val interface{}) error

func (*MgoProvider) SetCookieName

func (p *MgoProvider) SetCookieName(name string)

func (*MgoProvider) SetExpiration

func (p *MgoProvider) SetExpiration(exp int)

func (*MgoProvider) SetFlash

func (p *MgoProvider) SetFlash(name string, val interface{}) error

func (*MgoProvider) SetMatchRemoteAddr

func (p *MgoProvider) SetMatchRemoteAddr(match bool)

func (*MgoProvider) SetMatchUserAgent

func (p *MgoProvider) SetMatchUserAgent(match bool)

type Provider

type Provider interface {
	SetCookieName(name string)
	CookieName() string
	SetExpiration(exp int)
	Expiration() int
	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
}

func NewMgoProvider

func NewMgoProvider(w http.ResponseWriter, r *http.Request,
	c *mgo.Collection) Provider

Jump to

Keyboard shortcuts

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