Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { URL string `json:"url"` RemoteAddr string `json:"remoteAddr"` RequestCount int64 `json:"requestCount"` }
Claims define rate limiter model
type RateLimiterService ¶
type RateLimiterService interface { // RequireResource require access resource // if too many request will return error // must input addr because addr is unique key to identity which ip income RequireResource(ctx context.Context, addr string, url string) (claims *Claims, err error) }
RateLimiterService define rate limiter
Click to show internal directories.
Click to hide internal directories.