session

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 10 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VirtualSessionProvider

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

VirtualSessionProvider represents a shadowed session provider implementation.

func (*VirtualSessionProvider) Count

func (o *VirtualSessionProvider) Count() int

Count counts and returns number of sessions.

func (*VirtualSessionProvider) Destroy added in v1.10.0

func (o *VirtualSessionProvider) Destroy(sid string) error

Destroy deletes a session by session ID.

func (*VirtualSessionProvider) Exist

func (o *VirtualSessionProvider) Exist(sid string) bool

Exist returns true if session with given ID exists.

func (*VirtualSessionProvider) GC

func (o *VirtualSessionProvider) GC()

GC calls GC to clean expired sessions.

func (*VirtualSessionProvider) Init

func (o *VirtualSessionProvider) Init(gclifetime int64, config string) error

Init initializes the cookie session provider with given root path.

func (*VirtualSessionProvider) Read

Read returns raw session store by session ID.

func (*VirtualSessionProvider) Regenerate

func (o *VirtualSessionProvider) Regenerate(oldsid, sid string) (session.RawStore, error)

Regenerate regenerates a session store from old session ID to new one.

type VirtualStore

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

VirtualStore represents a virtual session store implementation.

func NewVirtualStore

func NewVirtualStore(p *VirtualSessionProvider, sid string, kv map[interface{}]interface{}) *VirtualStore

NewVirtualStore creates and returns a virtual session store.

func (*VirtualStore) Delete

func (s *VirtualStore) Delete(key interface{}) error

Delete delete a key from session.

func (*VirtualStore) Flush

func (s *VirtualStore) Flush() error

Flush deletes all session data.

func (*VirtualStore) Get

func (s *VirtualStore) Get(key interface{}) interface{}

Get gets value by given key in session.

func (*VirtualStore) ID

func (s *VirtualStore) ID() string

ID returns current session ID.

func (*VirtualStore) Release

func (s *VirtualStore) Release() error

Release releases resource and save data to provider.

func (*VirtualStore) Set

func (s *VirtualStore) Set(key, val interface{}) error

Set sets value to given key in session.

Jump to

Keyboard shortcuts

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