utils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](arr []T, searched T) bool

func FromJson

func FromJson[S ~string, R any](serializable S, destination *R) error

func GetRequiredEnv

func GetRequiredEnv(key string) string

func Retry added in v0.0.5

func Retry(ctx context.Context, config *RetryConfig, err error)

func ToJson

func ToJson[T any](value T) (string, error)

Types

type RetryConfig added in v0.0.5

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

func CreateDefaultRetryConfig added in v0.0.5

func CreateDefaultRetryConfig(signalChan chan<- struct{}) *RetryConfig

func CreateRetryConfig added in v0.0.5

func CreateRetryConfig(interval time.Duration, strategy RetryStrategy, maxAttempts uint, signalChan chan<- struct{}) *RetryConfig

func (*RetryConfig) CanRetry added in v0.0.5

func (conf *RetryConfig) CanRetry() bool

type RetryStrategy added in v0.0.5

type RetryStrategy string
const (
	RetryStrategyFixed       RetryStrategy = "fixed"
	RetryStrategyIncremental RetryStrategy = "incr"
)

Jump to

Keyboard shortcuts

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