xormstore

package module
v0.0.0-...-d4fff28 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 4 Imported by: 0

README

scs-xormstore

A Xorm-based session store for SCS

Credits

This project is a conversion of Alex Edwards's scs-stores to use Xorm. Significant portions of the code are from the original project. The various existing stores can be found here: https://github.com/alexedwards/scs and the project is licensed under the MIT License, so this code is as well. A very big thank you to Alex for SCS, and the various Store implementations as well.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XORMSession

type XORMSession struct {
	Token  string    `xorm:"pk 'token'"`
	Data   []byte    `xorm:"data"`
	Expiry time.Time `xorm:"expiry"`
}

func (XORMSession) TableName

func (XORMSession) TableName() string

type XORMStore

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

func New

func New(db *xorm.Engine) *XORMStore

func NewWithCleanupInterval

func NewWithCleanupInterval(db *xorm.Engine, cleanupInterval time.Duration) *XORMStore

func (*XORMStore) All

func (p *XORMStore) All() (map[string][]byte, error)

func (*XORMStore) Commit

func (p *XORMStore) Commit(token string, b []byte, expiry time.Time) error

func (*XORMStore) Delete

func (p *XORMStore) Delete(token string) error

func (*XORMStore) Find

func (p *XORMStore) Find(token string) ([]byte, bool, error)

func (*XORMStore) StopCleanup

func (p *XORMStore) StopCleanup()

Jump to

Keyboard shortcuts

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