Documentation ¶
Index ¶
- Constants
- Variables
- func EchoAsync() echo.MiddlewareFunc
- func EchoAuth() echo.MiddlewareFunc
- func EchoAuthWithConfig(authConfig *AuthConfig) echo.MiddlewareFunc
- func EchoCache(cacheMaxEntryNum ...int) echo.MiddlewareFunc
- func EchoLogger() echo.MiddlewareFunc
- func EchoLoggerWitchConfig(loggerConfig *LoggerConfig) echo.MiddlewareFunc
- type AuthConfig
- type CacheKeyAlgorithm
- type CacheKeyFunc
- type LoggerConfig
- type Stats
Constants ¶
View Source
const HeaderKey = "X-Request-Id"
Variables ¶
View Source
var CacheKeyAlgorithmMap = make(map[string]CacheKeyAlgorithm)
View Source
var DefaultAuthConfig = &AuthConfig{}
View Source
var DefaultLoggerConfig = &LoggerConfig{}
View Source
var LruCache = nosql.DefaultLRUCache
Functions ¶
func EchoAuth ¶
func EchoAuth() echo.MiddlewareFunc
func EchoAuthWithConfig ¶
func EchoAuthWithConfig(authConfig *AuthConfig) echo.MiddlewareFunc
EchoAuth 用于 echo 框架的签名校验中间件
func EchoCache ¶
func EchoCache(cacheMaxEntryNum ...int) echo.MiddlewareFunc
EchoCache 用于 echo 框架的缓存中间件。支持自定义 cache 数量
func EchoLogger ¶
func EchoLogger() echo.MiddlewareFunc
func EchoLoggerWitchConfig ¶
func EchoLoggerWitchConfig(loggerConfig *LoggerConfig) echo.MiddlewareFunc
EchoLoggerWitchConfig 用于 echo 框架的日志中间件
Types ¶
type AuthConfig ¶
type AuthConfig struct {
// contains filtered or unexported fields
}
func NewAuthConfig ¶
type CacheKeyAlgorithm ¶
type CacheKeyFunc ¶
func (CacheKeyFunc) GenCacheKey ¶
func (self CacheKeyFunc) GenCacheKey(ctx echo.Context) string
type LoggerConfig ¶
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 }
func (*Stats) Process ¶
func (s *Stats) Process() echo.MiddlewareFunc
Click to show internal directories.
Click to hide internal directories.