Documentation ¶
Index ¶
Constants ¶
View Source
const SalesOrderLabel = "sales_order"
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(ctx context.Context, odoo OdooClient, prom PromQuerier, args ReportArgs, from time.Time, options ...Option) error
Run executes a prometheus query loaded from queries with using the `queryName` and the timestamp. The results of the query are saved in the facts table.
func RunRange ¶
func RunRange(ctx context.Context, odoo OdooClient, prom PromQuerier, args ReportArgs, from time.Time, until time.Time, options ...Option) (int, error)
RunRange executes prometheus queries like Run() until the `until` timestamp is reached or an error occurred. Returns the number of reports run and a possible error.
Types ¶
type OdooClient ¶
type OdooClient interface {
SendData(ctx context.Context, data []odoo.OdooMeteredBillingRecord) error
}
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option represents a report option.
func WithProgressReporter ¶
WithProgressReporter allows setting a callback function. The callback receives a progress report when generating multiple reports.
func WithPrometheusQueryTimeout ¶
WithPrometheusQueryTimeout allows setting a timout when querying prometheus.
type PromQuerier ¶
Click to show internal directories.
Click to hide internal directories.