middleware

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package middleware implements various middlewares specific for long-season application usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v0.4.0

func Debug(c models.Config) func(http.Handler) http.Handler

Debug injects information about application debug mode to every http request's context.

func DeviceID

func DeviceID(next http.Handler) http.Handler

DeviceID injects user id into request context.

func Private

func Private(renewer session.Renewer) func(http.Handler) http.Handler

Private checks if given user id is equal to user id at current session state.

func RedirectLoggedIn

func RedirectLoggedIn(renewer session.Renewer) func(http.Handler) http.Handler

RedirectLoggedIn redirects logged in users to homepage.

func URLParamInjection

func URLParamInjection(param string) func(http.Handler) http.Handler

URLParamInjection injects given chi parameter into request context.

func UpdateAuth

func UpdateAuth(c *models.Config) func(http.Handler) http.Handler

func UserID

func UserID(next http.Handler) http.Handler

UserID injects user id into request context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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