session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Name     string
	SignKey  []byte
	EncKey   []byte
	Lifetime int
	Domain   string
	// contains filtered or unexported fields
}

Manager handles encoding/decoding cookies

func (*Manager) Read

func (m *Manager) Read(req events.Request) (Session, error)

Read reads a cookie from a request

func (*Manager) Write

func (m *Manager) Write(sess Session) (string, error)

Write encodes a cookie from a Session

type Session

type Session struct {
	Nonce       string              `json:"state"`
	Login       string              `json:"login"`
	Memberships map[string][]string `json:"memberships"`
	Target      string              `json:"target"`
}

Session demribes the Session object

func (*Session) SetNonce

func (s *Session) SetNonce() error

SetNonce sets the nonce for the Session object

Jump to

Keyboard shortcuts

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