Documentation ¶
Index ¶
- Variables
- func ActivityLoggingMiddleware(logger log.Logger) service.ActivityServiceMiddleware
- func ActivityMetrics(requestCount metrics.Counter, requestLatency metrics.Histogram) service.ActivityServiceMiddleware
- func NewTokenBucketLimitterWithBuildIn(bkt *rate.Limiter) endpoint.Middleware
- func NewTokenBucketLimitterWithJuju(bkt *ratelimit.Bucket) endpoint.Middleware
- func ProductLoggingMiddleware(logger log.Logger) service.ProductServiceMiddleware
- func ProductMetrics(requestCount metrics.Counter, requestLatency metrics.Histogram) service.ProductServiceMiddleware
- func SkAdminLoggingMiddleware(logger log.Logger) service.ServiceMiddleware
- func SkAdminMetrics(requestCount metrics.Counter, requestLatency metrics.Histogram) service.ServiceMiddleware
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimitExceed = errors.New("Rate limit exceed!")
Functions ¶
func ActivityLoggingMiddleware ¶
func ActivityLoggingMiddleware(logger log.Logger) service.ActivityServiceMiddleware
func ActivityMetrics ¶
func ActivityMetrics(requestCount metrics.Counter, requestLatency metrics.Histogram) service.ActivityServiceMiddleware
Metrics 封装监控方法
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 ProductLoggingMiddleware ¶
func ProductLoggingMiddleware(logger log.Logger) service.ProductServiceMiddleware
func ProductMetrics ¶
func ProductMetrics(requestCount metrics.Counter, requestLatency metrics.Histogram) service.ProductServiceMiddleware
Metrics 封装监控方法
func SkAdminLoggingMiddleware ¶
func SkAdminLoggingMiddleware(logger log.Logger) service.ServiceMiddleware
LoggingMiddleware make logging middleware
func SkAdminMetrics ¶
func SkAdminMetrics(requestCount metrics.Counter, requestLatency metrics.Histogram) service.ServiceMiddleware
Metrics 封装监控方法
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.