util

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(cond bool, msg string)

func Next

func Next(curr int64, cronExp string) (int64, error)

ref: t := time.Now().UnixMilli()

func OrderedRange

func OrderedRange[K cmp.Ordered, V any](m map[K]V) []V

func ParseCron

func ParseCron(cronExp string) (cron.Schedule, error)

func SafeDeref

func SafeDeref[T any](val *T) T

func ToPointer

func ToPointer[T any](val T) *T

func UnixMilliToTime

func UnixMilliToTime(unixMilli int64) time.Time

Types

type KV

type KV[K any, V any] struct {
	Key   K
	Value V
}

func OrderedRangeKV

func OrderedRangeKV[K cmp.Ordered, V any](m map[K]V) []*KV[K, V]

Jump to

Keyboard shortcuts

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