middleware

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package middleware defines the signature/type which can be added as a middleware to Webgo. It also has a 2 default middleware access logs & CORS handling. This package also provides 2 chainable to handlers to handle CORS in individual routes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLog

func AccessLog(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc)

AccessLog is a middleware which prints access log to stdout

func Cors

func Cors(allowedOrigins ...string) http.HandlerFunc

Cors is a basic CORS middleware which can be added to individual handlers

func CorsOptions

func CorsOptions(allowedOrigins ...string) http.HandlerFunc

CorsOptions is a CORS middleware only for OPTIONS request method

func CorsWrap

func CorsWrap(allowedOrigins ...string) func(http.ResponseWriter, *http.Request, http.HandlerFunc)

CorsWrap is a single Cors middleware which can be applied to the whole app at once

Types

This section is empty.

Jump to

Keyboard shortcuts

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