session

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBStore

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

DBStore is a postgres-backed store for user sessions.

func NewDBStore

func NewDBStore(dbURL string) (*DBStore, error)

NewDBStore creates a new DB store

func (*DBStore) Delete

func (s *DBStore) Delete(ctx context.Context, sess *entity.Session) error

Delete deletes the session with the given ID, essentially logging the user out.

func (*DBStore) ExtendExpiry added in v0.1.3

func (s *DBStore) ExtendExpiry(ctx context.Context, sess *entity.Session) error

ExtendExpiry extends the expiry of the given cookie.

func (*DBStore) Get

func (s *DBStore) Get(ctx context.Context, sessionID string) (*entity.Session, error)

Get gets a session by session ID

func (*DBStore) New

func (s *DBStore) New(ctx context.Context, user *entity.User) (*entity.Session, error)

New should be called when a user logs in. It'll create a new session.

Jump to

Keyboard shortcuts

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