Documentation
¶
Overview ¶
Package proxy - Backend 호출 구간에 대한 Rate Limit 적용 패키지
Index ¶
Constants ¶
View Source
const (
// MWNamespace - Middleware configuration 식별자
MWNamespace = "mw-ratelimit"
)
Variables ¶
This section is empty.
Functions ¶
func BackendFactory ¶
func BackendFactory(next proxy.BackendFactory) proxy.BackendFactory
BackendFactory - Proxy에서 운영될 Rate Limit 기능이 적용된 Backend Factory 생성
func NewBackendLimiter ¶
func NewBackendLimiter(bConf *config.BackendConfig) proxy.CallChain
NewBackendLimiter - Backend 호출에 대한 Rate Limit 기능을 제공하는 Middleware 생성
Types ¶
type Config ¶
type Config struct { MaxRate int `yaml:"max_rate"` // 초당 하용할 요청 수 FillInterval int `yaml:"fill_interval"` // Token 충전 기간 (Millisecond) FillCount int `yaml:"fill_count"` // FillInterval에 충전할 Token 수 }
Config - Rate Limit 구성을 위한 Configuration 구조
func ParseConfig ¶
ParseConfig - HTTPCache 운영을 위한 Configuration parsing 처리
Click to show internal directories.
Click to hide internal directories.