domain

package
v0.0.0-...-63c9274 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 1 Imported by: 0

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

Jump to

Keyboard shortcuts

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