util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrivateFieldsDecoder

func PrivateFieldsDecoder(stru interface{}, privateFieldName string) reflect.Value

PrivateFieldsDecoder is a function that provides access to the values of private fields within a specified struct. The stru parameter should be a pointer to a struct containing the private field(s). The privateFieldName parameter should be the name of the private field you wish to access. If you need to access a subfield, specify the field names separated by dots (e.g. "privateField2.privateField").

The function returns a reflect.Value object containing the value of the specified private field. See TestPrivateFieldsDecoder in decoder_test.go to know how to access your wanted field via reflect.Value.

func RetryWithExponentialBackOff

func RetryWithExponentialBackOff(fn wait.ConditionFunc) error

RetryWithExponentialBackOff is the utility for retrying the given function with exponential backoff.

Types

type SemaphoredErrGroup

type SemaphoredErrGroup struct {
	// contains filtered or unexported fields
}

func NewErrGroupWithSemaphore

func NewErrGroupWithSemaphore(ctx context.Context) *SemaphoredErrGroup

func (*SemaphoredErrGroup) Go

func (e *SemaphoredErrGroup) Go(fn func() error) error

func (*SemaphoredErrGroup) Wait

func (e *SemaphoredErrGroup) Wait() error

Jump to

Keyboard shortcuts

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