context

package
v0.0.0-...-3a5708c Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package context allows for collecting per-request-data like authentication, session or routing information. It abstracts from "how" the information is saved on the request and provides a highly application-specific interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// UserId is the unique id of the user, when he authenticated, or the empty
	// string otherwise.
	UserId string
}

func Load

func Load(request *http.Request) Context

func (Context) IsAuthenticated

func (c Context) IsAuthenticated() bool

func (Context) Save

func (c Context) Save(request *http.Request)

Jump to

Keyboard shortcuts

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