sqlite

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupInterval

func CleanupInterval(d time.Duration) func(*Store)

CleanupInterval specifies the interval with which to remove expired sessions from the SQLite database. Defaults to five minutes.

func TableName

func TableName(name string) func(*Store)

TableName specifies the name to use for the SQLite table to store sessions. Defaults to "sessions".

Types

type Option

type Option func(*Store)

Option specifies an option to alter the behavior of Store.

type Store

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

Store satisfies the jeff.Storage interface.

func New

func New(db *sql.DB, opts ...Option) (*Store, error)

New initializes a new sqlite Storage for jeff.

func (*Store) Delete

func (s *Store) Delete(_ context.Context, key []byte) error

Delete satisfies the jeff.Store.Delete method.

func (*Store) Fetch

func (s *Store) Fetch(_ context.Context, key []byte) ([]byte, error)

Fetch satisfies the jeff.Store.Fetch method.

func (*Store) Store

func (s *Store) Store(_ context.Context, key, value []byte, exp time.Time) error

Store satisfies the jeff.Store.Store method.

Jump to

Keyboard shortcuts

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