Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("record not found")
Functions ¶
This section is empty.
Types ¶
type TimeSeries ¶
TimeSeries is use to save time series data to redis
func NewTimeSeries ¶
func NewTimeSeries(prefix string, timestep time.Duration, exp time.Duration, db redis.Conn) *TimeSeries
NewTimeSeries create new TimeSeries
func (*TimeSeries) Add ¶
func (t *TimeSeries) Add(data interface{}, tm ...time.Time) (err error)
Add add data to timeseries db
func (*TimeSeries) Fetch ¶
func (t *TimeSeries) Fetch(tm time.Time, dest interface{}) (err error)
Fetch get value one time
func (*TimeSeries) FetchRange ¶
func (t *TimeSeries) FetchRange(begin, end time.Time, dest interface{}) (err error)
FetchRange fetch data from the begin time to end time
Click to show internal directories.
Click to hide internal directories.