buntstore

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package buntstore is a buntdb based session store for the SCS session package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuntStore

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

BuntStore is a SCS session store backed by a buntdb file.

func New

func New(db *buntdb.DB) *BuntStore

New creates a BuntStore instance.

func (*BuntStore) Delete

func (bs *BuntStore) Delete(token string) error

Delete removes session token and corresponding data.

func (*BuntStore) Find

func (bs *BuntStore) Find(token string) (b []byte, exists bool, err error)

Find returns the data for a session token. If the session token is not found or is expired, the exists flag will be false.

func (*BuntStore) Save

func (bs *BuntStore) Save(token string, b []byte, expiry time.Time) error

Save updates data for a given session token with a given expiry. Any existing data + expiry will be over-written.

Jump to

Keyboard shortcuts

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