Documentation
¶
Index ¶
- Constants
- Variables
- func GetBillingExpr(model string) (string, bool)
- func GetBillingExprCopy() map[string]string
- func GetBillingMode(model string) string
- func GetBillingModeCopy() map[string]string
- func GetPricingSyncData(base map[string]any) map[string]any
- func SmokeTestExpr(exprStr string) error
- type BillingSetting
- type BillingSnapshot
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 GetBillingExprCopy ¶
func GetBillingMode ¶
func GetBillingModeCopy ¶
func SmokeTestExpr ¶
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
Click to show internal directories.
Click to hide internal directories.