Documentation
¶
Index ¶
- func CheckForNil(params ...any) error
- func CheckPointerToStruct(v any) error
- func Deref(v reflect.Value) reflect.Value
- func IsCI() bool
- func ParseURL(raw string) *url.URL
- func PrettyJSON(ctx context.Context, m contract.Marshaler, u contract.Unmarshaler, r io.Reader) ([]byte, error)
- func Retry(opts RetryOptions, f func() error) error
- func StructToMap(v reflect.Value) map[string]any
- type RetryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForNil ¶
CheckForNil checks if any of the given parameters is nil.
func CheckPointerToStruct ¶
CheckPointerToStruct checks if the provided value is a pointer to a struct.
func IsCI ¶ added in v0.1.289
func IsCI() bool
IsCI returns true if the current execution environment is a CI pipeline.
func ParseURL ¶ added in v0.1.119
ParseURL parses a raw string into a *url.URL. Returns a non-nil empty *url.URL on failure.
func PrettyJSON ¶ added in v0.1.297
func PrettyJSON(ctx context.Context, m contract.Marshaler, u contract.Unmarshaler, r io.Reader) ([]byte, error)
PrettyJSON pretty-prints a JSON stream using default indentation.
func Retry ¶
func Retry(opts RetryOptions, f func() error) error
Retry executes the provided function f at least once, retrying up to MaxRetries times if it fails. If MaxRetries is set to 0, the function will still run once. A delay is applied between retries. Returns nil if f succeeds within the allowed attempts; otherwise, returns the last encountered error.