2023-02-15 01:52:11 +00:00
|
|
|
package mock
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/logstore"
|
|
|
|
"github.com/zitadel/zitadel/internal/repository/quota"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ logstore.QuotaQuerier = (*inmemReporter)(nil)
|
|
|
|
|
|
|
|
type inmemReporter struct {
|
|
|
|
config *quota.AddedEvent
|
|
|
|
startPeriod time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewNoopQuerier(quota *quota.AddedEvent, startPeriod time.Time) *inmemReporter {
|
|
|
|
return &inmemReporter{config: quota, startPeriod: startPeriod}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *inmemReporter) GetCurrentQuotaPeriod(context.Context, string, quota.Unit) (*quota.AddedEvent, time.Time, error) {
|
|
|
|
return i.config, i.startPeriod, nil
|
|
|
|
}
|
|
|
|
|
2023-03-28 22:09:06 +00:00
|
|
|
func (*inmemReporter) GetDueQuotaNotifications(context.Context, *quota.AddedEvent, time.Time, uint64) ([]*quota.NotificationDueEvent, error) {
|
2023-02-15 01:52:11 +00:00
|
|
|
return nil, nil
|
|
|
|
}
|