memory

package
v0.0.0-...-1f0f8b7 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "memory"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

func (*Config) Name

func (mc *Config) Name() string

type Provider

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

func NewProvider

func NewProvider() *Provider

new memory provider

func (*Provider) Count

func (mp *Provider) Count() int

session values count

func (*Provider) Destroy

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

destroy session by sessionId

func (*Provider) GC

func (mp *Provider) GC()

session garbage collection

func (*Provider) Init

func (mp *Provider) Init(lifeTime int64, memoryConfig fasthttpsession.ProviderConfig) error

init provider config

func (*Provider) NeedGC

func (mp *Provider) NeedGC() bool

need gc

func (*Provider) ReadStore

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

read session store by session id

func (*Provider) Regenerate

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

regenerate session

type Store

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

func NewMemoryStore

func NewMemoryStore(sessionId string) *Store

new default memory store

func NewMemoryStoreData

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

new memory store data

func (*Store) Save

func (ms *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