middleware

package
v0.0.0-...-3f61646 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIMetrics

func APIMetrics(conf std.ConfigPrometheus) func(echo.HandlerFunc) echo.HandlerFunc

APIMetrics collects the API metrics

func All

func All(fallbackErr error, andHandlers ...ArgsCheckHandlerFunc) echo.MiddlewareFunc

func CloneBody

func CloneBody(ctx echo.Context) []byte

func Either

func Either(fallbackErr error, orHandlers ...ArgsCheckHandlerFunc) echo.MiddlewareFunc

func GetUserInfoOrDefaultInfo

func GetUserInfoOrDefaultInfo(handle echo.HandlerFunc) echo.HandlerFunc

func ParseUA

func ParseUA(myUA string) string

func ProcessGetBindData

func ProcessGetBindData(handle echo.HandlerFunc) echo.HandlerFunc

func ProcessGetBindDataO

func ProcessGetBindDataO(handle echo.HandlerFunc) echo.HandlerFunc

func RateLimit

func RateLimit(limiter *std.ConfigRateLimiter) echo.MiddlewareFunc

RateLimit protects the APIs.

func RequestCORS

func RequestCORS() echo.MiddlewareFunc

func RequestRealIp

func RequestRealIp(h echo.HandlerFunc) echo.HandlerFunc

func ServerErrorHandler

func ServerErrorHandler(err error, c echo.Context)

func UserInfo

func UserInfo(handle echo.HandlerFunc) echo.HandlerFunc

UserInfo gets user info

func UserLoginRequired

func UserLoginRequired(handle echo.HandlerFunc) echo.HandlerFunc

* 验证是否登录

Types

type ArgsCheckHandlerFunc

type ArgsCheckHandlerFunc func(echo.Context, []byte) error

type MessageLog

type MessageLog struct {
	UserId       int64
	OpenId       string
	Path         string
	InputStream  string
	OutPutStream error
	KeyWord      string
	ClientIP     string
	AccessToken  string
}

* 跨域配置

Jump to

Keyboard shortcuts

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