Documentation ¶
Index ¶
- Variables
- func Logger(ctx context.Context) *zap.Logger
- type MaterializedView
- func (mv *MaterializedView) HorizonTime(now time.Time) time.Time
- func (mv *MaterializedView) MakeRefreshAllSQL() (string, []interface{}, error)
- func (mv *MaterializedView) MakeRefreshWindowSQL(start time.Time, end time.Time) (string, []interface{}, error)
- func (mv *MaterializedView) TimeBucket(original time.Time) time.Time
- type TimeScaleDBConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaterializedViews = []*MaterializedView{ { Name: "fieldkit.sensor_data_10m", ShortName: "10m", BucketWidth: time.Minute * 10, EndOffsetSQL: "20 minutes", EndOffsetDuration: time.Minute * 20, }, { Name: "fieldkit.sensor_data_1h", ShortName: "1h", BucketWidth: time.Hour * 1, EndOffsetSQL: "3 hours", EndOffsetDuration: time.Hour * 3, }, { Name: "fieldkit.sensor_data_6h", ShortName: "6h", BucketWidth: time.Hour * 6, EndOffsetSQL: "21 hours", EndOffsetDuration: time.Hour * 21, }, { Name: "fieldkit.sensor_data_24h", ShortName: "24h", BucketWidth: time.Hour * 24, EndOffsetSQL: "72 hours", EndOffsetDuration: time.Hour * 72, }, } )
Functions ¶
Types ¶
type MaterializedView ¶
type MaterializedView struct { Name string ShortName string BucketWidth time.Duration EndOffsetSQL string EndOffsetDuration time.Duration }
func (*MaterializedView) HorizonTime ¶
func (mv *MaterializedView) HorizonTime(now time.Time) time.Time
func (*MaterializedView) MakeRefreshAllSQL ¶
func (mv *MaterializedView) MakeRefreshAllSQL() (string, []interface{}, error)
func (*MaterializedView) MakeRefreshWindowSQL ¶
func (*MaterializedView) TimeBucket ¶
func (mv *MaterializedView) TimeBucket(original time.Time) time.Time
type TimeScaleDBConfig ¶
type TimeScaleDBConfig struct { Url string // contains filtered or unexported fields }
func (*TimeScaleDBConfig) MaterializedViews ¶
func (tsc *TimeScaleDBConfig) MaterializedViews() []*MaterializedView
func (*TimeScaleDBConfig) RefreshViews ¶
func (tsc *TimeScaleDBConfig) RefreshViews(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.