2023-03-27 17:53:18 +02:00
|
|
|
package limits
|
|
|
|
|
|
|
|
import (
|
2023-03-27 19:51:48 +02:00
|
|
|
"github.com/jmoiron/sqlx"
|
2023-03-27 17:53:18 +02:00
|
|
|
"github.com/openziti/edge/rest_management_api_client"
|
|
|
|
"github.com/openziti/zrok/controller/store"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
|
|
|
type accountLimitAction struct {
|
|
|
|
str *store.Store
|
|
|
|
edge *rest_management_api_client.ZitiEdgeManagement
|
|
|
|
}
|
|
|
|
|
|
|
|
func newAccountLimitAction(str *store.Store, edge *rest_management_api_client.ZitiEdgeManagement) *accountLimitAction {
|
|
|
|
return &accountLimitAction{str, edge}
|
|
|
|
}
|
|
|
|
|
2023-03-27 19:51:48 +02:00
|
|
|
func (a *accountLimitAction) HandleAccount(acct *store.Account, rxBytes, txBytes int64, limit *BandwidthPerPeriod, trx *sqlx.Tx) error {
|
2023-03-27 17:53:18 +02:00
|
|
|
logrus.Infof("limiting '%v'", acct.Email)
|
|
|
|
return nil
|
|
|
|
}
|