Documentation ¶
Index ¶
- type Provider
- func (p *Provider) SessionAll(context.Context) int
- func (p *Provider) SessionDestroy(ctx context.Context, sid string) error
- func (p *Provider) SessionExist(ctx context.Context, sid string) (bool, error)
- func (p *Provider) SessionGC(context.Context)
- func (p *Provider) SessionInit(ctx context.Context, maxLifetime int64, cfg string) error
- func (p *Provider) SessionRead(ctx context.Context, sid string) (session.Store, error)
- func (p *Provider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)
- type SessionStore
- func (s *SessionStore) Delete(ctx context.Context, key interface{}) error
- func (s *SessionStore) Flush(context.Context) error
- func (s *SessionStore) Get(ctx context.Context, key interface{}) interface{}
- func (s *SessionStore) SessionID(context.Context) string
- func (s *SessionStore) SessionRelease(_ context.Context, _ http.ResponseWriter)
- func (s *SessionStore) SessionReleaseIfPresent(c context.Context, w http.ResponseWriter)
- func (s *SessionStore) 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 Provider ¶
type Provider struct { Host string `json:"host"` Port int `json:"port"` // contains filtered or unexported fields }
Provider holds ssdb client and configs
func (*Provider) SessionAll ¶
SessionAll not implemented
func (*Provider) SessionDestroy ¶
SessionDestroy destroy the sid
func (*Provider) SessionExist ¶
SessionExist judged whether sid existed in session
func (*Provider) SessionInit ¶
SessionInit init the ssdb with the config
func (*Provider) SessionRead ¶
SessionRead return a ssdb client session Store
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
SessionStore holds the session information which stored in ssdb
func (*SessionStore) Delete ¶
func (s *SessionStore) Delete(ctx context.Context, key interface{}) error
Delete the key in session store
func (*SessionStore) Flush ¶
func (s *SessionStore) Flush(context.Context) error
Flush delete all keys and values
func (*SessionStore) Get ¶
func (s *SessionStore) Get(ctx context.Context, key interface{}) interface{}
Get return the value by the key
func (*SessionStore) SessionID ¶
func (s *SessionStore) SessionID(context.Context) string
SessionID return the sessionID
func (*SessionStore) SessionRelease ¶
func (s *SessionStore) SessionRelease(_ context.Context, _ http.ResponseWriter)
SessionRelease Store the keyvalues into ssdb
func (*SessionStore) SessionReleaseIfPresent ¶
func (s *SessionStore) SessionReleaseIfPresent(c context.Context, w http.ResponseWriter)
SessionReleaseIfPresent is not supported now Because ssdb does not support lua script or SETXX command
Click to show internal directories.
Click to hide internal directories.