Documentation ¶
Index ¶
- Variables
- func TimeRangesToString(tr []TimeRange) string
- type MergeOptions
- type TimeRange
- type TimeSerie
- func (ts TimeSerie[T]) AreMissing(start, end time.Time, interval time.Duration, limit uint) bool
- func (ts *TimeSerie[T]) Delete(t ...time.Time)
- func (ts TimeSerie[T]) Extract(start, end time.Time, limit int) *TimeSerie[T]
- func (ts TimeSerie[T]) First() (time.Time, T, bool)
- func (ts TimeSerie[T]) FirstN(limit uint) *TimeSerie[T]
- func (ts *TimeSerie[T]) Get(t time.Time) (T, bool)
- func (ts TimeSerie[T]) GetMissingRanges(start, end time.Time, interval time.Duration, limit uint) []TimeRange
- func (ts TimeSerie[T]) GetMissingTimes(start, end time.Time, interval time.Duration, limit uint) []time.Time
- func (ts TimeSerie[T]) Last() (time.Time, T, bool)
- func (ts *TimeSerie[T]) Len() int
- func (ts *TimeSerie[T]) Loop(callback func(time.Time, T) (bool, error)) error
- func (ts *TimeSerie[T]) Merge(ts2 TimeSerie[T], options *MergeOptions) error
- func (ts *TimeSerie[T]) Set(t time.Time, d T) *TimeSerie[T]
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTimeRangeInvalid = fmt.Errorf("time range invalid") ErrTimeRangeStartAfterEnd = fmt.Errorf("%w: start after end", ErrTimeRangeInvalid) )
View Source
var (
ErrTimeStampAlreadyExists error = errors.New("timestamp-already-exists")
)
Functions ¶
func TimeRangesToString ¶
Types ¶
type MergeOptions ¶
type MergeOptions struct {
ErrorOnCollision bool
}
type TimeRange ¶
TimeRange is a structure representing the slot of time, from start to end
func MergeTimeRanges ¶
func OrderTimeRanges ¶
type TimeSerie ¶
type TimeSerie[T any] struct { // contains filtered or unexported fields }
func (TimeSerie[T]) AreMissing ¶
AreMissing checks if there is missing candlesticks between two times
func (TimeSerie[T]) GetMissingRanges ¶
func (TimeSerie[T]) GetMissingTimes ¶
func (ts TimeSerie[T]) GetMissingTimes(start, end time.Time, interval time.Duration, limit uint) []time.Time
GetMissingTimes returns an array of missing time in the timeserie
Click to show internal directories.
Click to hide internal directories.