router

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: 3 Imported by: 0

Documentation

Overview

Package router - Endpoint 처리 구간에 Rate Limit 기능을 제공하는 Router 패키지

Index

Constants

View Source
const (
	// MWNamespace - Middleware configuration 식별자
	MWNamespace = "mw-ratelimit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxRate       int    `yaml:"max_rate"`        // 초당 허용할 요청 수
	ClientMaxRate int    `yaml:"client_max_rate"` // 클라이언트별 초당 허용할 요청 수
	FillInterval  int    `yaml:"fill_interval"`   // Token 충전 기간 (Millisecond)
	FillCount     int    `yaml:"fill_count"`      // FillInterval에 충전할 Token 수
	Strategy      string `yaml:"strategy"`        // 클라이언트 식별 방법 ('ip', 'header')
	Key           string `yaml:"key"`             // 클라이언트를 header로 식별할 경우의 header key 값 (ex. X-Private-Token, ...)
}

Config - Rate Limit 적용을 위한 Router Middleware Configuration 구조

func ParseConfig

func ParseConfig(eConf *config.EndpointConfig) *Config

ParseConfig - RateLimit 운영을 위한 Configuration parser 처리

Directories

Path Synopsis
Package gin - Gin Route (Endpoint) 처리 구간에 Rate Limit 기능을 제공하는 Gin Router 패키지
Package gin - Gin Route (Endpoint) 처리 구간에 Rate Limit 기능을 제공하는 Gin Router 패키지

Jump to

Keyboard shortcuts

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