session

package
v0.0.0-...-8968538 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package session manages the sessions for the application.

sn - https://github.com/sn

Index

Constants

View Source
const Expiration = 86400

Expiration represents how much time a session lasts (one day)

Variables

This section is empty.

Functions

func Bump

func Bump(id types.UUID) error

Bump bumps the expiration time up for a given session UUID

func Clean

func Clean()

Clean removes any expired sessions

func Expire

func Expire(id types.UUID) error

Expire sets the expiration of a session well into the past

func Remove

func Remove(id types.UUID) error

Remove removes a session from the existing sessions

Types

type Session

type Session struct {
	ID      types.UUID
	UserID  types.UUID
	Expires time.Time
}

Session contains a user's session

func Create

func Create(userID types.UUID) Session

Create creates a new session

func Find

func Find(hash string) Session

Find retrieves a session given a session hash

func Get

func Get(id types.UUID) Session

Get retrieves a session given a user ID

func GetAll

func GetAll() []Session

GetAll retrieves all sessions

Jump to

Keyboard shortcuts

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