plugins

package
v0.0.0-...-bae3b6f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitExceed = errors.New("Rate limit exceed!")

Functions

func NewTokenBucketLimitterWithBuildIn

func NewTokenBucketLimitterWithBuildIn(bkt *rate.Limiter) endpoint.Middleware

NewTokenBucketLimitterWithBuildIn 使用x/time/rate创建限流中间件

func NewTokenBucketLimitterWithJuju

func NewTokenBucketLimitterWithJuju(bkt *ratelimit.Bucket) endpoint.Middleware

NewTokenBucketLimitterWithJuju 使用juju/ratelimit创建限流中间件

func SkAppLoggingMiddleware

func SkAppLoggingMiddleware(logger log.Logger) service.ServiceMiddleware

LoggingMiddleware make logging middleware

func SkAppMetrics

func SkAppMetrics(requestCount metrics.Counter, requestLatency metrics.Histogram) service.ServiceMiddleware

Metrics 封装监控方法

Types

This section is empty.

Jump to

Keyboard shortcuts

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