Documentation
¶
Index ¶
- type FileProvider
- func (fp *FileProvider) SessionAll(context.Context) int
- func (fp *FileProvider) SessionDestroy(ctx context.Context, sid string) error
- func (fp *FileProvider) SessionExist(ctx context.Context, sid string) (bool, error)
- func (fp *FileProvider) SessionGC(context.Context)
- func (fp *FileProvider) SessionInit(ctx context.Context, maxlifetime int64, savePath string) error
- func (fp *FileProvider) SessionRead(ctx context.Context, sid string) (session.Store, error)
- func (fp *FileProvider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)
- type FileSessionStore
- func (fs *FileSessionStore) Delete(ctx context.Context, key interface{}) error
- func (fs *FileSessionStore) Flush(context.Context) error
- func (fs *FileSessionStore) Get(ctx context.Context, key interface{}) interface{}
- func (fs *FileSessionStore) SessionID(context.Context) string
- func (fs *FileSessionStore) SessionRelease(ctx context.Context, w http.ResponseWriter)
- func (fs *FileSessionStore) SessionReleaseIfPresent(ctx context.Context, w http.ResponseWriter)
- func (fs *FileSessionStore) Set(ctx context.Context, key, value interface{}) error
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 ¶
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 ¶
SessionInit Init file session provider. savePath sets the session files path.
func (*FileProvider) SessionRead ¶
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 ¶
func (fs *FileSessionStore) Flush(context.Context) error
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