实现请求连接数等限制/容量组件增加EB支持

This commit is contained in:
GoEdgeLab
2021-12-12 11:46:09 +08:00
parent e8b519d284
commit e218b3f9af
15 changed files with 392 additions and 48 deletions

View File

@@ -13,6 +13,16 @@ func FormatInt(value int) string {
return strconv.Itoa(value)
}
func Pow1024(n int) int64 {
if n <= 0 {
return 1
}
if n == 1 {
return 1024
}
return Pow1024(n-1) * 1024
}
func FormatBytes(bytes int64) string {
if bytes < 1024 {
return FormatInt64(bytes) + "B"