session

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieName = "heimdallr"
)

Variables

View Source
var (
	Expiration        = 24 * time.Hour
	ErrSessionExpired = xerrors.New("session: expired")
)

Functions

This section is empty.

Types

type MemcachedStore

type MemcachedStore struct {
	Domain string
	// contains filtered or unexported fields
}

func NewMemcachedStore

func NewMemcachedStore(conf *configv2.Session, domain string) *MemcachedStore

func (*MemcachedStore) GetSession

func (m *MemcachedStore) GetSession(req *http.Request) (*Session, error)

func (*MemcachedStore) SetSession

func (m *MemcachedStore) SetSession(w http.ResponseWriter, sess *Session) error

type SecureCookieStore

type SecureCookieStore struct {
	Domain string
	// contains filtered or unexported fields
}

func NewSecureCookieStore

func NewSecureCookieStore(hasKey, blockKey []byte, domain string) *SecureCookieStore

func (*SecureCookieStore) Cookie

func (s *SecureCookieStore) Cookie(sess *Session) (*http.Cookie, error)

func (*SecureCookieStore) DecodeValue added in v0.10.0

func (s *SecureCookieStore) DecodeValue(name, value string) (*Session, error)

func (*SecureCookieStore) GetSession

func (s *SecureCookieStore) GetSession(req *http.Request) (*Session, error)

func (*SecureCookieStore) SetSession

func (s *SecureCookieStore) SetSession(w http.ResponseWriter, sess *Session) error

type Session

type Session struct {
	Unique          string // Unique is a random value
	Id              string // Id is an identifier of user
	IssuedAt        time.Time
	Challenge       string
	ChallengeMethod string
	From            string
}

func New

func New(id string) *Session

func (*Session) SetId

func (s *Session) SetId(id string)

type Store

type Store interface {
	GetSession(req *http.Request) (*Session, error)
	SetSession(w http.ResponseWriter, sess *Session) error
}

Jump to

Keyboard shortcuts

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