Skip to content

Commit

Permalink
Add WithWhiteList option
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Mar 25, 2022
1 parent 3b4efc7 commit a222376
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,13 @@ func WithClientIPHeader(header string) Option {
o.ClientIPHeader = header
}
}

// WithWhiteList will configure the limiter to use list of provided
// exception keys (which may be IP addresses or custome header values).
// This list will be consulted at every request and if key will be found in
// WhiteList the limiter functionality will be skipped for that key.
func WithWhiteList(wlist []string) Option {
return func(o *Options) {
o.WhiteList = wlist
}
}

0 comments on commit a222376

Please sign in to comment.