pricing

package
v0.0.0-...-e104627 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DaysPerYear = 365
	HoursPerDay = 24
	OneYear     = time.Hour * HoursPerDay * DaysPerYear
)

Variables

This section is empty.

Functions

func FileSystem

func FileSystem() assetFileSystemI

Types

type InstanceType

type InstanceType struct {
	Type  string  `json:"type"`
	Sizes []*Size `json:"sizes"`
}

type InstanceTypeConfig

type InstanceTypeConfig struct {
	Name               string
	Cpus               int
	Memory             float64
	Storage            string
	NetworkPerformance string
	ClockSpeed         float64

	Turbo              bool
	AVX                bool
	AES                bool
	PhysicalProcessor  string
	EbsOptimizable     bool
	EnhancedNetworking bool
}

func (*InstanceTypeConfig) Family

func (c *InstanceTypeConfig) Family() string

type InstanceTypeConfigs

type InstanceTypeConfigs []*InstanceTypeConfig

func AllInstanceTypeConfigs

func AllInstanceTypeConfigs() (configs InstanceTypeConfigs, e error)

func (InstanceTypeConfigs) Len

func (config InstanceTypeConfigs) Len() int

func (InstanceTypeConfigs) Less

func (config InstanceTypeConfigs) Less(a, b int) bool

func (InstanceTypeConfigs) Swap

func (config InstanceTypeConfigs) Swap(a, b int)

type Price

type Price struct {
	Name     string
	PerHour  float64
	Upfront  float64
	Currency string
	Duration time.Duration
}

func (*Price) TotalPerHour

func (price *Price) TotalPerHour() float64

type PriceList

type PriceList []*Price

func (PriceList) Len

func (list PriceList) Len() int

func (PriceList) Less

func (list PriceList) Less(a, b int) bool

func (PriceList) Swap

func (list PriceList) Swap(a, b int)

type Prices

type Prices map[string]string

func (Prices) USD

func (prices Prices) USD() (float64, bool)

type Pricing

type Pricing struct {
	Version float64        `json:"vers"`
	Config  *PricingConfig `json:"config"`
}

func LinuxOnDemand

func LinuxOnDemand() (p *Pricing, e error)

func LinuxReservedHeavy

func LinuxReservedHeavy() (p *Pricing, e error)

func LoadPricing

func LoadPricing(b []byte) (p *Pricing, e error)

func (*Pricing) FindRegion

func (pricing *Pricing) FindRegion(region string) *Region

func (*Pricing) RegionNames

func (pricing *Pricing) RegionNames() []string

type PricingConfig

type PricingConfig struct {
	Rate         string    `json:"rate"`
	ValueColumns []string  `json:"valueColumns"`
	Currencies   []string  `json:"currencies"`
	Regions      []*Region `json:"regions"`
}

type Region

type Region struct {
	Region        string          `json:"region"`
	InstanceTypes []*InstanceType `json:"instanceTypes"`
	Types         []*Type         `json:"types"`
}

type Size

type Size struct {
	Size         string       `json:"size"`
	ValueColumns ValueColumns `json:"valueColumns"`
}

type Type

type Type struct {
	Values []*Value `json:"values"`
}

type Value

type Value struct {
	Prices Prices `json:"prices"`
	Rate   string `json:"rate"`
}

type ValueColumn

type ValueColumn struct {
	Name   string `json:"name"`
	Rate   string `json:"rate"`
	Prices Prices `json:"prices"`
}

type ValueColumns

type ValueColumns []*ValueColumn

func (*ValueColumns) Prices

func (vc *ValueColumns) Prices() PriceList

func (*ValueColumns) ValueColumnMap

func (vc *ValueColumns) ValueColumnMap() map[string]*ValueColumn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL