Documentation
¶
Index ¶
- func BookingEstimation(t TimePricingStrategy, price float64, locationDurationInSecond float64, ...) (float64, error)
- func IsTimeStrategy(i int) bool
- func TimePricingStrategyListStr() []string
- type AccessPricingProfile
- type BillingStrategy
- 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
- type RefundType
- type Strategy
- type TimePricingStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BookingEstimation ¶
func IsTimeStrategy ¶
func TimePricingStrategyListStr ¶
func TimePricingStrategyListStr() []string
Types ¶
type AccessPricingProfile ¶
type AccessPricingProfile[T Strategy] struct { Pricing PricingStrategy[T] `json:"pricing,omitempty" bson:"pricing,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]) GetOverrideStrategyValue ¶
func (b *AccessPricingProfile[T]) GetOverrideStrategyValue() int
type BillingStrategy ¶
type BillingStrategy int // BAM BAM
const ( BILL_ONCE BillingStrategy = iota // is a permanent buying ( predictible ) BILL_PER_WEEK BILL_PER_MONTH BILL_PER_YEAR )
should except... on
func BillingStrategyList ¶
func BillingStrategyList() []BillingStrategy
func (BillingStrategy) IsBillingStrategyAllowed ¶
func (t BillingStrategy) IsBillingStrategyAllowed(bs int) (BillingStrategy, bool)
func (BillingStrategy) String ¶
func (t BillingStrategy) String() string
type BuyingStrategy ¶
type BuyingStrategy int
const ( PERMANENT BuyingStrategy = iota // is a permanent buying ( predictible ) UNDEFINED_SUBSCRIPTION // a endless subscription ( unpredictible ) SUBSCRIPTION // a defined subscription ( predictible ) )
should except... on
func BuyingStrategyList ¶
func BuyingStrategyList() []BuyingStrategy
func (BuyingStrategy) IsBillingStrategyAllowed ¶
func (t BuyingStrategy) IsBillingStrategyAllowed(bs BillingStrategy) (BillingStrategy, bool)
func (BuyingStrategy) String ¶
func (t BuyingStrategy) String() string
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 `json:"garanted_delay_second,omitempty" bson:"garanted_delay_second,omitempty"` // GarantedDelaySecond is the garanted delay of the pricing Exceeding bool `json:"exceeding" bson:"exceeding"` // Exceeding is the exceeding of the bill 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 ExploitPrivilegeStrategyList ¶
func ExploitPrivilegeStrategyList() []ExploitPrivilegeStrategy
func (ExploitPrivilegeStrategy) String ¶
func (t ExploitPrivilegeStrategy) String() string
type PricedItemITF ¶
type PricedItemITF interface { GetID() string GetType() tools.DataType IsPurchasable() bool IsBooked() bool GetCreatorID() string SelectPricing() PricingProfileITF GetLocationStart() *time.Time SetLocationStart(start time.Time) SetLocationEnd(end time.Time) GetLocationEnd() *time.Time GetExplicitDurationInS() float64 GetPrice() (float64, error) }
type PricingProfileITF ¶
type PricingStrategy ¶
type PricingStrategy[T Strategy] struct { Price float64 `json:"price" bson:"price" default:"0"` // Price is the Price of the pricing Currency string `json:"currency" bson:"currency" default:"USD"` // Currency is the currency 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 }
may suppress in pricing strategy -> to set in map
func (PricingStrategy[T]) GetBuyingStrategy ¶
func (p PricingStrategy[T]) GetBuyingStrategy() BuyingStrategy
func (PricingStrategy[T]) GetOverrideStrategy ¶
func (p PricingStrategy[T]) GetOverrideStrategy() T
func (PricingStrategy[T]) GetTimePricingStrategy ¶
func (p PricingStrategy[T]) GetTimePricingStrategy() TimePricingStrategy
type RefundType ¶
type RefundType int
const ( REFUND_DEAD_END RefundType = iota REFUND_ON_ERROR REFUND_ON_EARLY_END )
func RefundTypeList ¶
func RefundTypeList() []RefundType
func (RefundType) String ¶
func (t RefundType) String() string
type TimePricingStrategy ¶
type TimePricingStrategy int
const ( ONCE TimePricingStrategy = iota PER_SECOND PER_MINUTE PER_HOUR PER_DAY PER_WEEK PER_MONTH )
func TimePricingStrategyList ¶
func TimePricingStrategyList() []TimePricingStrategy
func (TimePricingStrategy) GetStrategy ¶
func (t TimePricingStrategy) GetStrategy() string
func (TimePricingStrategy) GetStrategyValue ¶
func (t TimePricingStrategy) GetStrategyValue() int
func (TimePricingStrategy) String ¶
func (t TimePricingStrategy) String() string
Click to show internal directories.
Click to hide internal directories.