Documentation ¶
Index ¶
- Variables
- type AwsAdditionalInfoParam
- type AwsCostExplorerBaristaCostCollector
- func (a *AwsCostExplorerBaristaCostCollector) GetCostInfos(ctx context.Context, param UpdateEstimateForecastCostRawParam) (EstimateForecastCostInfos, error)
- func (a *AwsCostExplorerBaristaCostCollector) Readyz(ctx context.Context) error
- func (a *AwsCostExplorerBaristaCostCollector) UpdateEstimateForecastCost(ctx context.Context, param UpdateEstimateForecastCostParam) (EstimateForecastCostInfos, error)
- type CostCollector
- type CostRepository
- func (r *CostRepository) BatchInsertAllEstimateCostResultTx(ctx context.Context, created EstimateCostInfos) error
- func (r *CostRepository) GetEstimateForecastCostInfosTx(ctx context.Context, param GetEstimateForecastCostParam) ([]GetEstimateForecastCostInfoResult, int64, error)
- func (r *CostRepository) GetMatchingEstimateCostInfosTx(ctx context.Context, param GetEstimateCostParam) (EstimateCostInfos, int64, error)
- func (r *CostRepository) GetMatchingEstimateCostTx(ctx context.Context, param RecommendSpecParam, timeStandard time.Time, ...) (EstimateCostInfos, error)
- func (r *CostRepository) GetMatchingEstimateCostWithoutTypeTx(ctx context.Context, param RecommendSpecParam, timeStandard time.Time, ...) (EstimateCostInfos, error)
- func (r *CostRepository) UpsertCostInfo(ctx context.Context, costInfo EstimateForecastCostInfo) (int64, int64, error)
- type CostResourceParam
- type CostService
- func (c *CostService) GetEstimateCost(param GetEstimateCostParam) (EstimateCostInfoResults, error)
- func (c *CostService) GetEstimateForecastCostInfos(param GetEstimateForecastCostParam) (GetEstimateForecastCostInfoResults, error)
- func (c *CostService) Readyz() error
- func (c *CostService) UpdateAndGetEstimateCost(param UpdateAndGetEstimateCostParam) (EstimateCostResults, error)
- func (c *CostService) UpdateEstimateForecastCost(param UpdateEstimateForecastCostParam) (UpdateEstimateForecastCostInfoResult, error)
- func (c *CostService) UpdateEstimateForecastCostRaw(param UpdateEstimateForecastCostRawParam) (UpdateEstimateForecastCostInfoResult, error)
- type EsimateCostSpecResults
- type EstimateCostInfo
- type EstimateCostInfoResult
- type EstimateCostInfoResults
- type EstimateCostInfos
- type EstimateCostResults
- type EstimateCostSpecDetailResult
- type EstimateForecastCostInfo
- type EstimateForecastCostInfos
- type GetEstimateCostParam
- type GetEstimateForecastCostInfoResult
- type GetEstimateForecastCostInfoResults
- type GetEstimateForecastCostParam
- type PriceCollector
- type RecommendSpecParam
- type SpiderPriceCollector
- type UpdateAndGetEstimateCostParam
- type UpdateEstimateForecastCostInfoResult
- type UpdateEstimateForecastCostParam
- type UpdateEstimateForecastCostRawParam
- type UpdatePriceInfosParam
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AwsAdditionalInfoParam ¶ added in v0.2.2
type AwsCostExplorerBaristaCostCollector ¶ added in v0.2.4
type AwsCostExplorerBaristaCostCollector struct {
// contains filtered or unexported fields
}
func (*AwsCostExplorerBaristaCostCollector) GetCostInfos ¶ added in v0.2.4
func (a *AwsCostExplorerBaristaCostCollector) GetCostInfos(ctx context.Context, param UpdateEstimateForecastCostRawParam) (EstimateForecastCostInfos, error)
func (*AwsCostExplorerBaristaCostCollector) Readyz ¶ added in v0.2.4
func (a *AwsCostExplorerBaristaCostCollector) Readyz(ctx context.Context) error
func (*AwsCostExplorerBaristaCostCollector) UpdateEstimateForecastCost ¶ added in v0.2.4
func (a *AwsCostExplorerBaristaCostCollector) UpdateEstimateForecastCost(ctx context.Context, param UpdateEstimateForecastCostParam) (EstimateForecastCostInfos, error)
type CostCollector ¶ added in v0.2.2
type CostCollector interface { Readyz(context.Context) error UpdateEstimateForecastCost(context.Context, UpdateEstimateForecastCostParam) (EstimateForecastCostInfos, error) GetCostInfos(context.Context, UpdateEstimateForecastCostRawParam) (EstimateForecastCostInfos, error) }
func NewAwsCostExplorerSpiderCostCollector ¶ added in v0.2.2
func NewAwsCostExplorerSpiderCostCollector(sc *spider.SpiderClient, tc *tumblebug.TumblebugClient) CostCollector
type CostRepository ¶
type CostRepository struct {
// contains filtered or unexported fields
}
func NewCostRepository ¶
func NewCostRepository(db *gorm.DB) *CostRepository
func (*CostRepository) BatchInsertAllEstimateCostResultTx ¶ added in v0.2.4
func (r *CostRepository) BatchInsertAllEstimateCostResultTx(ctx context.Context, created EstimateCostInfos) error
func (*CostRepository) GetEstimateForecastCostInfosTx ¶ added in v0.2.4
func (r *CostRepository) GetEstimateForecastCostInfosTx(ctx context.Context, param GetEstimateForecastCostParam) ([]GetEstimateForecastCostInfoResult, int64, error)
func (*CostRepository) GetMatchingEstimateCostInfosTx ¶ added in v0.2.4
func (r *CostRepository) GetMatchingEstimateCostInfosTx(ctx context.Context, param GetEstimateCostParam) (EstimateCostInfos, int64, error)
func (*CostRepository) GetMatchingEstimateCostTx ¶ added in v0.2.4
func (r *CostRepository) GetMatchingEstimateCostTx(ctx context.Context, param RecommendSpecParam, timeStandard time.Time, pricePolicy constant.PricePolicy) (EstimateCostInfos, error)
func (*CostRepository) GetMatchingEstimateCostWithoutTypeTx ¶ added in v0.2.4
func (r *CostRepository) GetMatchingEstimateCostWithoutTypeTx(ctx context.Context, param RecommendSpecParam, timeStandard time.Time, pricePolicy constant.PricePolicy) (EstimateCostInfos, error)
func (*CostRepository) UpsertCostInfo ¶ added in v0.2.2
func (r *CostRepository) UpsertCostInfo(ctx context.Context, costInfo EstimateForecastCostInfo) (int64, int64, error)
type CostResourceParam ¶ added in v0.2.2
type CostResourceParam struct { ResourceType constant.ResourceType ResourceIds []string }
type CostService ¶
type CostService struct {
// contains filtered or unexported fields
}
func NewCostService ¶
func NewCostService(costRepo *CostRepository, priceCollector PriceCollector, costCollector CostCollector) *CostService
func (*CostService) GetEstimateCost ¶ added in v0.2.4
func (c *CostService) GetEstimateCost(param GetEstimateCostParam) (EstimateCostInfoResults, error)
func (*CostService) GetEstimateForecastCostInfos ¶ added in v0.2.4
func (c *CostService) GetEstimateForecastCostInfos(param GetEstimateForecastCostParam) (GetEstimateForecastCostInfoResults, error)
func (*CostService) Readyz ¶ added in v0.2.3
func (c *CostService) Readyz() error
func (*CostService) UpdateAndGetEstimateCost ¶ added in v0.2.4
func (c *CostService) UpdateAndGetEstimateCost(param UpdateAndGetEstimateCostParam) (EstimateCostResults, error)
func (*CostService) UpdateEstimateForecastCost ¶ added in v0.2.4
func (c *CostService) UpdateEstimateForecastCost(param UpdateEstimateForecastCostParam) (UpdateEstimateForecastCostInfoResult, error)
func (*CostService) UpdateEstimateForecastCostRaw ¶ added in v0.2.4
func (c *CostService) UpdateEstimateForecastCostRaw(param UpdateEstimateForecastCostRawParam) (UpdateEstimateForecastCostInfoResult, error)
type EsimateCostSpecResults ¶ added in v0.2.4
type EsimateCostSpecResults struct { ProviderName string `json:"providerName,omitempty"` RegionName string `json:"regionName,omitempty"` InstanceType string `json:"instanceType,omitempty"` ImageName string `json:"imageName,omitempty"` SpecMinMonthlyPrice float64 `json:"totalMinMonthlyPrice,omitempty"` SpecMaxMonthlyPrice float64 `json:"totalMaxMonthlyPrice,omitempty"` EstimateCostSpecDetailResults []EstimateCostSpecDetailResult `json:"estimateForecastCostSpecDetailResults,omitempty"` }
type EstimateCostInfo ¶ added in v0.2.4
type EstimateCostInfo struct { gorm.Model ProviderName string `gorm:"index"` RegionName string `gorm:"index"` InstanceType string `gorm:"index"` ZoneName string VCpu string `gorm:"index"` Memory string `gorm:"index"` MemoryUnit constant.MemoryUnit OriginalMemory string Storage string OsType string `gorm:"index"` ProductDescription string OriginalPricePolicy string PricePolicy constant.PricePolicy Price string Currency constant.PriceCurrency Unit constant.PriceUnit OriginalUnit string OriginalCurrency string CalculatedMonthlyPrice float64 `gorm:"index"` PriceDescription string LastUpdatedAt time.Time ImageName string `gorm:"index"` }
type EstimateCostInfoResult ¶ added in v0.2.4
type EstimateCostInfoResult struct { ID uint `json:"id"` ProviderName string `json:"providerName"` RegionName string `json:"regionName"` InstanceType string `json:"instanceType"` VCpu string `json:"vCpu,omitempty"` Memory string `json:"memory,omitempty"` Storage string `json:"storage,omitempty"` OsType string `json:"osType,omitempty"` ProductDescription string `json:"productDescription,omitempty"` OriginalPricePolicy string `json:"originalPricePolicy,omitempty"` PricePolicy constant.PricePolicy `json:"pricePolicy,omitempty"` Unit constant.PriceUnit `json:"unit,omitempty"` Currency constant.PriceCurrency `json:"currency,omitempty"` Price string `json:"price,omitempty"` CalculatedMonthlyPrice float64 `json:"calculatedMonthlyPrice,omitempty"` PriceDescription string `json:"priceDescription,omitempty"` LastUpdatedAt time.Time `json:"lastUpdatedAt,omitempty"` }
type EstimateCostInfoResults ¶ added in v0.2.4
type EstimateCostInfoResults struct { EstimateCostInfoResult []EstimateCostInfoResult `json:"estimateCostInfoResult,omitempty"` ResultCount int64 `json:"resultCount"` }
type EstimateCostInfos ¶ added in v0.2.4
type EstimateCostInfos []*EstimateCostInfo
type EstimateCostResults ¶ added in v0.2.4
type EstimateCostResults struct {
EsimateCostSpecResults []EsimateCostSpecResults `json:"esimateCostSpecResults,omitempty"`
}
type EstimateCostSpecDetailResult ¶ added in v0.2.4
type EstimateCostSpecDetailResult struct { ID uint `json:"id"` VCpu string `json:"vCpu,omitempty"` Memory string `json:"memory,omitempty"` Storage string `json:"storage,omitempty"` OsType string `json:"osType,omitempty"` ProductDescription string `json:"productDescription,omitempty"` OriginalPricePolicy string `json:"originalPricePolicy,omitempty"` PricePolicy constant.PricePolicy `json:"pricePolicy,omitempty"` Unit constant.PriceUnit `json:"unit,omitempty"` Currency constant.PriceCurrency `json:"currency,omitempty"` Price string `json:"price,omitempty"` CalculatedMonthlyPrice float64 `json:"calculatedMonthlyPrice,omitempty"` PriceDescription string `json:"priceDescription,omitempty"` LastUpdatedAt time.Time `json:"lastUpdatedAt,omitempty"` }
type EstimateForecastCostInfo ¶ added in v0.2.4
type EstimateForecastCostInfo struct { gorm.Model Provider string `gorm:"index"` ConnectionName string ResourceType constant.ResourceType `gorm:"index"` Category string `gorm:"index"` Cost float64 Unit string ActualResourceId string `gorm:"index"` FormattedResourceId string Granularity string `gorm:"index"` StartDate time.Time `gorm:"index"` EndDate time.Time `gorm:"index"` NsId string `gorm:"index"` MciId string `gorm:"index"` }
type EstimateForecastCostInfos ¶ added in v0.2.4
type EstimateForecastCostInfos []EstimateForecastCostInfo
type GetEstimateCostParam ¶ added in v0.2.4
type GetEstimateForecastCostInfoResult ¶ added in v0.2.4
type GetEstimateForecastCostInfoResults ¶ added in v0.2.4
type GetEstimateForecastCostInfoResults struct { GetEstimateForecastCostInfoResults []GetEstimateForecastCostInfoResult `json:"getEstimateForecastCostInfoResults,omitempty"` ResultCount int64 `json:"resultCount"` }
type GetEstimateForecastCostParam ¶ added in v0.2.4
type GetEstimateForecastCostParam struct { Page int Size int StartDate time.Time EndDate time.Time NsIds []string MciIds []string Providers []string ResourceTypes []constant.ResourceType ResourceIds []string CostAggregationType constant.CostAggregationType DateOrder constant.OrderType ResourceTypeOrder constant.OrderType }
type PriceCollector ¶ added in v0.2.3
type PriceCollector interface { Readyz(context.Context) error FetchPriceInfos(context.Context, RecommendSpecParam) (EstimateCostInfos, error) }
func NewSpiderPriceCollector ¶ added in v0.2.3
func NewSpiderPriceCollector(sc *spider.SpiderClient) PriceCollector
type RecommendSpecParam ¶ added in v0.2.4
type RecommendSpecParam struct { ProviderName string `json:"providerName"` RegionName string `json:"regionName"` InstanceType string `json:"instanceType"` Image string `json:"image"` }
func (RecommendSpecParam) Hash ¶ added in v0.2.4
func (r RecommendSpecParam) Hash() string
type SpiderPriceCollector ¶ added in v0.2.3
type SpiderPriceCollector struct {
// contains filtered or unexported fields
}
func (*SpiderPriceCollector) FetchPriceInfos ¶ added in v0.2.4
func (s *SpiderPriceCollector) FetchPriceInfos(ctx context.Context, param RecommendSpecParam) (EstimateCostInfos, error)
type UpdateAndGetEstimateCostParam ¶ added in v0.2.4
type UpdateAndGetEstimateCostParam struct { RecommendSpecs []RecommendSpecParam `json:"recommendSpecs"` TimeStandard time.Time `json:"timeStandard"` PricePolicy constant.PricePolicy `json:"pricePolicy"` }
type UpdateEstimateForecastCostInfoResult ¶ added in v0.2.4
type UpdateEstimateForecastCostParam ¶ added in v0.2.4
type UpdateEstimateForecastCostRawParam ¶ added in v0.2.4
type UpdateEstimateForecastCostRawParam struct { Provider string // currently only aws ConnectionName string StartDate time.Time EndDate time.Time CostResources []CostResourceParam AwsAdditionalInfo AwsAdditionalInfoParam }
type UpdatePriceInfosParam ¶ added in v0.2.3
Click to show internal directories.
Click to hide internal directories.