feat: implement tiered billing expression evaluation and related functionality
- Added support for tiered billing expressions in the billing system. - Introduced new types and functions for handling billing expressions, including caching and execution. - Updated existing billing logic to accommodate tiered billing scenarios. - Enhanced request handling to support incoming billing expression requests. - Added tests for tiered billing functionality to ensure correctness.
This commit is contained in:
@@ -18,4 +18,7 @@ type BillingSettler interface {
|
||||
|
||||
// GetPreConsumedQuota 返回实际预扣的额度值(信任用户可能为 0)。
|
||||
GetPreConsumedQuota() int
|
||||
|
||||
// Reserve 将预扣额度补到目标值;若目标值不高于当前预扣额度则不做任何事。
|
||||
Reserve(targetQuota int) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user