Documentation ¶
Index ¶
- func BookingEstimation(t TimePricingStrategy, price float64, locationDurationInSecond float64, ...) (float64, error)
- type AccessPricingProfile
- type BuyingStrategy
- type ExploitPricingProfile
- type ExploitPrivilegeStrategy
- type PricedItemITF
- type PricingProfileITF
- type PricingStrategy
- func (p PricingStrategy[T]) GetBuyingStrategy() BuyingStrategy
- func (p PricingStrategy[T]) GetOverrideStrategy() T
- func (p PricingStrategy[T]) GetPrice(amountOfData float64, bookingTimeDuration float64, start time.Time, ...) (float64, error)
- func (p PricingStrategy[T]) GetTimePricingStrategy() TimePricingStrategy
- func (p PricingStrategy[T]) SetSpecificPerUseStrategy(strategy T) error
- func (p PricingStrategy[T]) SetStrategy(Price float64, BuyingStrategy BuyingStrategy, ...) error
- type RefundType
- type Strategy
- type TimePricingStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessPricingProfile ¶
type AccessPricingProfile[T Strategy] struct { ID string `json:"id,omitempty" bson:"id,omitempty"` // ID is the ID of the pricing Pricing PricingStrategy[T] `json:"price,omitempty" bson:"price,omitempty"` // Price is the price of the resource DefaultRefund RefundType `json:"default_refund" bson:"default_refund"` // DefaultRefund is the default refund type of the pricing RefundRatio int32 `json:"refund_ratio" bson:"refund_ratio" default:"0"` // RefundRatio is the refund ratio if missing }
func (*AccessPricingProfile[T]) GetID ¶
func (b *AccessPricingProfile[T]) GetID() string
func (*AccessPricingProfile[T]) GetOverrideStrategyValue ¶
func (b *AccessPricingProfile[T]) GetOverrideStrategyValue() int
type BuyingStrategy ¶
type BuyingStrategy int
const ( UNLIMITED BuyingStrategy = iota SUBSCRIPTION PAY_PER_USE )
type ExploitPricingProfile ¶
type ExploitPricingProfile[T Strategy] struct { AccessPricingProfile[T] AdditionnalRefundTypes []RefundType `json:"refund_types" bson:"refund_types"` // RefundTypes is the refund types of the pricing PrivilegeStrategy ExploitPrivilegeStrategy `json:"privilege_strategy,omitempty" bson:"privilege_strategy,omitempty"` // Strategy is the strategy of the pricing GarantedDelaySecond uint Exceeding bool ExceedingRatio int32 `json:"exceeding_ratio" bson:"exceeding_ratio" default:"0"` // ExceedingRatio is the exceeding ratio of the bill }
type ExploitPrivilegeStrategy ¶
type ExploitPrivilegeStrategy int
const ( BASIC ExploitPrivilegeStrategy = iota GARANTED_ON_DELAY GARANTED )
func (ExploitPrivilegeStrategy) String ¶
func (t ExploitPrivilegeStrategy) String() string
type PricedItemITF ¶
type PricingProfileITF ¶
type PricingStrategy ¶
type PricingStrategy[T Strategy] struct { Price float64 `json:"Price" bson:"Price" default:"0"` // Price is the Price of the pricing BuyingStrategy BuyingStrategy `json:"buying_strategy" bson:"buying_strategy" default:"0"` // BuyingStrategy is the buying strategy of the pricing TimePricingStrategy TimePricingStrategy `json:"time_pricing_strategy" bson:"time_pricing_strategy" default:"0"` // TimePricingStrategy is the time pricing strategy of the pricing OverrideStrategy T `json:"override_strategy" bson:"override_strategy" default:"-1"` // Modulation is the modulation of the pricing }
hmmmm
func (PricingStrategy[T]) GetBuyingStrategy ¶
func (p PricingStrategy[T]) GetBuyingStrategy() BuyingStrategy
func (PricingStrategy[T]) GetOverrideStrategy ¶
func (p PricingStrategy[T]) GetOverrideStrategy() T
func (PricingStrategy[T]) GetPrice ¶
func (p PricingStrategy[T]) GetPrice(amountOfData float64, bookingTimeDuration float64, start time.Time, end *time.Time) (float64, error)
QUANTITY can be how many of gb core per example
func (PricingStrategy[T]) GetTimePricingStrategy ¶
func (p PricingStrategy[T]) GetTimePricingStrategy() TimePricingStrategy
func (PricingStrategy[T]) SetSpecificPerUseStrategy ¶
func (p PricingStrategy[T]) SetSpecificPerUseStrategy(strategy T) error
func (PricingStrategy[T]) SetStrategy ¶
func (p PricingStrategy[T]) SetStrategy(Price float64, BuyingStrategy BuyingStrategy, TimePricingStrategy TimePricingStrategy) error
type RefundType ¶
type RefundType int
const ( REFUND_DEAD_END RefundType = iota REFUND_ON_ERROR REFUND_ON_EARLY_END )
type TimePricingStrategy ¶
type TimePricingStrategy int
const ( ONCE TimePricingStrategy = iota PER_SECOND PER_MINUTE PER_HOUR PER_DAY PER_WEEK PER_MONTH )
func (TimePricingStrategy) GetStrategy ¶
func (t TimePricingStrategy) GetStrategy() string
func (TimePricingStrategy) GetStrategyValue ¶
func (t TimePricingStrategy) GetStrategyValue() int
Click to show internal directories.
Click to hide internal directories.