Documentation
¶
Overview ¶
Package bandwidth 解析 README 约定的带宽字符串为 bps(比特每秒)。
Index ¶
- func FormatActualMbps(bps float64) string
- func Parse(s string) (float64, error)
- func RoundMbps(bps float64) string
- func TestFormatActualMbps(t *testing.T)
- func TestFormatActualMbps_BoundaryCases(t *testing.T)
- func TestParse_BoundaryCases(t *testing.T)
- func TestParse_UnitFormats(t *testing.T)
- func TestRoundMbps(t *testing.T)
- func TestRoundMbps_BoundaryCases(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatActualMbps ¶
FormatActualMbps 将实际 bps 格式化为三位小数 Mbps(与 README 示例 actual=0.999 对齐)。
func TestFormatActualMbps_BoundaryCases ¶
测试 FormatActualMbps 函数的边界情况
Types ¶
This section is empty.
Source Files
¶
- bandwidth.go
- bandwidth_test_comprehensive.go
- bandwidth_test_extended.go
Click to show internal directories.
Click to hide internal directories.