cookie

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: 20 Imported by: 0

Documentation

Index

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

func (pder *CookieProvider) SessionExist(ctx context.Context, sid string) (bool, error)

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

func (pder *CookieProvider) SessionRead(ctx context.Context, sid string) (session.Store, error)

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

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.

func (*CookieSessionStore) Set

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

Set value to cookie session. the value are encoded as gob with hash block string.

Jump to

Keyboard shortcuts

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