sess

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSessionFromStore

func GetSessionFromStore(store sessions.Store, r *http.Request) (*sessions.Session, error)

GetSessionFromStore ...

func GetUserName

func GetUserName(session *sessions.Session) (string, error)

GetUserName ...

func GetUserNameFromCtx

func GetUserNameFromCtx(ctx context.Context) string

GetUserNameFromCtx ...

func InitStoreFromConfig

func InitStoreFromConfig() *sessions.CookieStore

InitStoreFromConfig ...

func InitStoreFromTimeNow

func InitStoreFromTimeNow() *sessions.CookieStore

InitStoreFromTimeNow ...

func IsLogged

func IsLogged(session *sessions.Session, loggedDB db.LoggedDB) bool

IsLogged ...

func SetUserNameIntoCtx

func SetUserNameIntoCtx(ctx context.Context, username string) context.Context

SetUserNameIntoCtx ...

Types

type CtxKey

type CtxKey int

CtxKey ...

const (
	CtxSessionKey CtxKey = iota
	CtxUserNameKey
)

Context keys

Jump to

Keyboard shortcuts

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