Added random-token-length, Encode() refactored

This commit is contained in:
Andrea Spacca
2021-05-20 08:26:07 +02:00
parent b5ffdb5095
commit fdfd453222
6 changed files with 58 additions and 13 deletions

View File

@ -187,6 +187,12 @@ func RateLimit(requests int) OptionFn {
}
}
func RandomTokenLength(length int64) OptionFn {
return func(srvr *Server) {
srvr.randomTokenLength = length
}
}
func Purge(days, interval int) OptionFn {
return func(srvr *Server) {
srvr.purgeDays = time.Duration(days) * time.Hour * 24
@ -294,6 +300,8 @@ type Server struct {
forceHTTPs bool
randomTokenLength int64
ipFilterOptions *IPFilterOptions
VirusTotalKey string