context

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

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUser

func GetUser(r *http.Request) *repo.User

GetUser retrieves the User struct from the request context. The only time that we'll use this helper is when we logically expect there to be User struct value in the context, and if it doesn't exist it will firmly be an 'unexpected' error.

func SetUser

func SetUser(r *http.Request, u *repo.User) *http.Request

SetUser method returns a new copy of the request with the provided User struct added to the context. Note that we use our userContextKey constant as the key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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