middlewares

package
v4.2.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2016 License: MIT Imports: 14 Imported by: 0

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 SetAddr

func SetAddr(addr string) func(http.Handler) http.Handler

SetAddr passes daemon host and port to every request handler

func SetClusters

func SetClusters(next http.Handler) http.Handler

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

func SetCookieStore

func SetCookieStore(cookieStore *sessions.CookieStore) func(http.Handler) http.Handler

SetCookieStore passes cookie storage to every request handler

func SetDBs

func SetDBs(dbConfig *config.DBConfig) func(http.Handler) http.Handler

SetDBs passes all database connections to every request handler

func SetLogger

func SetLogger(loggerType string, logger *logrus.Logger) func(http.Handler) http.Handler

SetLogger passes logger struct to every request handler

func SetMailers

func SetMailers(mailers map[string]*mailer.Mailer) func(http.Handler) http.Handler

SetMailers passes all mailers to every request handler

func SetMessageBus

func SetMessageBus(bus *messagebus.MessageBus) func(http.Handler) http.Handler

SetMessageBus passes a message bus to every request handler

func SetVIPAddr

func SetVIPAddr(vipAddr string) func(http.Handler) http.Handler

SetVIPAddr passes VIP host and port to every request handler

func SetVIPProtocol

func SetVIPProtocol(vipProtocol string) func(http.Handler) http.Handler

SetVIPProtocol passes VIP protocol 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