server

package
v0.0.0-...-1d2b739 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaximumImageSize        = 10 * 1024 * 1024
	AllowedUploadsPerMinute = 100
	RequestInterval         = time.Minute
)

Variables

This section is empty.

Functions

func GetIDHandler

func GetIDHandler(c *gin.Context)

func HandleIpupdate

func HandleIpupdate(c *gin.Context)

func UploadBase64ImageHandler

func UploadBase64ImageHandler(rateLimiter *RateLimiter) gin.HandlerFunc

闭包,网页后端,图床逻辑,基于gin和www静态文件的简易图床

func UploadBase64RecordHandler

func UploadBase64RecordHandler(rateLimiter *RateLimiter) gin.HandlerFunc

闭包,网页后端,语音床逻辑,基于gin和www静态文件的简易语音床

Types

type RateLimiter

type RateLimiter struct {
	Counts map[string][]time.Time
}

func NewRateLimiter

func NewRateLimiter() *RateLimiter

频率限制器

func (*RateLimiter) CheckAndUpdateRateLimit

func (rl *RateLimiter) CheckAndUpdateRateLimit(ipAddress string) bool

检查是否超过调用频率限制

Jump to

Keyboard shortcuts

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