Documentation ¶
Index ¶
- Variables
- func ConvertPricingTables(tables []*pb.PricingTable) map[common.Address]PricingTableMap
- func FormatWithScaleFactor(amount *big.Float) string
- func GetTablesPrices(pricingTables map[common.Address]PricingTableMap) ([][numResources]*big.Int, error)
- type NamespaceConsumptions
- type PricingTableMap
- type Resource
- type ResourceConsumptions
- type ResourceKind
Constants ¶
This section is empty.
Variables ¶
View Source
var CurrencyDisplayScale = big.NewFloat(1.0e-18)
Functions ¶
func ConvertPricingTables ¶
func ConvertPricingTables(tables []*pb.PricingTable) map[common.Address]PricingTableMap
func FormatWithScaleFactor ¶
func GetTablesPrices ¶
Types ¶
type NamespaceConsumptions ¶
type NamespaceConsumptions map[string]ResourceConsumptions
func (NamespaceConsumptions) Add ¶
func (r NamespaceConsumptions) Add(namespace string, resource *Resource, value *big.Float)
func (NamespaceConsumptions) Display ¶
func (r NamespaceConsumptions) Display(writer io.Writer, priceTableMap PricingTableMap)
func (NamespaceConsumptions) Price ¶
func (r NamespaceConsumptions) Price(priceTableMap PricingTableMap) map[string]*big.Int
type PricingTableMap ¶
func NewPricingTableMap ¶
func NewPricingTableMap(table *pb.PricingTable) PricingTableMap
type Resource ¶
type Resource struct { Name string Kind ResourceKind Unit string UseMillis bool }
func GetResource ¶
func GetResource(name string, kind ResourceKind) *Resource
type ResourceConsumptions ¶
type ResourceConsumptions map[*Resource]consumption
func (ResourceConsumptions) Price ¶
func (r ResourceConsumptions) Price(priceTableMap PricingTableMap) *big.Int
type ResourceKind ¶
type ResourceKind uint8
const ( ResourceKindReservation ResourceKind = 0 ResourceKindUsage ResourceKind = 1 )
func (ResourceKind) Text ¶
func (r ResourceKind) Text() string
Click to show internal directories.
Click to hide internal directories.