Great work! Question...
Operating a website hosting service and would like to rate limit by domain name for bandwidth. e.g. 200kbps per domain name.
possible to do this using limiter? i'm using fasthttp
possible to adjust the throttling rate on the fly dynamically? how to do this?
@hiqsociety Yes there is a middleware for fasthttp, you can find an example here: https://github.com/ulule/limiter-examples/blob/master/fasthttp/main.go
@gitmko0 Yes you can, but you'll have to create some plumbing and boilerplate to do so.
In summary, create a new instance of limiter with the new rate (https://github.com/ulule/limiter/blob/545607961466ac04a70680947ce0f0e7fbb2366f/limiter.go#L31)
And pass this new instance to the service / middleware / components managing the rate limiter, by replacing the previous instance and this new one.