basic global bandwidth enforcement testing tweaks (no clases) (#606)

This commit is contained in:
Michael Quigley
2024-06-05 11:45:14 -04:00
parent 3258c3ee73
commit 0f32c5e8a3
5 changed files with 51 additions and 23 deletions

View File

@@ -17,6 +17,7 @@ type BandwidthClass interface {
GetTxBytes() int64
GetTotalBytes() int64
GetLimitAction() LimitAction
String() string
}
type LimitClass struct {
@@ -71,12 +72,10 @@ func (lc LimitClass) GetLimitAction() LimitAction {
}
func (lc LimitClass) String() string {
out, err := json.MarshalIndent(&lc, "", " ")
if err != nil {
return ""
if out, err := json.Marshal(&lc); err == nil {
return "LimitClass<" + string(out) + ">"
}
return string(out)
return "<<ERROR>>"
}
var _ BandwidthClass = (*LimitClass)(nil)