Skip to content

A Go blocking leaky-bucket rate limit implementation

License

Notifications You must be signed in to change notification settings

gillerick/uber-go-rate-limit

 
 

Repository files navigation

Uber Go rate limiter

Learnings

1. Golang Functional Options/Default Configuration Values Pattern

func buildConfig(opts []Option) config {
	c := config{
		clock: clock.New(),
		slack: 10,
		per:   time.Second,
	}

	for _, opt := range opts {
		opt.apply(&c)
	}
	return c
}

About

A Go blocking leaky-bucket rate limit implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 94.9%
  • Makefile 5.1%