Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we setup multiple config for a particular key? #107

Open
linhbkhn95 opened this issue Oct 20, 2024 · 0 comments
Open

Can we setup multiple config for a particular key? #107

linhbkhn95 opened this issue Oct 20, 2024 · 0 comments

Comments

@linhbkhn95
Copy link

Background

Currently, we need to config multiple rate limit values for same key. Config looks like

  • Limit per second
  • Limit per min
  • Limit per hour
    For this use case, I have to generate new key per kind of rate limit
  • Key for limit per second
  • Key for limit per min
  • Key for limit per hour
 func getRateLimitPerSecondKey(key string) string {
	return fmt.Sprintf("rate_limit_per_second:%s", key)
}

func getRateLimitPerMinKey(key string) string {
	return fmt.Sprintf("rate_limit_per_min:%s", key)
}

func getRateLimitPerHourKey(key string) string {
	return fmt.Sprintf("rate_limit_per_hour:%s", key)
}

Should You guys give me some advises about this use-case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant