Documentation ¶
Index ¶
- func MonthlyForService(ctx context.Context, teamSlug slug.Slug, ...) (float32, error)
- func NewLoaderContext(ctx context.Context, dbConn *pgxpool.Pool, opts ...Option) context.Context
- type BigQueryDatasetCost
- type Client
- type FakeClient
- func (c *FakeClient) DailyForTeam(_ context.Context, teamSlug slug.Slug, fromDate, toDate time.Time, ...) (*TeamCostPeriod, error)
- func (c *FakeClient) DailyForTeamEnvironment(ctx context.Context, teamSlug slug.Slug, environmentName string, ...) (*TeamEnvironmentCostPeriod, error)
- func (c *FakeClient) DailyForWorkload(_ context.Context, teamSlug slug.Slug, environmentName, workloadName string, ...) (*WorkloadCostPeriod, error)
- func (c *FakeClient) MonthlyForService(_ context.Context, teamSlug slug.Slug, ...) (float32, error)
- func (c *FakeClient) MonthlyForWorkload(_ context.Context, teamSlug slug.Slug, environmentName, workloadName string) (*WorkloadCostPeriod, error)
- func (c *FakeClient) MonthlySummaryForTeam(_ context.Context, teamSlug slug.Slug) (*TeamCostMonthlySummary, error)
- type OpenSearchCost
- type Option
- type RedisInstanceCost
- type SQLInstanceCost
- type ServiceCostSample
- type ServiceCostSeries
- type TeamCost
- type TeamCostDailyFilter
- type TeamCostMonthlySample
- type TeamCostMonthlySummary
- type TeamCostPeriod
- type TeamEnvironmentCost
- type TeamEnvironmentCostPeriod
- type WorkloadCost
- type WorkloadCostPeriod
- type WorkloadCostSample
- type WorkloadCostSeries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MonthlyForService ¶
Types ¶
type BigQueryDatasetCost ¶
type BigQueryDatasetCost struct {
Sum float64 `json:"sum"`
}
type Client ¶
type Client interface { DailyForWorkload(ctx context.Context, teamSlug slug.Slug, environmentName, workloadName string, fromDate, toDate time.Time) (*WorkloadCostPeriod, error) MonthlyForWorkload(ctx context.Context, teamSlug slug.Slug, environmentName, workloadName string) (*WorkloadCostPeriod, error) DailyForTeamEnvironment(ctx context.Context, teamSlug slug.Slug, environmentName string, fromDate, toDate time.Time) (*TeamEnvironmentCostPeriod, error) DailyForTeam(ctx context.Context, teamSlug slug.Slug, fromDate, toDate time.Time, filter *TeamCostDailyFilter) (*TeamCostPeriod, error) MonthlySummaryForTeam(ctx context.Context, teamSlug slug.Slug) (*TeamCostMonthlySummary, error) MonthlyForService(ctx context.Context, teamSlug slug.Slug, environmentName, workloadName, service string) (float32, error) }
type FakeClient ¶
type FakeClient struct {
// contains filtered or unexported fields
}
func NewFakeClient ¶
func NewFakeClient() *FakeClient
func (*FakeClient) DailyForTeam ¶
func (c *FakeClient) DailyForTeam(_ context.Context, teamSlug slug.Slug, fromDate, toDate time.Time, filter *TeamCostDailyFilter) (*TeamCostPeriod, error)
func (*FakeClient) DailyForTeamEnvironment ¶
func (c *FakeClient) DailyForTeamEnvironment(ctx context.Context, teamSlug slug.Slug, environmentName string, fromDate, toDate time.Time) (*TeamEnvironmentCostPeriod, error)
func (*FakeClient) DailyForWorkload ¶
func (c *FakeClient) DailyForWorkload(_ context.Context, teamSlug slug.Slug, environmentName, workloadName string, fromDate, toDate time.Time) (*WorkloadCostPeriod, error)
func (*FakeClient) MonthlyForService ¶
func (*FakeClient) MonthlyForWorkload ¶
func (c *FakeClient) MonthlyForWorkload(_ context.Context, teamSlug slug.Slug, environmentName, workloadName string) (*WorkloadCostPeriod, error)
func (*FakeClient) MonthlySummaryForTeam ¶
func (c *FakeClient) MonthlySummaryForTeam(_ context.Context, teamSlug slug.Slug) (*TeamCostMonthlySummary, error)
type OpenSearchCost ¶
type OpenSearchCost struct {
Sum float64 `json:"sum"`
}
type RedisInstanceCost ¶
type RedisInstanceCost struct {
Sum float64 `json:"sum"`
}
type SQLInstanceCost ¶
type SQLInstanceCost struct {
Sum float64 `json:"sum"`
}
type ServiceCostSample ¶
type ServiceCostSeries ¶
type ServiceCostSeries struct { Date scalar.Date `json:"date"` Services []*ServiceCostSample `json:"services"` }
func (*ServiceCostSeries) Sum ¶
func (w *ServiceCostSeries) Sum() float64
type TeamCostDailyFilter ¶
type TeamCostDailyFilter struct { // Services to include in the summary. Services []string `json:"services,omitempty"` }
type TeamCostMonthlySample ¶
type TeamCostMonthlySummary ¶
type TeamCostMonthlySummary struct {
Series []*TeamCostMonthlySample `json:"series"`
}
func MonthlySummaryForTeam ¶
func (*TeamCostMonthlySummary) Sum ¶
func (t *TeamCostMonthlySummary) Sum() float64
type TeamCostPeriod ¶
type TeamCostPeriod struct {
Series []*ServiceCostSeries `json:"series"`
}
func DailyForTeam ¶
func DailyForTeam(ctx context.Context, teamSlug slug.Slug, fromDate, toDate time.Time, filter *TeamCostDailyFilter) (*TeamCostPeriod, error)
func (*TeamCostPeriod) Sum ¶
func (w *TeamCostPeriod) Sum() float64
type TeamEnvironmentCost ¶
type TeamEnvironmentCostPeriod ¶
type TeamEnvironmentCostPeriod struct {
Series []*WorkloadCostSeries `json:"series"`
}
func DailyForTeamEnvironment ¶
func (*TeamEnvironmentCostPeriod) Sum ¶
func (w *TeamEnvironmentCostPeriod) Sum() float64
type WorkloadCost ¶
type WorkloadCostPeriod ¶
type WorkloadCostPeriod struct {
Series []*ServiceCostSeries `json:"series"`
}
func DailyForWorkload ¶
func MonthlyForWorkload ¶
func (*WorkloadCostPeriod) Sum ¶
func (w *WorkloadCostPeriod) Sum() float64
type WorkloadCostSample ¶
type WorkloadCostSeries ¶
type WorkloadCostSeries struct { Date scalar.Date `json:"date"` Workloads []*WorkloadCostSample `json:"workloads"` }
func (*WorkloadCostSeries) Sum ¶
func (w *WorkloadCostSeries) Sum() float64
Click to show internal directories.
Click to hide internal directories.