session

package
v0.0.0-...-66cff79 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

View Source
const (
	FullMask uint8 = (1 << iota)
	AdminMask
)

Variables

View Source
var (
	// lifetime of session in seconds
	DefaultLifetime = 24 * 60 * 60
)

Functions

This section is empty.

Types

type Session

type Session struct {
	Id        string `json:"-"`
	Mask      uint8  `json:"m,omitempty"`
	ProfileID int    `json:"user_id,omitempty"`
}

func (*Session) HasAdmin

func (p *Session) HasAdmin() bool

func (*Session) HasFull

func (p *Session) HasFull() bool

func (*Session) Set

func (p *Session) Set(mask uint8)

func (*Session) Unset

func (p *Session) Unset(mask uint8)

type Storage

type Storage interface {
	Read(string) (*Session, error)
	Write(*Session) error
}

func NewRedisBackend

func NewRedisBackend(dns, prefix string, persistent bool) (Storage, error)

Jump to

Keyboard shortcuts

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