Documentation
¶
Index ¶
- Constants
- func GetBillingExpr(model string) (string, bool)
- func GetBillingExprCopy() map[string]string
- func GetBillingMode(model string) string
- func GetBillingModeCopy() map[string]string
- func GetBuiltinBillingExpr(model string) (string, bool)
- func GetBuiltinBillingExprCopy() map[string]string
- func GetPluginBillingExpr(pluginKey, model string) (string, bool)
- func GetPluginBillingExprCopy() map[string]string
- func GetPricingSyncData(base map[string]any) map[string]any
- func PluginBillingExprKey(pluginKey, model string) string
- func ResolveTaskBillingExpr(pluginKey, model, mappedModel string) (string, bool)
- func SmokeTestExpr(exprStr string) error
- func SmokeTestTaskExpr(exprStr string, schema map[string]jsplugin.UsageFieldSchema) error
- func SplitPluginBillingExprKey(key string) (plugin, model string, ok bool)
- func TaskExprCompatible(expression string, schema map[string]jsplugin.UsageFieldSchema) bool
- type BillingSetting
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 GetBillingExprCopy ¶ added in v0.13.2
func GetBillingMode ¶
func GetBillingModeCopy ¶ added in v0.13.2
func GetBuiltinBillingExpr ¶
func GetPluginBillingExpr ¶
func GetPricingSyncData ¶ added in v0.13.2
func PluginBillingExprKey ¶
func ResolveTaskBillingExpr ¶
ResolveTaskBillingExpr selects the executing plugin's override before the model expression, retaining the model alias fallback and explicit modes.
func SmokeTestExpr ¶
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 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
Click to show internal directories.
Click to hide internal directories.