inmem

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver represents the in-memory session storage driver built using hashicorp/go-memdb

func New

func New() (*Driver, error)

New creates a new empty in-memory session storage driver

func (*Driver) Create

func (driver *Driver) Create(_ context.Context, userID, sessionID string, expires int64) (string, error)

Create creates a new session

func (*Driver) GetByRawToken

func (driver *Driver) GetByRawToken(_ context.Context, rawToken string) (*session.Session, error)

GetByRawToken retrieves a session by its raw (prior hashing) token

func (*Driver) TerminateBySessionID

func (driver *Driver) TerminateBySessionID(_ context.Context, sessionID string) error

TerminateBySessionID terminates a session by its session ID

func (*Driver) TerminateByUserID

func (driver *Driver) TerminateByUserID(_ context.Context, userID string) error

TerminateByUserID terminates all sessions of a specific user ID

func (*Driver) TerminateExpired

func (driver *Driver) TerminateExpired(_ context.Context) (int, error)

TerminateExpired terminates all sessions that are expired

Jump to

Keyboard shortcuts

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