Documentation
¶
Overview ¶
Package evredis provides an evdb backend using Redis
Index ¶
- Constants
- Variables
- type DB
- type Options
- type Resolution
- func (r Resolution) AddSteps(t time.Time, n int) time.Time
- func (r Resolution) IsZero() bool
- func (r Resolution) MarshalTime(t time.Time) string
- func (r Resolution) Name() string
- func (r Resolution) Step() time.Duration
- func (r Resolution) TTL() time.Duration
- func (r Resolution) Truncate(t time.Time) time.Time
- func (r Resolution) UnmarshalTime(s string) (t time.Time, err error)
- func (r Resolution) WithCodec(codec tcodec.TimeCodec) Resolution
- func (r Resolution) WithLayout(layout string) Resolution
- func (r Resolution) WithName(name string) Resolution
- func (r Resolution) WithStep(step time.Duration) Resolution
- func (r Resolution) WithTTL(ttl time.Duration) Resolution
Constants ¶
View Source
const ( DailyDateFormat string = "2006-01-02" HourlyDateFormat string = "2006-01-02-15" )
Date formats
View Source
const ( Hourly = time.Hour Daily = 24 * time.Hour Weekly = 7 * Daily Monthly = 30 * Daily Yearly = 365 * Daily )
Common durations
Variables ¶
View Source
var ( // NoResolution = Resolution{"totals", 0, 0, NoResolutionCodec} ResolutionHourly = Resolution{"hourly", 0, Hourly, tcodec.LayoutCodec(HourlyDateFormat)} ResolutionDaily = Resolution{"daily", 0, Daily, tcodec.LayoutCodec(DailyDateFormat)} ResolutionWeekly = Resolution{"weekly", 0, Weekly, tcodec.ISOWeekCodec} )
Common resolutions
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB is an evdb backend using Redis
type Options ¶
type Options struct { Redis string ScanSize int64 KeyPrefix string Resolutions []Resolution }
Options are options for a DB
type Resolution ¶
type Resolution struct {
// contains filtered or unexported fields
}
Resolution describes time dimensions
func NewResolution ¶
func NewResolution(name string, step, ttl time.Duration) Resolution
func (Resolution) IsZero ¶
func (r Resolution) IsZero() bool
func (Resolution) MarshalTime ¶
func (r Resolution) MarshalTime(t time.Time) string
func (Resolution) Name ¶
func (r Resolution) Name() string
func (Resolution) Step ¶
func (r Resolution) Step() time.Duration
func (Resolution) TTL ¶
func (r Resolution) TTL() time.Duration
func (Resolution) UnmarshalTime ¶
func (r Resolution) UnmarshalTime(s string) (t time.Time, err error)
func (Resolution) WithCodec ¶
func (r Resolution) WithCodec(codec tcodec.TimeCodec) Resolution
func (Resolution) WithLayout ¶
func (r Resolution) WithLayout(layout string) Resolution
func (Resolution) WithName ¶
func (r Resolution) WithName(name string) Resolution
func (Resolution) WithStep ¶
func (r Resolution) WithStep(step time.Duration) Resolution
func (Resolution) WithTTL ¶
func (r Resolution) WithTTL(ttl time.Duration) Resolution
Click to show internal directories.
Click to hide internal directories.