session

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cache *cache.Cache

Cache session cache variable

View Source
var ErrResponseNil = errors.New("can not set session, resp is nil")

ErrResponseNil used for to represent the error response, when it is nil

Functions

func ClearExpired

func ClearExpired()

ClearExpired delete all expired session

func Delete

func Delete(sid string)

Delete delete the session uuid

func DeletingKeySuccessiveFailure

func DeletingKeySuccessiveFailure(resp *http.Response)

DeletingKeySuccessiveFailure deleting key successes and failures

func Get

func Get(sid string) (ep interface{}, ok bool)

Get return endpoint based on session uuid

func GetContextMetadata

func GetContextMetadata(ctx context.Context, key string) string

GetContextMetadata gets data from context

func GetSessionCookie

func GetSessionCookie(ctx context.Context, resp *http.Response) string

GetSessionCookie getting session cookie

func GetSessionFromResp

func GetSessionFromResp(cookieKey string, resp *http.Response) string

GetSessionFromResp return session uuid in resp if there is

func Save

func Save(sid string, ep string, timeOut time.Duration)

Save for setting the session uuid, endpoint, timeout

func SaveSessionIDFromContext added in v0.7.1

func SaveSessionIDFromContext(ctx context.Context, ep string, autoTimeout int) context.Context

SaveSessionIDFromContext check session id in response ctx and save it to session storage

func SaveSessionIDFromHTTP added in v0.7.1

func SaveSessionIDFromHTTP(ep string, autoTimeout int, resp *http.Response, req *http.Request)

SaveSessionIDFromHTTP check session id

func SetContextMetadata

func SetContextMetadata(ctx context.Context, key string, value string) context.Context

SetContextMetadata sets data to context

Types

This section is empty.

Jump to

Keyboard shortcuts

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