sessions

package
v0.0.0-...-9f56b5f Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrSessionDoesNotExist is returned when an invalid token/key pair is presented
	ErrSessionDoesNotExist = errors.Error("session with that token/key pair does not exist")
)
View Source
const (
	// SessionTimeout (in seconds) is the ttl for sessions, an action will refresh the duration
	SessionTimeout = 60 * 60 * 12 // 12 hours
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Sessions

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

Sessions manages sessions

func New

func New(dir string) *Sessions

New will return a new instance of sessions

func (*Sessions) Close

func (s *Sessions) Close() (err error)

Close will close an instance of Sessions

func (*Sessions) Get

func (s *Sessions) Get(token, key string) (uuid string, err error)

Get will retrieve the UUID associated with a provided token/key pair

func (*Sessions) New

func (s *Sessions) New(uuid string) (token, key string)

New will creata new token/key pair

func (*Sessions) Purge

func (s *Sessions) Purge(oldest int64)

Purge will purge all entries oldest than the oldest value

Jump to

Keyboard shortcuts

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