Documentation
¶
Index ¶
- Constants
- Variables
- type BoltDBConfig
- type Boltdb
- func (bdb Boltdb) Add(name string, timeseries TimeSeries) error
- func (bdb Boltdb) Close() error
- func (bdb Boltdb) Create(name string) error
- func (bdb Boltdb) Delete(series string) error
- func (bdb Boltdb) Get(series string) (TimeSeries, error)
- func (bdb Boltdb) GetOnChannel(series string) (<-chan TimeEntry, chan error)
- func (bdb Boltdb) GetPages(q Query) ([]int64, int, error)
- func (bdb Boltdb) Query(q Query) (timeSeries TimeSeries, nextEntry *int64, err error)
- func (bdb Boltdb) QueryOnChannel(q Query) (<-chan TimeEntry, chan *int64, chan error)
- type Query
- type TSDB
- type TimeEntry
- type TimeSeries
Constants ¶
View Source
const ( ASC = "asc" DESC = "desc" )
Variables ¶
View Source
var (
ErrSeriesNotFound = errors.New("timeseries not found")
)
Functions ¶
This section is empty.
Types ¶
type BoltDBConfig ¶
type Boltdb ¶
type Boltdb struct {
// contains filtered or unexported fields
}
func (Boltdb) GetOnChannel ¶
type Query ¶
type Query struct {
Series string
From int64
To int64
//Sorting order:
//Possible values are ASC and DESC
//ASC : The time Series will have the oldest data first
//DESC: The time Series will have the latest data first.
Sort string
//Number of entries to be returned per page. This is used for pagination.
// The next sequence is found out using NextEntry variable of a query response.
MaxEntries int
}
type TSDB ¶
type TSDB interface {
//Create a new bucket
Create(name string) error
//This function adds the senml records
Add(name string, timeseries TimeSeries) error
//Get the senml records
Query(q Query) (timeSeries TimeSeries, nextEntry *int64, err error)
QueryOnChannel(q Query) (timeseries <-chan TimeEntry, nextEntry chan *int64, err chan error)
//Get the total pages for a particular query.
// This helps for any client to call multiple queries
GetPages(q Query) (seriesList []int64, count int, err error)
//Get the senml records
Get(series string) (timeSeries TimeSeries, err error)
//Returns two channels, one for Time entries and one for error.
//This avoids the usage of an extra buffer by the database
//Caution: first read the channel and then read the error. Error channel shall be written only after the timeseries channel is closed
GetOnChannel(series string) (timeseries <-chan TimeEntry, err chan error)
//Delete a complete Series
Delete(series string) error
//Close the database
Close() error
}
type TimeSeries ¶
type TimeSeries []TimeEntry
Click to show internal directories.
Click to hide internal directories.