usagewatermark

package
v1.49.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

Types

type UsageWatermark

type UsageWatermark struct {
	mixin.Model[UsageWatermark]

	SubscriptionItemId string `json:"subscriptionItemId"`
	MeterId            string `json:"meterId"`
	InvoiceId          string `json:"invoiceId"`

	PeriodStart time.Time `json:"periodStart"`
	PeriodEnd   time.Time `json:"periodEnd"`

	// Usage value that was aggregated into the invoice
	AggregatedValue int64 `json:"aggregatedValue"`

	// Number of events included in the aggregation
	EventCount int64 `json:"eventCount"`

	// Latest event timestamp included in this watermark
	LastEventTimestamp time.Time `json:"lastEventTimestamp"`
}

UsageWatermark records the last aggregated position for a subscription item within an invoice period. This prevents double-invoicing of usage events and supports late-arriving event handling.

func New

func (*UsageWatermark) Load

func (w *UsageWatermark) Load(ps []datastore.Property) (err error)

func (*UsageWatermark) Save

func (w *UsageWatermark) Save() (ps []datastore.Property, err error)

func (*UsageWatermark) Validator

func (w *UsageWatermark) Validator() *val.Validator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL