-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to inspect redis ratelimiters (#7)
- Loading branch information
1 parent
8c9e41a
commit 736baa7
Showing
6 changed files
with
414 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package redis | ||
|
||
import "fmt" | ||
|
||
func parseRedisInt64Slice(v interface{}) ([]int64, error) { | ||
args, ok := v.([]interface{}) | ||
if !ok { | ||
return nil, fmt.Errorf("expected []interface{} but got %T", v) | ||
} | ||
|
||
out := make([]int64, len(args)) | ||
for i, arg := range args { | ||
value, ok := arg.(int64) | ||
if !ok { | ||
return nil, fmt.Errorf("expected int64 in args[%d] but got %T", i, arg) | ||
} | ||
|
||
out[i] = value | ||
} | ||
|
||
return out, nil | ||
} |
Oops, something went wrong.