Documentation ¶
Index ¶
- type CookieProvider
- func (pder *CookieProvider) SessionAll(context.Context) int
- func (pder *CookieProvider) SessionDestroy(ctx context.Context, sid string) error
- func (pder *CookieProvider) SessionExist(ctx context.Context, sid string) (bool, error)
- func (pder *CookieProvider) SessionGC(context.Context)
- func (pder *CookieProvider) SessionInit(ctx context.Context, maxlifetime int64, config string) error
- func (pder *CookieProvider) SessionRead(ctx context.Context, sid string) (session.Store, error)
- func (pder *CookieProvider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)
- func (pder *CookieProvider) SessionUpdate(ctx context.Context, sid string) error
- type CookieSessionStore
- func (st *CookieSessionStore) Delete(ctx context.Context, key interface{}) error
- func (st *CookieSessionStore) Flush(context.Context) error
- func (st *CookieSessionStore) Get(ctx context.Context, key interface{}) interface{}
- func (st *CookieSessionStore) SessionID(context.Context) string
- func (st *CookieSessionStore) SessionRelease(_ context.Context, w http.ResponseWriter)
- func (st *CookieSessionStore) SessionReleaseIfPresent(ctx context.Context, w http.ResponseWriter)
- func (st *CookieSessionStore) 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 CookieProvider ¶
type CookieProvider struct {
// contains filtered or unexported fields
}
CookieProvider Cookie session provider
func (*CookieProvider) SessionAll ¶
func (pder *CookieProvider) SessionAll(context.Context) int
SessionAll Implement method, return 0.
func (*CookieProvider) SessionDestroy ¶
func (pder *CookieProvider) SessionDestroy(ctx context.Context, sid string) error
SessionDestroy Implement method, no used.
func (*CookieProvider) SessionExist ¶
SessionExist Cookie session is always existed
func (*CookieProvider) SessionGC ¶
func (pder *CookieProvider) SessionGC(context.Context)
SessionGC Implement method, no used.
func (*CookieProvider) SessionInit ¶
func (pder *CookieProvider) SessionInit(ctx context.Context, maxlifetime int64, config string) error
SessionInit Init cookie session provider with max lifetime and config json. maxlifetime is ignored. json config:
securityKey - hash string blockKey - gob encode hash string. it's saved as aes crypto. securityName - recognized name in encoded cookie string cookieName - cookie name maxage - cookie max life time.
func (*CookieProvider) SessionRead ¶
SessionRead Get SessionStore in cooke. decode cooke string to map and put into SessionStore with sid.
func (*CookieProvider) SessionRegenerate ¶
func (pder *CookieProvider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)
SessionRegenerate Implement method, no used.
func (*CookieProvider) SessionUpdate ¶
func (pder *CookieProvider) SessionUpdate(ctx context.Context, sid string) error
SessionUpdate Implement method, no used.
type CookieSessionStore ¶
type CookieSessionStore struct {
// contains filtered or unexported fields
}
CookieSessionStore Cookie SessionStore
func (*CookieSessionStore) Delete ¶
func (st *CookieSessionStore) Delete(ctx context.Context, key interface{}) error
Delete value in cookie session
func (*CookieSessionStore) Flush ¶
func (st *CookieSessionStore) Flush(context.Context) error
Flush Clean all values in cookie session
func (*CookieSessionStore) Get ¶
func (st *CookieSessionStore) Get(ctx context.Context, key interface{}) interface{}
Get value from cookie session
func (*CookieSessionStore) SessionID ¶
func (st *CookieSessionStore) SessionID(context.Context) string
SessionID Return id of this cookie session
func (*CookieSessionStore) SessionRelease ¶
func (st *CookieSessionStore) SessionRelease(_ context.Context, w http.ResponseWriter)
SessionRelease Write cookie session to http response cookie
func (*CookieSessionStore) SessionReleaseIfPresent ¶
func (st *CookieSessionStore) SessionReleaseIfPresent(ctx context.Context, w http.ResponseWriter)
SessionReleaseIfPresent Write cookie session to http response cookie when it is present This is a no-op for cookie sessions, because they are always present.