Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MinimumWindowSizeDuration is the minimum window size the aggregation can represent. MinimumWindowSizeDuration = time.Second // MinimumWindowSize is the minimum window size the aggregation can represent. MinimumWindowSize = meter.WindowSizeSecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface {
namespace.Handler
CountEvents(ctx context.Context, namespace string, params CountEventsParams) ([]CountEventRow, error)
ListEvents(ctx context.Context, namespace string, params meterevent.ListEventsParams) ([]RawEvent, error)
ListEventsV2(ctx context.Context, params meterevent.ListEventsV2Params) ([]RawEvent, error)
QueryMeter(ctx context.Context, namespace string, meter meter.Meter, params QueryParams) ([]meter.MeterQueryRow, error)
ListMeterSubjects(ctx context.Context, namespace string, meter meter.Meter, params ListMeterSubjectsParams) ([]string, error)
BatchInsert(ctx context.Context, events []RawEvent) error
ValidateJSONPath(ctx context.Context, jsonPath string) (bool, error)
}
type CountEventRow ¶
CountEventRow represents a row in the count events response.
type CountEventsParams ¶
type ListMeterSubjectsParams ¶
ListMeterSubjectsParams is a parameter object for listing subjects.
func (ListMeterSubjectsParams) Validate ¶
func (p ListMeterSubjectsParams) Validate() error
Validate validates the list meters parameters.
type QueryParams ¶
type QueryParams struct {
ClientID *string
From *time.Time
To *time.Time
FilterCustomer []customer.Customer
FilterSubject []string
FilterGroupBy map[string][]string
GroupBy []string
WindowSize *meter.WindowSize
WindowTimeZone *time.Location
}
func (*QueryParams) Validate ¶
func (p *QueryParams) Validate() error
Validate validates query params focusing on `from` and `to` being aligned with query and meter window sizes
type RawEvent ¶
type RawEvent struct {
Namespace string `ch:"namespace" json:"-"`
ID string `ch:"id" json:"id"`
Type string `ch:"type" json:"type"`
Source string `ch:"source" json:"source"`
Subject string `ch:"subject" json:"subject"`
Time time.Time `ch:"time" json:"time"`
Data string `ch:"data" json:"data"`
IngestedAt time.Time `ch:"ingested_at" json:"ingested_at,omitempty,omitzero"`
StoredAt time.Time `ch:"stored_at" json:"stored_at,omitempty,omitzero"`
StoreRowID string `ch:"store_row_id" json:"store_row_id,omitempty,omitzero"`
}
RawEvent represents a single raw event
Click to show internal directories.
Click to hide internal directories.