sqlite3

package
v0.0.0-...-04dacc1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "sqlite3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// sqlite3 db file path
	DBPath string

	// session table name
	TableName string

	// sqlite3 max free idle
	SetMaxIdleConn int

	// sqlite3 max open idle
	SetMaxOpenConn int

	// session value serialize func
	SerializeFunc func(data map[string]interface{}) ([]byte, error)

	// session value unSerialize func
	UnSerializeFunc func(data []byte) (map[string]interface{}, error)
}

func NewConfigWith

func NewConfigWith(dbPath, tableName string) (cf *Config)

func (*Config) Name

func (sc *Config) Name() string

type Provider

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

func NewProvider

func NewProvider() *Provider

new sqlite3 provider

func (*Provider) Count

func (sp *Provider) Count() int

session values count

func (*Provider) Destroy

func (sp *Provider) Destroy(sessionId string) error

destroy session by sessionId

func (*Provider) GC

func (sp *Provider) GC()

session sqlite3 provider not need garbage collection

func (*Provider) Init

func (sp *Provider) Init(lifeTime int64, sqlite3Config fasthttpsession.ProviderConfig) error

init provider config

func (*Provider) NeedGC

func (sp *Provider) NeedGC() bool

not need gc

func (*Provider) ReadStore

func (sp *Provider) ReadStore(sessionId string) (fasthttpsession.SessionStore, error)

read session store by session id

func (*Provider) Regenerate

func (sp *Provider) Regenerate(oldSessionId string, sessionId string) (fasthttpsession.SessionStore, error)

regenerate session

type Store

type Store struct {
	fasthttpsession.Store
}

func NewSqLite3Store

func NewSqLite3Store(sessionId string) *Store

new default sqlite3 store

func NewSqLite3StoreData

func NewSqLite3StoreData(sessionId string, data map[string]interface{}) *Store

new sqlite3 store data

func (*Store) Save

func (ss *Store) Save(ctx *fasthttp.RequestCtx) error

save store

Jump to

Keyboard shortcuts

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