Skip to content

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

@linhbkhn95

Description

@linhbkhn95

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions