billing_setting

package
v1.0.0-rc.37 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BillingModeRatio        = "ratio"
	BillingModeTieredExpr   = "tiered_expr"
	BillingModeField        = "billing_mode"
	BillingExprField        = "billing_expr"
	PluginBillingExprOption = "billing_setting.plugin_billing_expr"
)

Variables

This section is empty.

Functions

func GetBillingExpr

func GetBillingExpr(model string) (string, bool)

func GetBillingExprCopy added in v0.13.2

func GetBillingExprCopy() map[string]string

func GetBillingMode

func GetBillingMode(model string) string

func GetBillingModeCopy added in v0.13.2

func GetBillingModeCopy() map[string]string

func GetBuiltinBillingExpr

func GetBuiltinBillingExpr(model string) (string, bool)

func GetBuiltinBillingExprCopy

func GetBuiltinBillingExprCopy() map[string]string

func GetPluginBillingExpr

func GetPluginBillingExpr(pluginKey, model string) (string, bool)

func GetPluginBillingExprCopy

func GetPluginBillingExprCopy() map[string]string

func GetPricingSyncData added in v0.13.2

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

func PluginBillingExprKey

func PluginBillingExprKey(pluginKey, model string) string

func ResolveTaskBillingExpr

func ResolveTaskBillingExpr(pluginKey, model, mappedModel string) (string, bool)

ResolveTaskBillingExpr selects the executing plugin's override before the model expression, retaining the model alias fallback and explicit modes.

func SmokeTestExpr

func SmokeTestExpr(exprStr string) error

func SmokeTestTaskExpr

func SmokeTestTaskExpr(exprStr string, schema map[string]jsplugin.UsageFieldSchema) error

SmokeTestTaskExpr validates a task usage expression against the usage facts declared by its plugin. Literal u() keys must be declared; dynamic calls are still exercised by the generated runtime vectors when possible.

func SplitPluginBillingExprKey

func SplitPluginBillingExprKey(key string) (plugin, model string, ok bool)

func TaskExprCompatible

func TaskExprCompatible(expression string, schema map[string]jsplugin.UsageFieldSchema) bool

TaskExprCompatible checks the schema contract even for usage references in branches that the current request would not evaluate.

Types

type BillingSetting

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

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

Jump to

Keyboard shortcuts

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