timeslice

package
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyTimeSliceError   = errors.New("empty time slice")
	OutOfBoundsError      = errors.New("out of bounds")
	OutOfBoundsLowerError = errors.New("out of bounds lower")
	OutOfBoundsUpperError = errors.New("out of bounds upper")
)

Functions

This section is empty.

Types

type TimeSlice

type TimeSlice []time.Time

TimeSlice is used for sorting. e.g. sort.Sort(sort.Reverse(timeSlice)) sort.Sort(timeSlice)

func ParseTimeSlice

func ParseTimeSlice(format string, times []string) (TimeSlice, error)

func (TimeSlice) Dedupe

func (ts TimeSlice) Dedupe() TimeSlice

func (TimeSlice) Duplicate

func (ts TimeSlice) Duplicate() TimeSlice

func (TimeSlice) Equal

func (ts TimeSlice) Equal(compare TimeSlice) bool

func (TimeSlice) Format

func (ts TimeSlice) Format(format string) []string

func (TimeSlice) Len

func (ts TimeSlice) Len() int

func (TimeSlice) Less

func (ts TimeSlice) Less(i, j int) bool

func (TimeSlice) RangeLower

func (ts TimeSlice) RangeLower(t time.Time, inclusive bool) (time.Time, error)

RangeLower returns the TimeSlice time value for the range lower than or equal to the supplied time.

func (TimeSlice) RangeUpper added in v0.29.0

func (ts TimeSlice) RangeUpper(t time.Time, inclusive bool) (time.Time, error)

RangeUpper returns the TimeSlice time value for the range lower than or equal to the supplied time. The time `t` must be less than or equal to the upper range.

func (TimeSlice) Sort

func (ts TimeSlice) Sort()

func (TimeSlice) Swap

func (ts TimeSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL