mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-03 19:02:26 -06:00 
			
		
		
		
	* feat: add rate limit middleware * chore: update vendor dir * chore: update readme with new dependency * chore: add rate limit infos to swagger.md file * refactor: add ipv6 mask limiter option Add IPv6 CIDR /64 mask * refactor: increase rate limit to 1000 Address https://github.com/superseriousbusiness/gotosocial/pull/741#discussion_r945584800 Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			409 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			409 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package limiter
 | 
						|
 | 
						|
import "time"
 | 
						|
 | 
						|
const (
 | 
						|
	// DefaultPrefix is the default prefix to use for the key in the store.
 | 
						|
	DefaultPrefix = "limiter"
 | 
						|
 | 
						|
	// DefaultMaxRetry is the default maximum number of key retries under
 | 
						|
	// race condition (mainly used with database-based stores).
 | 
						|
	DefaultMaxRetry = 3
 | 
						|
 | 
						|
	// DefaultCleanUpInterval is the default time duration for cleanup.
 | 
						|
	DefaultCleanUpInterval = 30 * time.Second
 | 
						|
)
 |