Implementing IP Address Rate Limiting in Go!?

Опубликовано: 31 Октябрь 2024
на канале: samvcodes
1,742
89

JOIN MY DISCORD   / discord  

In this video, I discuss a simple implementation of IP address caching in Golang. It covers read-write mutexes, the use of Go routines to clear up stale cache items, and how I implemented it in an endpoint on a little side project.

The IP cache is a nice and simple in-memory Go map, so it's nice and basic and shows a use-case of maps to anyone trying to get familiar with Go.

I implemented this as a package that can be reused, so do let me know if you'd like this available as a module, I'll put some more time into making it production ready then!

See code posts in action: https://codeposts.dev

Github: https://github.com/samverrall
Twitter:   / samvcodes