util

package
v0.0.0-...-0611383 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoWithTimeout

func DoWithTimeout(ctx context.Context, f func() error, t time.Duration) error

DoWithTimeout runs f and returns its error. If the timeout elapses first, returns a ctx timeout error instead.

func StringToDuration

func StringToDuration(s string, defaultDuration time.Duration) (time.Duration, error)

StringToDuration parses the string into a time.Duration value. If the string is empty, the default time.Duration is returned.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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