billing

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package billing contains credit pricing and usage ledger helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PartsForDebit

func PartsForDebit(includedCredits int64, usedCredits int64, delta int64) (includedDebited int64, overageDebited int64)

PartsForDebit splits a debit into included and overage portions.

func PricedCredits

func PricedCredits(base int64, multiplierBps int64) int64

PricedCredits applies a per-instance pricing multiplier (basis points) to a base credit cost. It ceils the result to avoid systematic undercharging.

func TypeFromParts

func TypeFromParts(includedDebited int64, overageDebited int64) string

TypeFromParts determines the billing type based on included and overage portions.

func UsageLedgerEntryID

func UsageLedgerEntryID(instanceSlug string, month string, requestID string, module string, target string, debitedCredits int64) string

UsageLedgerEntryID derives a deterministic ID for a usage ledger entry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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