Documentation ¶
Index ¶
- Constants
- type Option
- type Updater
- func (u *Updater) FetchBigQueryData(ctx context.Context, ch chan<- costsql.CostUpsertParams) error
- func (u *Updater) RefreshView(ctx context.Context) error
- func (u *Updater) ShouldUpdateCosts(ctx context.Context) (bool, error)
- func (u *Updater) UpdateCosts(ctx context.Context, ch <-chan costsql.CostUpsertParams) error
Constants ¶
View Source
const (
UpsertBatchSize = 100000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Updater)
Option is a function that can be used to set custom options for the cost updater
func WithBigQueryTable ¶
WithBigQueryTable will set a custom BigQuery table to fetch data from
func WithDaysToFetch ¶
WithDaysToFetch will set a custom number of days to fetch from BigQuery
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater is the cost updater struct
func NewCostUpdater ¶
func NewCostUpdater(bigQueryClient *bigquery.Client, querier costsql.Querier, tenantName string, log logrus.FieldLogger, opts ...Option) *Updater
NewCostUpdater creates a new cost updater
func (*Updater) FetchBigQueryData ¶
FetchBigQueryData fetches cost data from BigQuery and sends it to the provided channel
func (*Updater) ShouldUpdateCosts ¶
ShouldUpdateCosts returns true if costs should be updated, false otherwise
func (*Updater) UpdateCosts ¶
UpdateCosts will update the cost data in the database based on data from the provided channel
Click to show internal directories.
Click to hide internal directories.