file

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "file"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// session file save path
	SavePath string

	// session file suffix
	Suffix string

	// 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 (*Config) Name

func (fc *Config) Name() string

type Provider

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

func NewProvider

func NewProvider() *Provider

new file provider

func (*Provider) Count

func (fp *Provider) Count() int

session values count

func (*Provider) Destroy

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

destroy session by sessionId

func (*Provider) GC

func (fp *Provider) GC()

session garbage collection

func (*Provider) Init

func (fp *Provider) Init(lifeTime int64, fileConfig fasthttpsession.ProviderConfig) error

init provider config

func (*Provider) NeedGC

func (fp *Provider) NeedGC() bool

need gc

func (*Provider) ReadStore

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

read session store by session id

func (*Provider) Regenerate

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

regenerate session

type Store

type Store struct {
	fasthttpsession.Store
}

func (*Store) Save

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