session

package
v0.0.0-...-b9c0981 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

session package provides typesafe access to session data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KratosSession

type KratosSession struct {
	// contains filtered or unexported fields
}

KratosSession is used to access information from a Kratos 'Session' JSON payload

func NewKratosSession

func NewKratosSession(s string) KratosSession

func (KratosSession) AddressVerified

func (ks KratosSession) AddressVerified() bool

func (KratosSession) Email

func (ks KratosSession) Email() string

func (KratosSession) FirstName

func (ks KratosSession) FirstName() string

func (KratosSession) Id

func (ks KratosSession) Id() string

func (KratosSession) Json

func (ks KratosSession) Json() string

func (KratosSession) JsonPretty

func (ks KratosSession) JsonPretty() string

func (KratosSession) LastName

func (ks KratosSession) LastName() string

type SessionStore

type SessionStore struct {
	// Session store
	Store *sessions.CookieStore
}

SessionStore holds a connection to the application Session store

func (SessionStore) GetKratosSession

func (s SessionStore) GetKratosSession(r *http.Request) *KratosSession

GetKratosSession returns the KratosSession or nil

func (SessionStore) SaveKratosSession

func (s SessionStore) SaveKratosSession(w http.ResponseWriter, r *http.Request, ks string) error

SaveKratosSession stores a string as the KratosSession value

Jump to

Keyboard shortcuts

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