Documentation ¶
Index ¶
- Constants
- Variables
- func BSONSize(v interface{}) int
- type Collection
- type DataPoint
- type DataPoints
- type NonperiodicCollection
- func (c *NonperiodicCollection) Append(seriesId interface{}, timestamp time.Time, value interface{}) error
- func (c *NonperiodicCollection) CreateSeries(seriesId interface{}, startTime time.Time) error
- func (c *NonperiodicCollection) Latest(seriesId interface{}) (DataPoint, error)
- func (c *NonperiodicCollection) Range(seriesId interface{}, minTime time.Time, maxTime time.Time) (DataPoints, error)
- func (c *NonperiodicCollection) Update(seriesId interface{}, value interface{}) error
Constants ¶
View Source
const ( PAGE_HEADER_SIZE = 110 // page header size in bytes (as per Object.bsonsize()) TIMESTAMP_SIZE = 66 // Timestamp data type size in bytes (including encapsulation) )
Variables ¶
View Source
var ErrDuplicateSeries = errors.New("Time series already exists with the specified ID")
View Source
var ErrInvalidPageSize = errors.New("Pages size must be greater than 256 bytes")
View Source
var ErrNoData = errors.New("No existing data to update")
View Source
var ErrSeriesNotFound = errors.New("Series not found with the specified collection")
Errors
View Source
var ErrTooOld = errors.New("The timestamp of the specified value is older than the most recent entry or the series does not exist.")
View Source
var ErrValueTooLarge = errors.New("The size value specified exceeds the maximum Time Series page size.")
Functions ¶
Types ¶
type Collection ¶
type Collection interface { CreateSeries(seriesId interface{}, startTime time.Time) error Append(seriesId interface{}, timestamp time.Time, value interface{}) error Update(seriedId interface{}, value interface{}) error Range(seriesId interface{}, minTime time.Time, maxTime time.Time) (DataPoints, error) Latest(seriesId interface{}) (DataPoint, error) }
func NewNonperiodicCollection ¶
func NewNonperiodicCollection(database *mgo.Database, name string, pageSize int) (Collection, error)
type DataPoints ¶
type DataPoints []DataPoint
type NonperiodicCollection ¶
type NonperiodicCollection struct { PageSize int // contains filtered or unexported fields }
func (*NonperiodicCollection) Append ¶
func (c *NonperiodicCollection) Append(seriesId interface{}, timestamp time.Time, value interface{}) error
* value must have a consistent size
func (*NonperiodicCollection) CreateSeries ¶
func (c *NonperiodicCollection) CreateSeries(seriesId interface{}, startTime time.Time) error
func (*NonperiodicCollection) Latest ¶
func (c *NonperiodicCollection) Latest(seriesId interface{}) (DataPoint, error)
func (*NonperiodicCollection) Range ¶
func (c *NonperiodicCollection) Range(seriesId interface{}, minTime time.Time, maxTime time.Time) (DataPoints, error)
func (*NonperiodicCollection) Update ¶
func (c *NonperiodicCollection) Update(seriesId interface{}, value interface{}) error
Click to show internal directories.
Click to hide internal directories.