middlewares

package
v4.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package middlewares provides common middleware handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSRFMiddleware

func CSRFMiddleware(useHTTPS bool, salt string) func(http.Handler) http.Handler

CSRFMiddleware is a constructor that creates github.com/gorilla/csrf.CSRF struct

func MustBeMember

func MustBeMember(next http.Handler) http.Handler

func MustLogin

func MustLogin(next http.Handler) http.Handler

MustLogin is a middleware that checks existence of current user.

func MustLoginApi

func MustLoginApi(next http.Handler) http.Handler

MustLoginApi is a middleware that checks /api login.

func MustLoginApiStream

func MustLoginApiStream(next http.Handler) http.Handler

MustLoginApiStream is a middleware that checks /api/.../stream login.

func SetAccessTokens

func SetAccessTokens(next http.Handler) http.Handler

SetAccessTokens sets clusters data in context based on logged in user ID.

func SetClusters

func SetClusters(next http.Handler) http.Handler

SetClusters sets clusters data in context based on logged in user ID.

func SetContext

func SetContext(ctx context.Context) func(http.Handler) http.Handler

SetContext assigns context struct to every request handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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