session

package
v3.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(store Store, maxAge time.Duration) *Authenticator

func (*Authenticator) AuthenticateRequest

func (a *Authenticator) AuthenticateRequest(req *http.Request) (user.Info, bool, error)

func (*Authenticator) AuthenticationSucceeded

func (a *Authenticator) AuthenticationSucceeded(user user.Info, state string, w http.ResponseWriter, req *http.Request) (bool, error)

func (*Authenticator) InvalidateAuthentication

func (a *Authenticator) InvalidateAuthentication(w http.ResponseWriter, req *http.Request) error

type Store

type Store interface {
	// Get and decode the Values associated with the given request
	Get(r *http.Request) Values
	// Put encodes and writes the given Values to the response
	Put(w http.ResponseWriter, v Values) error
}

Store abstracts HTTP session storage of Values

func NewStore

func NewStore(name string, secure bool, secrets ...[]byte) Store

type Values

type Values map[interface{}]interface{}

func (Values) GetInt64

func (v Values) GetInt64(key string) (int64, bool)

func (Values) GetString

func (v Values) GetString(key string) (string, bool)

Jump to

Keyboard shortcuts

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