utils

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatchFirst

func CatchFirst(ops ...func() error) diag.Diagnostics

func DiagFromErrPtr

func DiagFromErrPtr(err error) *diag.Diagnostics

func DiffRulesJSONState

func DiffRulesJSONState(_, old, new string, _ *schema.ResourceData) bool

diffRulesJSONState suppresses diff if json values are equivalent, independant of whitespace or order of keys

func PathToName

func PathToName(path string) string

Converts a segment resource path to its id E.g: workspaces/myworkspace/sources/mysource => mysource

func Search(len int, eq func(i int) bool) int

Search performs a linear search in an indexed collection and returns the index of the found item, or -1

func WithBackoff

func WithBackoff(call func() (interface{}, error), initialRetryDelay time.Duration, maxRetries int) (interface{}, error)

withBackoff calls the passed function returning a result and an error and performs an exponential backoff if it fails with a 429 HTTP status code

Types

This section is empty.

Jump to

Keyboard shortcuts

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