Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountByLevel ¶
type CountByLevel string
CountByLevel is a typed string alias describing which document level the API should count by when aggregating. Values are defined by the backend. This type is intentionally open-ended to avoid breaking changes if the API adds new levels.
const ( // CountByLevelHost counts at the host level. CountByLevelHost CountByLevel = "host" // CountByLevelService counts at the service level. CountByLevelService CountByLevel = "service" // CountByLevelProtocol counts at the protocol level. CountByLevelProtocol CountByLevel = "protocol" )
type Params ¶
type Params struct {
OrgID mo.Option[identifiers.OrganizationID]
CollectionID mo.Option[identifiers.CollectionID]
Query string
Field string
NumBuckets int64
CountByLevel mo.Option[CountByLevel]
FilterByQuery mo.Option[bool]
}
AggregateParams bundles parameters used to perform an aggregation. Using a struct prevents parameter drift and improves readability as the API evolves.
Note: OrgID and CollectionID are options; only one of them is typically used at a time. If CollectionID is present, the aggregation occurs in the collection scope; otherwise, it occurs in the global scope. The CountByLevel option is a typed alias to reduce stringly-typed errors. The FilterByQuery option determines whether results are limited to values matching the query.
type Result ¶
type Result struct {
Meta *responsemeta.ResponseMeta
Buckets []Bucket
}
AggregateResult represents the normalized aggregation result returned by the application layer. It contains response metadata and a list of buckets.