Documentation
¶
Index ¶
- func LoadFromJsonString[K comparable, V any](m *RWMap[K, V], jsonStr string) error
- func LoadFromJsonStringWithCallback[K comparable, V any](m *RWMap[K, V], jsonStr string, onSuccess func()) error
- type GroupRatioInfo
- type PriceData
- func (p *PriceData) AddOtherRatio(key string, ratio float64)
- func (p *PriceData) ApplyOtherRatiosToDecimal(value decimal.Decimal) decimal.Decimal
- func (p *PriceData) ApplyOtherRatiosToFloat(value float64) float64
- func (p *PriceData) HasOtherRatio(key string) bool
- func (p *PriceData) OtherRatioMultiplier() float64
- func (p *PriceData) OtherRatios() map[string]float64
- func (p *PriceData) RemoveOtherRatiosFromFloat(value float64) float64
- func (p *PriceData) ReplaceOtherRatios(ratios map[string]float64) bool
- func (p *PriceData) ToSetting() string
- type RWMap
- func (m *RWMap[K, V]) AddAll(other map[K]V)
- func (m *RWMap[K, V]) Clear()
- func (m *RWMap[K, V]) Get(key K) (V, bool)
- func (m *RWMap[K, V]) Len() int
- func (m *RWMap[K, V]) MarshalJSON() ([]byte, error)
- func (m *RWMap[K, V]) MarshalJSONString() string
- func (m *RWMap[K, V]) ReadAll() map[K]V
- func (m *RWMap[K, V]) Set(key K, value V)
- func (m *RWMap[K, V]) UnmarshalJSON(b []byte) error
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFromJsonString ¶
func LoadFromJsonString[K comparable, V any](m *RWMap[K, V], jsonStr string) error
func LoadFromJsonStringWithCallback ¶ added in v0.10.9
func LoadFromJsonStringWithCallback[K comparable, V any](m *RWMap[K, V], jsonStr string, onSuccess func()) error
Types ¶
type GroupRatioInfo ¶
type PriceData ¶
type PriceData struct {
FreeModel bool
ModelPrice float64
ModelRatio float64
CompletionRatio float64
CacheRatio float64
CacheCreationRatio float64
CacheCreation5mRatio float64
CacheCreation1hRatio float64
ImageRatio float64
AudioRatio float64
AudioCompletionRatio float64
UsePrice bool
Quota int // 按次计费的最终额度(MJ / Task)
QuotaToPreConsume int // 按量计费的预消耗额度
GroupRatioInfo GroupRatioInfo
// contains filtered or unexported fields
}
func (*PriceData) AddOtherRatio ¶
func (*PriceData) ApplyOtherRatiosToDecimal ¶
func (*PriceData) ApplyOtherRatiosToFloat ¶
func (*PriceData) HasOtherRatio ¶
func (*PriceData) OtherRatioMultiplier ¶
func (*PriceData) OtherRatios ¶
func (*PriceData) RemoveOtherRatiosFromFloat ¶
func (*PriceData) ReplaceOtherRatios ¶
type RWMap ¶
type RWMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewRWMap ¶
func NewRWMap[K comparable, V any]() *RWMap[K, V]
func (*RWMap[K, V]) MarshalJSON ¶
func (*RWMap[K, V]) MarshalJSONString ¶ added in v0.10.9
func (*RWMap[K, V]) UnmarshalJSON ¶
type Set ¶
type Set[T comparable] struct { // contains filtered or unexported fields }
func NewSet ¶
func NewSet[T comparable]() *Set[T]
Click to show internal directories.
Click to hide internal directories.