Documentation
¶
Index ¶
- Constants
- Variables
- type Database
- type MemCacheConfig
- type MemCacheDB
- func (mem MemCacheDB) Add(name string, timeseries TimeSeries) error
- func (mem MemCacheDB) Close() error
- func (mem MemCacheDB) Create(name string) error
- func (mem MemCacheDB) Delete(series string) error
- func (mem MemCacheDB) Get(series string) (TimeSeries, error)
- func (mem MemCacheDB) GetOnChannel(series string) (<-chan TimeEntry, chan error)
- func (mem MemCacheDB) GetPages(q Query) ([]int64, int, error)
- func (mem MemCacheDB) Query(q Query) (timeSeries TimeSeries, nextEntry *int64, err error)
- func (mem MemCacheDB) QueryOnChannel(q Query) (<-chan TimeEntry, chan *int64, chan error)
- type Query
- 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 Database ¶
type Database interface {
// Create a new bucket
Create(name string) error
// This function adds the records
Add(name string, timeseries TimeSeries) error
// Get the 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 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 MemCacheConfig ¶
type MemCacheDB ¶
type MemCacheDB struct {
// contains filtered or unexported fields
}
func (MemCacheDB) Add ¶
func (mem MemCacheDB) Add(name string, timeseries TimeSeries) error
func (MemCacheDB) Close ¶
func (mem MemCacheDB) Close() error
func (MemCacheDB) Create ¶
func (mem MemCacheDB) Create(name string) error
func (MemCacheDB) Delete ¶
func (mem MemCacheDB) Delete(series string) error
func (MemCacheDB) Get ¶
func (mem MemCacheDB) Get(series string) (TimeSeries, error)
func (MemCacheDB) GetOnChannel ¶
func (mem MemCacheDB) GetOnChannel(series string) (<-chan TimeEntry, chan error)
func (MemCacheDB) Query ¶
func (mem MemCacheDB) Query(q Query) (timeSeries TimeSeries, nextEntry *int64, err error)
func (MemCacheDB) QueryOnChannel ¶
func (mem MemCacheDB) QueryOnChannel(q Query) (<-chan TimeEntry, chan *int64, chan error)
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 TimeSeries ¶
type TimeSeries []TimeEntry
Click to show internal directories.
Click to hide internal directories.