Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 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" )
Variables ¶
View Source
var ErrReadMessages = errors.New("failed to read messages from database")
ErrReadMessages indicates failure occurred while reading messages from database.
Functions ¶
func ParseValueComparator ¶
ParseValueComparator convert comparison operator keys into mathematic anotation
Types ¶
type MessageRepository ¶
type MessageRepository interface { // ListAllMessages retrieves all messages from database. ListAllMessages(rpm PageMetadata) (MessagesPage, error) // Restore restores message database from a backup. Restore(ctx context.Context, messages ...senml.Message) error // Backup retrieves all messages from database. Backup(rpm PageMetadata) (MessagesPage, error) }
MessageRepository specifies message reader API.
type MessagesPage ¶
type MessagesPage struct { PageMetadata Total uint64 Messages []Message }
MessagesPage contains page related metadata as well as list of messages that belong to this page.
type PageMetadata ¶
type PageMetadata struct { Offset uint64 `json:"offset"` Limit uint64 `json:"limit"` Subtopic string `json:"subtopic,omitempty"` Publisher string `json:"publisher,omitempty"` Protocol string `json:"protocol,omitempty"` Name string `json:"name,omitempty"` Value float64 `json:"v,omitempty"` Comparator string `json:"comparator,omitempty"` BoolValue bool `json:"vb,omitempty"` StringValue string `json:"vs,omitempty"` DataValue string `json:"vd,omitempty"` From float64 `json:"from,omitempty"` To float64 `json:"to,omitempty"` Format string `json:"format,omitempty"` }
PageMetadata represents the parameters used to create database queries
Directories ¶
Path | Synopsis |
---|---|
Package influxdb contains the domain concept definitions needed to support Mainflux InfluxDB reader service functionality.
|
Package influxdb contains the domain concept definitions needed to support Mainflux InfluxDB reader service functionality. |
Package mongodb contains the domain concept definitions needed to support Mainflux MondoDB reader service functionality.
|
Package mongodb contains the domain concept definitions needed to support Mainflux MondoDB reader service functionality. |
Package postgres contains repository implementations using Postgres as the underlying database.
|
Package postgres contains repository implementations using Postgres as the underlying database. |
Package timescale contains repository implementations using Timescale as the underlying database.
|
Package timescale contains repository implementations using Timescale as the underlying database. |
Click to show internal directories.
Click to hide internal directories.