dateutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpHeaderDate

func HttpHeaderDate(headers http.Header, key string) (time.Time, stackerr.Error)

HttpHeaderDate gets a time.Time from a given header key in the given header object.

func TimeFromUnix

func TimeFromUnix[T constraints.Integer](unix T) time.Time

TimeFromUnix will parse a Unix timestamp that can be in seconds, milliseconds, microseconds, or nanoseconds.

func Waiter

func Waiter(ctx context.Context, duration time.Duration, closeOnCtxDone bool) <-chan struct{}

Waiter will return a channel that will close after the specified duration. If the context is cancelled, the channel will never close.

func WaiterWithCallback

func WaiterWithCallback(ctx context.Context, duration time.Duration, closeOnCtxDone bool, callback func(ctx context.Context)) <-chan struct{}

WaiterWithCallback will return a channel that will close after the specified duration. If the context is cancelled, the channel will never close.

Types

This section is empty.

Jump to

Keyboard shortcuts

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