middleware

package
v0.0.0-...-134a4a7 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: BSD-3-Clause Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

middleware

web中间件

Documentation

Index

Constants

View Source
const HeaderKey = "X-Request-Id"

HeaderKey .

Variables

View Source
var CacheKeyAlgorithmMap = make(map[string]CacheKeyAlgorithm)

CacheKeyAlgorithmMap .

View Source
var DefaultAuthConfig = &AuthConfig{}

DefaultAuthConfig .

LruCache .

Functions

func EchoAuth

func EchoAuth() echo.MiddlewareFunc

EchoAuth .

func EchoAuthWithConfig

func EchoAuthWithConfig(authConfig *AuthConfig) echo.MiddlewareFunc

EchoAuthWithConfig 用于 echo 框架的签名校验中间件

func EchoCache

func EchoCache(cacheMaxEntryNum ...int) echo.MiddlewareFunc

EchoCache 用于 echo 框架的缓存中间件。支持自定义 cache 数量

func EchoLogger

func EchoLogger() echo.MiddlewareFunc

EchoLogger 用于 echo 框架的日志中间件

Types

type AuthConfig

type AuthConfig struct {
	// contains filtered or unexported fields
}

AuthConfig .

type CacheKeyAlgorithm

type CacheKeyAlgorithm interface {
	GenCacheKey(echo.Context) string
}

CacheKeyAlgorithm .

type CacheKeyFunc

type CacheKeyFunc func(echo.Context) string

CacheKeyFunc .

func (CacheKeyFunc) GenCacheKey

func (c CacheKeyFunc) GenCacheKey(ctx echo.Context) string

GenCacheKey .

type Stats

type Stats struct {
	Uptime       time.Time      `json:"uptime"`
	RequestCount uint64         `json:"request_count"`
	Statuses     map[string]int `json:"statuses"`
	// contains filtered or unexported fields
}

Stats .

func NewStats

func NewStats() *Stats

NewStats .

func (*Stats) Handle

func (s *Stats) Handle(c echo.Context) error

Handle is the endpoint to get stats.

func (*Stats) Process

func (s *Stats) Process() echo.MiddlewareFunc

Process .

Jump to

Keyboard shortcuts

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