实现单个服务的带宽限制(商业版)

This commit is contained in:
刘祥超
2021-10-21 17:09:59 +08:00
parent 5c896bbf22
commit 36bf9e2fab
6 changed files with 708 additions and 299 deletions

View File

@@ -0,0 +1,17 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package serverconfigs
import timeutil "github.com/iwind/TeaGo/utils/time"
// BandwidthLimitStatus 带宽限制状态
type BandwidthLimitStatus struct {
UntilDay string `yaml:"untilDay" json:"untilDay"` // 有效日期格式YYYYMMDD
}
func (this *BandwidthLimitStatus) IsValid() bool {
if len(this.UntilDay) == 0 {
return false
}
return this.UntilDay >= timeutil.Format("Ymd")
}