Documentation
¶
Index ¶
- func GetThrottleForGroup(group string, groups *[]config.SecurityGroups) (requestsPerSecond int64)
- func GroupLimitReached(throttle map[string]map[int]time.Time, groupname string, ...) bool
- func InitThrottleGroups(groups *[]config.SecurityGroups, throttle map[string]map[int]time.Time) map[string]map[int]time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetThrottleForGroup ¶
func GetThrottleForGroup(group string, groups *[]config.SecurityGroups) (requestsPerSecond int64)
GetThrottleForGroup takes a group name and a pointer to array of groups. It returns an int64 representing the number of requests the group is allowed to make per second, or 0 (do not throttle) if the key doesn't exist.
func GroupLimitReached ¶
func GroupLimitReached(throttle map[string]map[int]time.Time, groupname string, requestsPerSecond int64) bool
GroupLimitReached takes the throttle groups, the group name to check, and the requests the group is limited to per second. It counts the group's requests made in the past second that have not been throttled. Returns true if the group has exceeded their request per second count. Otherwise, it returns false.
func InitThrottleGroups ¶
func InitThrottleGroups(groups *[]config.SecurityGroups, throttle map[string]map[int]time.Time) map[string]map[int]time.Time
InitThrottleGroups takes the security groups and empty throttle map It returns the throttle map with individual maps for each group name Create a map where the keys are the group's name, and will contain a map of timestamps
Types ¶
This section is empty.