Documentation
¶
Overview ¶
Package transport provides internal transport utilities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TimeoutRetry ¶
func TimeoutRetry[T any](timeout time.Duration, operation RetryOperation[T]) (T, error)
TimeoutRetry executes an operation with timeout-based retry logic Common pattern for polling operations (like waiting for device ready)
func WithRetry ¶
func WithRetry[T any](config RetryConfig, operation RetryOperation[T]) (T, error)
WithRetry executes an operation with retry logic This consolidates the common retry pattern used across transports
Types ¶
type RetryConfig ¶
type RetryConfig struct {
OnRetry func() error
OnRetryFailed func() error
Description string
MaxRetries int
RetryDelay time.Duration
}
RetryConfig configures retry behavior
type RetryOperation ¶
RetryOperation represents a function that can be retried Returns: data, shouldRetry, error - data: the result if successful - shouldRetry: true if the operation should be retried - error: any permanent error that should stop retries
Click to show internal directories.
Click to hide internal directories.