helper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBodyJSON

func ParseBodyJSON[T any](body io.Reader) (responseBody T, err error)

ParseBodyJSON reads the body and then Unmarshal it into T.

func RunWithRetry

func RunWithRetry(fn func() error, maxRetry int, interval time.Duration) error

RunWithRetry runs the fn until it returns err nil or reaches the maxRetry. If maxRetry is set to 0 or lower, it will keep retrying until success.

func UnmarshalJSON

func UnmarshalJSON[T any](data []byte) (T, error)

UnmarshalJSON create a new object T, unmarshal the data into the object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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