middlewares

package
v0.0.0-...-2e00552 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const KeyMethod = "Method"

KeyMethod stores the key used to store

View Source
const KeyRequestID = "RequestID"

KeyRequestID key in echo context

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth() echo.MiddlewareFunc

BasicAuth Method middleware for setting method TODO: this is mock, use db(or usermanagement layer) for auth

func FileLogger

func FileLogger() echo.MiddlewareFunc

FileLogger logs access logs to a file named `/var/log/{processname}/access.log` if failed to get access log file it logs to standard out

func GetLogFile

func GetLogFile(typ string) (*os.File, error)

GetLogFile returns an io.Writer for log if already created returns the same otherwise creates a new buffered Writer and returns

func Method

func Method(next echo.HandlerFunc) echo.HandlerFunc

Method middleware for setting method why? Some routers do not allow DELETE,PATCH etc requests in that scenarios POST request with the http method `x` set as _method query parameter would interpreted as having `x` http method

func RequestID

func RequestID(next echo.HandlerFunc) echo.HandlerFunc

RequestID middleware for setting request id

Types

This section is empty.

Jump to

Keyboard shortcuts

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