mirror of
https://github.com/openziti/zrok.git
synced 2025-06-22 18:51:33 +02:00
handlers for account, environment, and strategy (#276)
This commit is contained in:
parent
0bed934976
commit
c91fc8ac9e
@ -32,7 +32,7 @@ type Bandwidth struct {
|
|||||||
|
|
||||||
func DefaultBandwidthPerPeriod() *BandwidthPerPeriod {
|
func DefaultBandwidthPerPeriod() *BandwidthPerPeriod {
|
||||||
return &BandwidthPerPeriod{
|
return &BandwidthPerPeriod{
|
||||||
Period: 15 * (24 * time.Hour),
|
Period: 24 * time.Hour,
|
||||||
Warning: &Bandwidth{
|
Warning: &Bandwidth{
|
||||||
Rx: Unlimited,
|
Rx: Unlimited,
|
||||||
Tx: Unlimited,
|
Tx: Unlimited,
|
||||||
|
15
controller/limits/model.go
Normal file
15
controller/limits/model.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package limits
|
||||||
|
|
||||||
|
import "github.com/openziti/zrok/controller/store"
|
||||||
|
|
||||||
|
type AccountStrategy interface {
|
||||||
|
HandleAccount(a *store.Account, rxBytes, txBytes int64, limit *BandwidthPerPeriod) error
|
||||||
|
}
|
||||||
|
|
||||||
|
type EnvironmentStrategy interface {
|
||||||
|
HandleEnvironment(e *store.Environment, rxBytes, txBytes int64, limit *BandwidthPerPeriod) error
|
||||||
|
}
|
||||||
|
|
||||||
|
type ShareStrategy interface {
|
||||||
|
HandleShare(s *store.Share, rxBytes, txBytes int64, limit *BandwidthPerPeriod) error
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user