consumer

package
v1.0.0-beta.225 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoBalanceAvailable = errors.New("no balance available")

Functions

This section is empty.

Types

type BalanceEventDedupHash

type BalanceEventDedupHash struct {
	// contains filtered or unexported fields
}

func NewBalanceEventDedupHash

func NewBalanceEventDedupHash(snapshot snapshot.SnapshotEvent, ruleID string, threshold notification.BalanceThreshold) (*BalanceEventDedupHash, error)

func (BalanceEventDedupHash) V1

func (BalanceEventDedupHash) V2

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

func New

func New(opts Options) (*Consumer, error)

func (*Consumer) Close

func (c *Consumer) Close() error

func (*Consumer) Handle

func (c *Consumer) Handle(ctx context.Context, event snapshot.SnapshotEvent) error

func (*Consumer) Run

func (c *Consumer) Run(ctx context.Context) error

type EntitlementSnapshotHandler

type EntitlementSnapshotHandler struct {
	Notification notification.Service
	Logger       *slog.Logger
}

func (*EntitlementSnapshotHandler) Handle

type EntitlementSnapshotHandlerState

type EntitlementSnapshotHandlerState struct {
	TotalGrants float64 `json:"totalGrants"`
}

type InvoiceEventHandler

type InvoiceEventHandler struct {
	Notification notification.Service
	Logger       *slog.Logger
}

func (*InvoiceEventHandler) Handle

type Options

type Options struct {
	SystemEventsTopic string

	Router router.Options

	Notification notification.Service

	Marshaler marshaler.Marshaler

	Logger *slog.Logger
}

func (Options) Validate

func (o Options) Validate() error

type ThresholdKind

type ThresholdKind string
const (
	ThresholdKindUsageThreshold   ThresholdKind = "usage"
	ThresholdKindBalanceThreshold ThresholdKind = "balance"
)

Jump to

Keyboard shortcuts

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