proxy

package
v0.0.0-...-8d8ec1c Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

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

func ParseConfig(mwConf config.MWConfig) *Config

ParseConfig - HTTPCache 운영을 위한 Configuration parsing 처리

Jump to

Keyboard shortcuts

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