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: 0

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