Versions in this module Expand all Collapse all v0 v0.2.7 Apr 25, 2024 Changes in this version + const B + const EB + const Ebit + const GB + const Gbit + const KB + const Kbit + const MB + const Mbit + const PB + const Pbit + const TB + const Tbit + const YB + const Ybit + const ZB + const Zbit + var DisableAVX2 = noop + var DisableAVX512 = noop + var EInvalidBitrate = errors.New("invalid bitrate") + var EInvalidByteSize = errors.New("invalid byte size") + var EnableAVX = noop + var FormatMap = map[TimeFormat]string + var IsAMD64 bool + var TimeFormats []string = []string + var UseAVX2 bool + var UseAVX512_4FMAPS bool + var UseAVX512_4VNNIW bool + var UseAVX512_BF16 bool + var UseAVX512_BITALG bool + var UseAVX512_BW bool + var UseAVX512_CD bool + var UseAVX512_DQ bool + var UseAVX512_ER bool + var UseAVX512_F bool + var UseAVX512_IFMA bool + var UseAVX512_PF bool + var UseAVX512_VBMI bool + var UseAVX512_VL bool + var UseAVX512_VP2INTERSECT bool + var UseAVX512_VPOPCNTDQ bool + func Abs[T constraints.Signed](n T) T + func Basename(s string) string + func ClampTime(val, min, max time.Time) time.Time + func Clamp[T constraints.Ordered](val, minIn, maxIn T) T + func ContainsString(s string, list []string) bool + func DaysBetween(a, b time.Time) int + func DaysIn(m time.Month, year int) int + func EscapeWhitespace(s string) string + func FirstNonZeroTime(val time.Time, others ...time.Time) time.Time + func Fqdn() string + func FromCamelCase(src, sep string) string + func HashString(s string) string + func HexString(v interface{}) string + func Int16AsUint16Slice(src []int16) []uint16 + func Int32AsUint32Slice(src []int32) []uint32 + func Int64AsUint64Slice(src []int64) []uint64 + func Int8AsUint8Slice(src []int8) []uint8 + func IsASCII(s string) bool + func IsBase64(s string) bool + func JoinString(sep string, more ...string) string + func JsonString(v interface{}) string + func LimitString(s string, l int) string + func LimitStringEllipsis(s string, l int) string + func LogCPUFeatures(l *log.Logger) + func MaxBytes(a, b []byte) []byte + func MaxDuration(a, b time.Duration) time.Duration + func MaxTime(x, y time.Time) time.Time + func MaxTimeN(t ...time.Time) time.Time + func MinBytes(a, b []byte) []byte + func MinDuration(a, b time.Duration) time.Duration + func MinMaxTime(s []time.Time) (time.Time, time.Time) + func MinMax[T constraints.Ordered](vals ...T) (T, T) + func MinTime(x, y time.Time) time.Time + func MinTimeN(t ...time.Time) time.Time + func NonEmptyString(s ...string) string + func NonZeroMin[T constraints.Ordered](x ...T) T + func NonZeroSince(start time.Time) time.Duration + func NonZero[T constraints.Ordered](x ...T) T + func Pretty(val interface{}) string + func PrettyFloat64(f float64) string + func PrettyFloat64N(f float64, decimals int) string + func PrettyInt(i int) string + func PrettyInt64(i int64) string + func PrettyString(s string) string + func PrettyUint64(i uint64) string + func QuoteString(s string) string + func RoundToDays(d time.Duration) int + func RoundToHours(d time.Duration) int64 + func RoundToMillisecond(d time.Duration) int64 + func RoundToMinutes(d time.Duration) int64 + func RoundToSeconds(d time.Duration) int64 + func StepsBetween(t1, t2 time.Time, d time.Duration) []time.Time + func ToCamelCase(src, sep string) string + func ToRawString(t interface{}) (string, error) + func ToString(t interface{}) string + func TrimAllSpace(str string) string + func TruncateDuration(d, r time.Duration) time.Duration + func Uint16AsInt16Slice(src []uint16) []int16 + func Uint32AsInt32Slice(src []uint32) []int32 + func Uint64AsInt64Slice(src []uint64) []int64 + func Uint8AsInt8Slice(src []uint8) []int8 + func UnescapeWhitespace(s string) string + func UniqueStrings(s []string) []string + func UnixMicro(t time.Time) int64 + func UnixMicroNonZero(t time.Time) int64 + func UnixMilli(t time.Time) int64 + func UnixMilliNonZero(t time.Time) int64 + func UnixNano(t time.Time) int64 + func UnixNanoNonZero(t time.Time) int64 + func UnixNonZero(t time.Time) int64 + func UnsafeGetBytes(s string) []byte + func UnsafeGetString(b []byte) string + type AlignedTicker struct + C <-chan time.Time + func NewAlignedTicker(d time.Duration) *AlignedTicker + func (t *AlignedTicker) Stop() + type BitRate float64 + const Eibit + const Gibit + const Kibit + const Mibit + const Pibit + const Tibit + const Yibit + const Zibit + func ParseBitRate(r string) (BitRate, error) + func (r *BitRate) UnmarshalText(data []byte) error + func (r BitRate) Int64() int64 + func (r BitRate) MarshalText() ([]byte, error) + func (r BitRate) Size(d time.Duration) ByteSize + func (r BitRate) String() string + type ByteSize float64 + const EiB + const GiB + const KiB + const MiB + const PiB + const TiB + const YiB + const ZiB + func ParseByteSize(r string) (ByteSize, error) + func (b ByteSize) BitRate(d time.Duration) BitRate + func (b ByteSize) String() string + func (r *ByteSize) UnmarshalText(data []byte) error + func (r ByteSize) Int64() int64 + func (r ByteSize) MarshalText() ([]byte, error) + type Duration time.Duration + func ParseDuration(d string) (Duration, error) + func (d *Duration) UnmarshalJSON(data []byte) error + func (d *Duration) UnmarshalText(data []byte) error + func (d Duration) Duration() time.Duration + func (d Duration) MarshalText() ([]byte, error) + func (d Duration) RoundToDays() int + func (d Duration) RoundToHours() int64 + func (d Duration) RoundToMillisecond() int64 + func (d Duration) RoundToMinutes() int64 + func (d Duration) RoundToSeconds() int64 + func (d Duration) String() string + func (d Duration) Truncate(r time.Duration) Duration + type GenericPool struct + func NewGenericPool(max int, fn func() interface{}) *GenericPool + func (p *GenericPool) Get() interface{} + func (p *GenericPool) Put(c interface{}) + type SizedPool struct + func NewSizedPool(max int, fn func(sz int) interface{}) *SizedPool + func (p *SizedPool) Get(sz int) interface{} + func (p *SizedPool) Put(c interface{}) + type StringList []string + func (l *StringList) Add(r string) StringList + func (l *StringList) AddFront(r string) StringList + func (l *StringList) AddUnique(r string) StringList + func (l *StringList) AddUniqueFront(r string) StringList + func (l *StringList) UnmarshalText(data []byte) error + func (l StringList) AsInterface() []interface{} + func (l StringList) Contains(r string) bool + func (l StringList) Index(r string) int + func (l StringList) MarshalText() ([]byte, error) + func (l StringList) String() string + type Time struct + func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time + func NewTime(t time.Time) Time + func NewTimeFrom(ts int64, res time.Duration) Time + func Now() Time + func ParseTime(value string) (Time, error) + func (f *Time) UnmarshalJSON(data []byte) error + func (f *Time) UnmarshalText(data []byte) error + func (f Time) EOD() Time + func (f Time) EODTime() time.Time + func (f Time) GetFormat() TimeFormat + func (f Time) IsDate() bool + func (f Time) MarshalJSON() ([]byte, error) + func (f Time) MarshalText() ([]byte, error) + func (f Time) String() string + func (f Time) Time() time.Time + func (t *Time) SetFormat(f TimeFormat) *Time + func (t Time) Add(d time.Duration) Time + func (t Time) AddDate(years int, months int, days int) Time + func (t Time) After(a Time) bool + func (t Time) AppendFormat(b []byte, layout string) []byte + func (t Time) Before(a Time) bool + func (t Time) Date() (int, time.Month, int) + func (t Time) DaysSince(a Time) int + func (t Time) Equal(t2 Time) bool + func (t Time) Format(layout string) string + func (t Time) IsZero() bool + func (t Time) Truncate(d time.Duration) Time + func (t Time) Unix() int64 + func (t Time) UnixMicro() int64 + func (t Time) UnixMilli() int64 + func (t Time) UnixNano() int64 + func (t Time) Year() int + type TimeFormat int + const TimeFormatDate + const TimeFormatDefault + const TimeFormatUnix + const TimeFormatUnixMicro + const TimeFormatUnixMilli + const TimeFormatUnixNano + func (f TimeFormat) IsUnix() bool + type TimeUnit struct + Unit rune + Value int + func ParseTimeUnit(s string) (TimeUnit, error) + func (c *TimeUnit) UnmarshalText(data []byte) error + func (c TimeUnit) Add(t time.Time) time.Time + func (c TimeUnit) Base() time.Duration + func (c TimeUnit) Between(from, to time.Time, limit int) []time.Time + func (c TimeUnit) Duration() time.Duration + func (c TimeUnit) MarshalText() ([]byte, error) + func (c TimeUnit) Next(t time.Time, n int) time.Time + func (c TimeUnit) Steps(from, to time.Time, limit int) []time.Time + func (c TimeUnit) String() string + func (c TimeUnit) Sub(t time.Time) time.Time + func (c TimeUnit) Truncate(t time.Time) time.Time + type U64String uint64 + func DecodeU64String(s string) (U64String, error) + func (u *U64String) UnmarshalText(data []byte) error + func (u U64String) Base64() string + func (u U64String) Hex() string + func (u U64String) MarshalText() ([]byte, error) + func (u U64String) String() string + func (u U64String) U64() uint64 + type WallTicker struct + C <-chan time.Time + func NewWallTicker(align, offset time.Duration) *WallTicker + func (w *WallTicker) Stop() v0.2.6 Mar 26, 2024 v0.2.5 Feb 24, 2024 v0.2.4 Dec 28, 2023 v0.2.3 Oct 27, 2023 v0.2.2 May 16, 2023 v0.2.1 Nov 25, 2022 v0.2.0 Aug 17, 2022