Documentation
¶
Overview ¶
Package trafficusage owns idempotent subscription usage accounting.
Index ¶
Constants ¶
View Source
const BucketConsumer = "subscription.traffic_bucket"
BucketConsumer is persisted in the inbox; changing it replays old usage.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ApplyBucketOnce ¶
func (s *Service) ApplyBucketOnce(ctx context.Context, bucket string, deltas []traffic.SubscribeTrafficDelta) error
ApplyBucketOnce commits usage and its inbox marker together. Network log retries can replay this operation without charging usage again.
type Store ¶
type Store interface {
Inbox() repository.InboxRepo
InSubscriptionTx(context.Context, func(repository.SubscriptionStore) error) error
}
Click to show internal directories.
Click to hide internal directories.