Documentation ¶
Index ¶
- func PriceString(price *big.Rat, currency string) string
- type Basket
- type PricingList
- type PricingObject
- type Usage
- func (u *Usage) BillableQuantity() *big.Rat
- func (u *Usage) LostQuantity() *big.Rat
- func (u *Usage) SetDuration(duration time.Duration) error
- func (u *Usage) SetQuantity(quantity *big.Rat) error
- func (u *Usage) SetStartEnd(start, end time.Time) error
- func (u *Usage) Total() *big.Rat
- func (u *Usage) TotalString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PricingList ¶
type PricingList []PricingObject
var CurrentPricing PricingList
CurrentPricing tries to be up-to-date with the real pricing we cannot guarantee of these values since we hardcode values for now later, we should be able to call a dedicated pricing API
func (*PricingList) GetByIdentifier ¶
func (pl *PricingList) GetByIdentifier(identifier string) *PricingObject
GetByIdentifier returns an object matching a identifier
func (*PricingList) GetByPath ¶
func (pl *PricingList) GetByPath(path string) *PricingObject
GetByPath returns an object matching a path
type PricingObject ¶
type Usage ¶
type Usage struct { PricingObject *PricingObject Quantity *big.Rat }
func NewUsage ¶
func NewUsage(object *PricingObject) Usage
func NewUsageByPath ¶
func NewUsageWithQuantity ¶
func NewUsageWithQuantity(object *PricingObject, quantity *big.Rat) Usage
func (*Usage) BillableQuantity ¶
func (*Usage) LostQuantity ¶
func (*Usage) TotalString ¶
Click to show internal directories.
Click to hide internal directories.