Documentation ¶
Overview ¶
Package aggregation implements Aggregation API
Index ¶
- Constants
- Variables
- type API
- type Aggregation
- type DataEntry
- type DataSet
- type Index
- type InfluxAggr
- func (a *InfluxAggr) CreateHandler(ds registry.DataSource) error
- func (a *InfluxAggr) DeleteHandler(ds registry.DataSource) error
- func (a *InfluxAggr) Query(aggr registry.Aggregation, q data.Query, page, perPage int, ...) (DataSet, int, error)
- func (a *InfluxAggr) UpdateHandler(oldDS registry.DataSource, newDS registry.DataSource) error
- type RecordSet
- type Storage
Constants ¶
View Source
const (
MaxPerPage = 1000
)
Variables ¶
View Source
var (
ErrNotImplemented = errors.New("API not implemented")
)
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) Aggregations ¶
func (api *API) Aggregations() (map[string]Aggregation, error)
Retrieve aggregations from registry api
type Aggregation ¶
type Index ¶
type Index struct {
Aggrs []Aggregation `json:"aggregations"`
}
type InfluxAggr ¶
type InfluxAggr struct {
// contains filtered or unexported fields
}
InfluxAggr implements a InfluxDB aggregation client for HDS Data API
func (*InfluxAggr) CreateHandler ¶ added in v0.6.1
func (a *InfluxAggr) CreateHandler(ds registry.DataSource) error
CreateHandler handles the creation of a new data source
func (*InfluxAggr) DeleteHandler ¶ added in v0.6.1
func (a *InfluxAggr) DeleteHandler(ds registry.DataSource) error
DeleteHandler handles deletion of a data source
func (*InfluxAggr) Query ¶
func (a *InfluxAggr) Query(aggr registry.Aggregation, q data.Query, page, perPage int, sources ...registry.DataSource) (DataSet, int, error)
Query retrieves aggregated data
func (*InfluxAggr) UpdateHandler ¶ added in v0.6.1
func (a *InfluxAggr) UpdateHandler(oldDS registry.DataSource, newDS registry.DataSource) error
UpdateHandler handles updates of a data source
type RecordSet ¶
type RecordSet struct { // URL is the URL of the returned recordset in the Data API URL string `json:"url"` // Data is a SenML object with data records, where // Name (bn and n) constitute the resource URL of the corresponding Data Source(s) Data DataSet `json:"data"` // Time is the time of query in milliseconds Time float64 `json:"time"` // Page is the current page in Data pagination Page int `json:"page"` // PerPage is the results per page in Data pagination PerPage int `json:"per_page"` // Total is the total #of pages in Data pagination Total int `json:"total"` }
RecordSet describes the recordset returned on querying the Aggr API
type Storage ¶
type Storage interface { // Queries data for specified data sources Query(aggr registry.Aggregation, q data.Query, page, perPage int, sources ...registry.DataSource) (DataSet, int, error) // EventListener includes methods for event handling registry.EventListener }
func NewInfluxAggr ¶
func NewInfluxAggr(influxStorage *data.InfluxStorage) (Storage, error)
NewInfluxAggr returns a new InfluxAggr
Click to show internal directories.
Click to hide internal directories.