billing_setting

package
v0.2.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BillingModeRatio      = "ratio"
	BillingModeTieredExpr = "tiered_expr"
	BillingModeField      = "billing_mode"
	BillingExprField      = "billing_expr"
)

Variables

View Source
var ErrInvalidBillingExpression = errors.New("invalid billing expression")

Functions

func GetBillingExpr

func GetBillingExpr(model string) (string, bool)

func GetBillingExprCopy

func GetBillingExprCopy() map[string]string

func GetBillingMode

func GetBillingMode(model string) string

func GetBillingModeCopy

func GetBillingModeCopy() map[string]string

func GetPricingSyncData

func GetPricingSyncData(base map[string]any) map[string]any

func SmokeTestExpr

func SmokeTestExpr(exprStr string) error

Types

type BillingSetting

type BillingSetting struct {
	BillingMode map[string]string `json:"billing_mode"`
	BillingExpr map[string]string `json:"billing_expr"`
}

BillingSetting is managed by config.GlobalConfig.Register. DB keys: billing_setting.billing_mode, billing_setting.billing_expr

type BillingSnapshot

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

BillingSnapshot exposes one immutable billing configuration generation to callers that must pair a model's mode and expression consistently.

func GetBillingSnapshot

func GetBillingSnapshot() BillingSnapshot

func (BillingSnapshot) GetBillingExpr

func (s BillingSnapshot) GetBillingExpr(model string) (string, bool)

func (BillingSnapshot) GetBillingExprCopy

func (s BillingSnapshot) GetBillingExprCopy() map[string]string

func (BillingSnapshot) GetBillingMode

func (s BillingSnapshot) GetBillingMode(model string) string

func (BillingSnapshot) GetBillingModeCopy

func (s BillingSnapshot) GetBillingModeCopy() map[string]string

Jump to

Keyboard shortcuts

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