file

package
v0.0.0-...-cb57f7f Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileProvider

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

FileProvider File session provider

func (*FileProvider) SessionAll

func (fp *FileProvider) SessionAll(context.Context) int

SessionAll Get active file session number. it walks save path to count files.

func (*FileProvider) SessionDestroy

func (fp *FileProvider) SessionDestroy(ctx context.Context, sid string) error

SessionDestroy Remove all files in this save path

func (*FileProvider) SessionExist

func (fp *FileProvider) SessionExist(ctx context.Context, sid string) (bool, error)

SessionExist Check file session exist. it checks the file named from sid exist or not.

func (*FileProvider) SessionGC

func (fp *FileProvider) SessionGC(context.Context)

SessionGC Recycle files in save path

func (*FileProvider) SessionInit

func (fp *FileProvider) SessionInit(ctx context.Context, maxlifetime int64, savePath string) error

SessionInit Init file session provider. savePath sets the session files path.

func (*FileProvider) SessionRead

func (fp *FileProvider) SessionRead(ctx context.Context, sid string) (session.Store, error)

SessionRead Read file session by sid. if file is not exist, create it. the file path is generated from sid string.

func (*FileProvider) SessionRegenerate

func (fp *FileProvider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)

SessionRegenerate Generate new sid for file session. it deletes old file and create new file named from new sid.

type FileSessionStore

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

FileSessionStore File session store

func (*FileSessionStore) Delete

func (fs *FileSessionStore) Delete(ctx context.Context, key interface{}) error

Delete value in file session by given key

func (*FileSessionStore) Flush

Flush Clean all values in file session

func (*FileSessionStore) Get

func (fs *FileSessionStore) Get(ctx context.Context, key interface{}) interface{}

Get value from file session

func (*FileSessionStore) SessionID

func (fs *FileSessionStore) SessionID(context.Context) string

SessionID Get file session store id

func (*FileSessionStore) SessionRelease

func (fs *FileSessionStore) SessionRelease(ctx context.Context, w http.ResponseWriter)

SessionRelease Write file session to local file with Gob string

func (*FileSessionStore) SessionReleaseIfPresent

func (fs *FileSessionStore) SessionReleaseIfPresent(ctx context.Context, w http.ResponseWriter)

SessionReleaseIfPresent Write file session to local file with Gob string when session exists

func (*FileSessionStore) Set

func (fs *FileSessionStore) Set(ctx context.Context, key, value interface{}) error

Set value to file session

Jump to

Keyboard shortcuts

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