Documentation ¶
Index ¶
- Constants
- func Initialize(consul string)
- type ALiImage
- type ALiImageData
- type ALiInstanceMatrix
- func (imatrix *ALiInstanceMatrix) FetchALiMatrix(consul *gokit.Consul) error
- func (imatrix *ALiInstanceMatrix) ListInstanceMatrixByRegion(region string) *map[string]map[string][]string
- func (imatrix *ALiInstanceMatrix) ListInstanceMatrixByRegionAndZone(region string, zone string) *map[string][]string
- func (imatrix *ALiInstanceMatrix) ListInstanceMatrixByRegionV2(region string) *map[string][]string
- type ALiMetaDB
- type ALiSpotInstance
- func (s *ALiSpotInstance) FetchALiSpot(consul *gokit.Consul) error
- func (s *ALiSpotInstance) GetInstByRegion(region string) map[string]map[string]map[string]*SpotInstanceInfoAli
- func (s *ALiSpotInstance) GetInstByRegionAndZones(region string, zone string) *[]*SpotInstanceInfoAli
- func (s *ALiSpotInstance) GetInstInfoByTypes(region string, zone string, inst []string) *map[string]*SpotInstanceInfoAli
- type AWSImage
- type AWSImageData
- type AWSInstance
- func (i *AWSInstance) Fetch(consul *gokit.Consul) error
- func (i *AWSInstance) Filter(list []*FilterType) *AWSInstanceData
- func (i *AWSInstance) GetInstInfo(region string, instance string) *InstInfo
- func (i *AWSInstance) Keys(region string) gokit.Set
- func (i *AWSInstance) List(region string) []*InstInfo
- type AWSInstanceData
- type AWSOdPrice
- type AWSOdPriceData
- type AWSOdPriceList
- type AWSSpotInstance
- type AWSSpotInstanceData
- type AliInstance
- type AliInstanceData
- type AliOdPrice
- type AliOdPriceData
- type AliRegion
- type AliSpotPrice
- type AliSpotPriceData
- type CloudIdentifier
- type CommonRegion
- type CommonRegionData
- type CommonSpotPrice
- type CommonSpotPriceData
- type DbSet
- type DbSetALi
- type FilterType
- type Image
- type ImageALi
- type ImageInfoALi
- type InstInfo
- type Instance
- type InstanceMatrixALi
- type Interrupt
- type InterruptAdvisor
- type InterruptAdvisorData
- type InterruptInfo
- type InterruptInfoAli
- type MetaDb
- func (m *MetaDb) Image() Image
- func (m *MetaDb) Instance() Instance
- func (m *MetaDb) Interrupt() Interrupt
- func (m *MetaDb) ODPrice() ODPrice
- func (m *MetaDb) OK() bool
- func (m *MetaDb) Region() Region
- func (m *MetaDb) SpotInstance() Instance
- func (m *MetaDb) SpotPrice() SpotPrice
- func (m *MetaDb) Update() error
- type ODPrice
- type ODPriceALi
- type ODPriceAli
- type Region
- type RegionInfo
- type SpotInstanceALi
- type SpotInstanceAWS
- type SpotInstanceInfoAli
- type SpotPrice
- type SpotPriceALi
- type SpotPriceInfo
- type SpotPriceInfoAli
Constants ¶
View Source
const ( TestConsulAddress = "consul.spotmaxtech.com" ConsulRegionKey = "cloudmeta/aws/region.json" ConsulInstanceKey = "cloudmeta/aws/instances" ConsulSpotInstanceKey = "cloudmeta/aws/spotinstance.json" ConsulInterruptRateKey = "cloudmeta/aws/interruptrate.json" ConsulSpotPriceKey = "cloudmeta/aws/spotprice.json" ConsulOdPriceKey = "cloudmeta/aws/odprice.json" ConsulImageKey = "cloudmeta/aws/image.json" ALiConsulRegionKey = "cloudmeta/aliyun/region.json" ALiConsulSpotPriceKey = "cloudmeta/aliyun/spotprice.json" ALiConsulOdPriceKey = "cloudmeta/aliyun/odprice.json" ALiConsulSpotInstanceKey = "cloudmeta/aliyun/spotInstances" )
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶ added in v0.1.26
func Initialize(consul string)
Types ¶
type ALiImage ¶ added in v0.1.20
type ALiImage struct { Region Region ALiImageData // contains filtered or unexported fields }
func NewALiImage ¶ added in v0.1.20
func (*ALiImage) FetchALiImage ¶ added in v0.1.20
func (*ALiImage) ListImageByRegion ¶ added in v0.1.20
type ALiImageData ¶ added in v0.1.20
type ALiImageData struct {
// contains filtered or unexported fields
}
type ALiInstanceMatrix ¶ added in v0.1.21
type ALiInstanceMatrix struct { Region Region // contains filtered or unexported fields }
func NewALiInstanceMatrix ¶ added in v0.1.21
func NewALiInstanceMatrix(key string, region Region) *ALiInstanceMatrix
func (*ALiInstanceMatrix) FetchALiMatrix ¶ added in v0.1.21
func (imatrix *ALiInstanceMatrix) FetchALiMatrix(consul *gokit.Consul) error
func (*ALiInstanceMatrix) ListInstanceMatrixByRegion ¶ added in v0.1.21
func (imatrix *ALiInstanceMatrix) ListInstanceMatrixByRegion(region string) *map[string]map[string][]string
func (*ALiInstanceMatrix) ListInstanceMatrixByRegionAndZone ¶ added in v0.1.21
func (imatrix *ALiInstanceMatrix) ListInstanceMatrixByRegionAndZone(region string, zone string) *map[string][]string
func (*ALiInstanceMatrix) ListInstanceMatrixByRegionV2 ¶ added in v0.1.21
func (imatrix *ALiInstanceMatrix) ListInstanceMatrixByRegionV2(region string) *map[string][]string
type ALiMetaDB ¶ added in v0.1.13
type ALiMetaDB struct {
// contains filtered or unexported fields
}
func DefaultAliMetaDb ¶
func DefaultAliMetaDb() *ALiMetaDB
func NewMetaDBALi ¶ added in v0.1.13
func (*ALiMetaDB) ODPrice ¶ added in v0.1.14
func (m *ALiMetaDB) ODPrice() ODPriceALi
func (*ALiMetaDB) SpotInstance ¶ added in v0.1.14
func (m *ALiMetaDB) SpotInstance() SpotInstanceALi
func (*ALiMetaDB) SpotPrice ¶ added in v0.1.14
func (m *ALiMetaDB) SpotPrice() SpotPriceALi
type ALiSpotInstance ¶ added in v0.1.17
type ALiSpotInstance struct {
// contains filtered or unexported fields
}
func NewALiSpotInstance ¶ added in v0.1.17
func NewALiSpotInstance(key string, region Region) *ALiSpotInstance
func (*ALiSpotInstance) FetchALiSpot ¶ added in v0.1.17
func (s *ALiSpotInstance) FetchALiSpot(consul *gokit.Consul) error
func (*ALiSpotInstance) GetInstByRegion ¶ added in v0.1.17
func (s *ALiSpotInstance) GetInstByRegion(region string) map[string]map[string]map[string]*SpotInstanceInfoAli
func (*ALiSpotInstance) GetInstByRegionAndZones ¶ added in v0.1.17
func (s *ALiSpotInstance) GetInstByRegionAndZones(region string, zone string) *[]*SpotInstanceInfoAli
func (*ALiSpotInstance) GetInstInfoByTypes ¶ added in v0.1.18
func (s *ALiSpotInstance) GetInstInfoByTypes(region string, zone string, inst []string) *map[string]*SpotInstanceInfoAli
type AWSImage ¶ added in v0.1.2
type AWSImage struct { AWSImageData // contains filtered or unexported fields }
func NewAWSImage ¶ added in v0.1.2
func (*AWSImage) FetchImage ¶ added in v0.1.4
func (*AWSImage) ListImagesByRegion ¶ added in v0.1.2
type AWSImageData ¶ added in v0.1.2
type AWSImageData struct {
// contains filtered or unexported fields
}
type AWSInstance ¶
type AWSInstance struct { AWSInstanceData // contains filtered or unexported fields }
func NewAWSInstance ¶
func NewAWSInstance(key string, region Region) *AWSInstance
func (*AWSInstance) Filter ¶
func (i *AWSInstance) Filter(list []*FilterType) *AWSInstanceData
func (*AWSInstance) GetInstInfo ¶
func (i *AWSInstance) GetInstInfo(region string, instance string) *InstInfo
func (*AWSInstance) List ¶
func (i *AWSInstance) List(region string) []*InstInfo
type AWSInstanceData ¶
type AWSInstanceData struct {
// contains filtered or unexported fields
}
type AWSOdPrice ¶
type AWSOdPrice struct { AWSOdPriceData // contains filtered or unexported fields }
func NewAWSOdPrice ¶
func NewAWSOdPrice(key string) *AWSOdPrice
func (*AWSOdPrice) Filter ¶
func (i *AWSOdPrice) Filter(list []*FilterType) *AWSOdPriceData
func (*AWSOdPrice) List ¶
func (i *AWSOdPrice) List(region string) []*AWSOdPriceList
type AWSOdPriceData ¶
type AWSOdPriceData struct {
// contains filtered or unexported fields
}
type AWSOdPriceList ¶
type AWSSpotInstance ¶ added in v0.1.25
type AWSSpotInstance struct { AWSSpotInstanceData // contains filtered or unexported fields }
func NewAWSSpotInstance ¶ added in v0.1.25
func NewAWSSpotInstance(key string, region Region) *AWSSpotInstance
func (*AWSSpotInstance) Fetch ¶ added in v0.1.25
func (si *AWSSpotInstance) Fetch(consul *gokit.Consul) error
func (*AWSSpotInstance) GetInstInfo ¶ added in v0.1.25
func (si *AWSSpotInstance) GetInstInfo(region string, instance string) *InstInfo
func (*AWSSpotInstance) List ¶ added in v0.1.25
func (si *AWSSpotInstance) List(region string) []*InstInfo
type AWSSpotInstanceData ¶ added in v0.1.25
type AWSSpotInstanceData struct {
// contains filtered or unexported fields
}
type AliInstance ¶
type AliInstance struct { AliInstanceData // contains filtered or unexported fields }
func NewAliInstance ¶ added in v0.1.2
func NewAliInstance(key string) *AliInstance
func (*AliInstance) FetchAli ¶ added in v0.1.2
func (i *AliInstance) FetchAli(consul *gokit.Consul) error
func (*AliInstance) List ¶ added in v0.1.2
func (i *AliInstance) List(region string) []*InstInfo
func (*AliInstance) ListByZone ¶ added in v0.1.3
func (i *AliInstance) ListByZone(region string, zone string) []*InstInfo
type AliInstanceData ¶ added in v0.1.2
type AliInstanceData struct {
// contains filtered or unexported fields
}
type AliOdPrice ¶ added in v0.1.2
type AliOdPrice struct { AliOdPriceData // contains filtered or unexported fields }
func NewAliOdPrice ¶ added in v0.1.2
func NewAliOdPrice(key string) *AliOdPrice
func (*AliOdPrice) FetchAli ¶ added in v0.1.2
func (i *AliOdPrice) FetchAli(consul *gokit.Consul) error
func (*AliOdPrice) ListAli ¶ added in v0.1.2
func (i *AliOdPrice) ListAli(region string) map[string]*ODPriceAli
type AliOdPriceData ¶ added in v0.1.2
type AliOdPriceData struct {
// contains filtered or unexported fields
}
type AliSpotPrice ¶ added in v0.1.2
type AliSpotPrice struct { AliSpotPriceData // contains filtered or unexported fields }
func NewAliSpotPrice ¶ added in v0.1.2
func NewAliSpotPrice(key string) *AliSpotPrice
func (*AliSpotPrice) FetchAli ¶ added in v0.1.2
func (i *AliSpotPrice) FetchAli(consul *gokit.Consul) error
func (*AliSpotPrice) ListAli ¶ added in v0.1.2
func (i *AliSpotPrice) ListAli(region string, zone string) map[string]*SpotPriceInfoAli
type AliSpotPriceData ¶ added in v0.1.2
type AliSpotPriceData struct {
// contains filtered or unexported fields
}
type CloudIdentifier ¶
type CloudIdentifier int
const ( AWS CloudIdentifier = iota Ali CloudIdentifier = 1 )
type CommonRegion ¶ added in v0.1.2
type CommonRegion struct { CommonRegionData // contains filtered or unexported fields }
func NewCommonRegion ¶ added in v0.1.2
func NewCommonRegion(key string) *CommonRegion
func (*CommonRegion) Fetch ¶ added in v0.1.2
func (r *CommonRegion) Fetch(consul *gokit.Consul) error
func (*CommonRegion) Filter ¶ added in v0.1.2
func (r *CommonRegion) Filter(list []*string) *CommonRegionData
func (*CommonRegion) GetRegionInfo ¶ added in v0.1.2
func (r *CommonRegion) GetRegionInfo(name string) *RegionInfo
func (*CommonRegion) Keys ¶ added in v0.1.2
func (r *CommonRegion) Keys() gokit.Set
func (*CommonRegion) List ¶ added in v0.1.2
func (r *CommonRegion) List() []*RegionInfo
type CommonRegionData ¶ added in v0.1.2
type CommonRegionData struct {
// contains filtered or unexported fields
}
type CommonSpotPrice ¶ added in v0.1.2
type CommonSpotPrice struct { CommonSpotPriceData // contains filtered or unexported fields }
func NewCommonSpotPrice ¶ added in v0.1.2
func NewCommonSpotPrice(key string) *CommonSpotPrice
func (*CommonSpotPrice) Fetch ¶ added in v0.1.2
func (i *CommonSpotPrice) Fetch(consul *gokit.Consul) error
func (*CommonSpotPrice) Filter ¶ added in v0.1.2
func (i *CommonSpotPrice) Filter(list []*FilterType) *CommonSpotPriceData
func (*CommonSpotPrice) GetPrice ¶ added in v0.1.2
func (i *CommonSpotPrice) GetPrice(region string, instance string) *SpotPriceInfo
func (*CommonSpotPrice) List ¶ added in v0.1.2
func (i *CommonSpotPrice) List(region string) []*SpotPriceInfo
type CommonSpotPriceData ¶ added in v0.1.2
type CommonSpotPriceData struct {
// contains filtered or unexported fields
}
type DbSetALi ¶ added in v0.1.13
type DbSetALi struct { Region Region SpotPrice SpotPriceALi ODPrice ODPriceALi SpotInstance SpotInstanceALi }
type FilterType ¶
type FilterType struct {
// contains filtered or unexported fields
}
type Image ¶ added in v0.1.2
type Image interface { FetchImage(consul *gokit.Consul) error ListImagesByRegion(region string) *map[string]map[string]*ec2.Image ListImagesByRegionAndType(region string, imagetype string) *map[string]*ec2.Image }
aws Image
type ImageInfoALi ¶ added in v0.1.20
type InstInfo ¶
type InstInfo struct { Name string `json:"name"` Core int16 `json:"core"` Mem float64 `json:"mem"` Storage string `json:"storage"` Family string `json:"family"` ODPrice float64 `json:"odprice"` SpotPrice float64 `json:"spotprice"` }
TODO: more info item? TODO: make category const?
type InstanceMatrixALi ¶ added in v0.1.21
type InstanceMatrixALi interface { FetchALiMatrix(consul *gokit.Consul) error ListInstanceMatrixByRegion(region string) *map[string]map[string][]string ListInstanceMatrixByRegionAndZone(region string, zone string) *map[string][]string ListInstanceMatrixByRegionV2(region string) *map[string][]string }
type InterruptAdvisor ¶
type InterruptAdvisor struct { InterruptAdvisorData // contains filtered or unexported fields }
func NewAWSInterrupt ¶
func NewAWSInterrupt(key string) *InterruptAdvisor
func (*InterruptAdvisor) Filter ¶
func (i *InterruptAdvisor) Filter(list []*FilterType) *InterruptAdvisorData
func (*InterruptAdvisor) GetInterruptInfo ¶
func (i *InterruptAdvisor) GetInterruptInfo(region string, name string) *InterruptInfo
func (*InterruptAdvisor) List ¶
func (i *InterruptAdvisor) List(region string) []*InterruptInfo
type InterruptAdvisorData ¶
type InterruptAdvisorData struct {
// contains filtered or unexported fields
}
type InterruptInfo ¶
type InterruptInfoAli ¶ added in v0.1.3
type InterruptInfoAli struct {
Interrupt float64 `json:"interrupt_rate"`
}
type MetaDb ¶
type MetaDb struct {
// contains filtered or unexported fields
}
func DefaultAWSMetaDb ¶
func DefaultAWSMetaDb() *MetaDb
func NewMetaDBAWS ¶ added in v0.1.13
func (*MetaDb) SpotInstance ¶
type ODPriceALi ¶ added in v0.1.13
type ODPriceAli ¶ added in v0.1.2
type Region ¶
type Region interface { Fetch(consul *gokit.Consul) error List() []*RegionInfo GetRegionInfo(name string) *RegionInfo }
type RegionInfo ¶
type SpotInstanceALi ¶ added in v0.1.17
type SpotInstanceALi interface { FetchALiSpot(consul *gokit.Consul) error GetInstByRegion(region string) map[string]map[string]map[string]*SpotInstanceInfoAli GetInstByRegionAndZones(region string, zone string) *[]*SpotInstanceInfoAli GetInstInfoByTypes(region string, zone string, inst []string) *map[string]*SpotInstanceInfoAli }
type SpotInstanceAWS ¶ added in v0.1.25
type SpotInstanceInfoAli ¶ added in v0.1.2
type SpotInstanceInfoAli struct { InstType string `json:"instance_type"` Cores int16 `json:"core"` Mem float64 `json:"memory"` OriginalPrice float64 `json:"original_price"` TradePrice float64 `json:"trade_price"` DiscountPrice float64 `json:"discount_price"` SpotPrice float64 `json:"spot_price"` Family string `json:"family"` Desc string `json:"desc"` }
type SpotPriceALi ¶ added in v0.1.13
type SpotPriceInfo ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.