Documentation
¶
Index ¶
- Constants
- Variables
- func BaseConditions(pm domain.MessagesPageMetadata, timeColumn string) []string
- func BaseQueryParams(pm domain.MessagesPageMetadata) map[string]any
- func ComparatorSymbol(key string) string
- func JSONConditions(pm domain.JSONPageMetadata) []string
- func JSONQueryParams(pm domain.JSONPageMetadata) map[string]any
- func ParseKey(key string) (string, error)
- func SenMLConditions(pm domain.SenMLPageMetadata) []string
Constants ¶
View Source
const ( JSONTable = "json" JSONOrder = "created" SenMLTable = "senml" SenMLOrder = "time" // EqualKey represents the equal comparison operator key. EqualKey = "eq" // LowerThanKey represents the lower-than comparison operator key. LowerThanKey = "lt" // LowerThanEqualKey represents the lower-than-or-equal comparison operator key. LowerThanEqualKey = "le" // GreaterThanKey represents the greater-than-or-equal comparison operator key. GreaterThanKey = "gt" // GreaterThanEqualKey represents the greater-than-or-equal comparison operator key. GreaterThanEqualKey = "ge" // StartsWithKey represents the case-insensitive starts-with comparison operator key. StartsWithKey = "starts_with" // ContainsKey represents the case-insensitive contains comparison operator key. ContainsKey = "contains" // MicrosecondInterval represents the microsecond aggregation interval unit. MicrosecondInterval = "microsecond" // MillisecondInterval represents the millisecond aggregation interval unit. MillisecondInterval = "millisecond" // SecondInterval represents the second aggregation interval unit. SecondInterval = "second" // MinuteInterval represents the minute aggregation interval unit. MinuteInterval = "minute" // HourInterval represents the hour aggregation interval unit. HourInterval = "hour" // DayInterval represents the day aggregation interval unit. DayInterval = "day" // WeekInterval represents the week aggregation interval unit. WeekInterval = "week" // MonthInterval represents the month aggregation interval unit. MonthInterval = "month" // YearInterval represents the year aggregation interval unit. YearInterval = "year" )
Variables ¶
View Source
var ( // ErrInvalidKey indicates a malformed JSON payload key. ErrInvalidKey = errors.New("invalid key") )
Functions ¶
func BaseConditions ¶
func BaseConditions(pm domain.MessagesPageMetadata, timeColumn string) []string
func BaseQueryParams ¶
func BaseQueryParams(pm domain.MessagesPageMetadata) map[string]any
func ComparatorSymbol ¶
ComparatorSymbol converts a comparison operator key into its SQL symbol.
func JSONConditions ¶ added in v0.44.0
func JSONConditions(pm domain.JSONPageMetadata) []string
JSONConditions returns the SQL predicates common to every json read.
func JSONQueryParams ¶ added in v0.44.0
func JSONQueryParams(pm domain.JSONPageMetadata) map[string]any
JSONQueryParams returns the named parameters referenced by JSONConditions.
func ParseKey ¶ added in v0.44.0
ParseKey converts a dot-separated JSON payload key into a strict JSON path. Arrays are only entered through an index: [n] for one item or [*] for any item.
func SenMLConditions ¶
func SenMLConditions(pm domain.SenMLPageMetadata) []string
senmlConditions returns the SQL predicates common to every senml read, including the aggregated ones.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.