package backoff

import (
	
	
)

// PermanentError signals that the operation should not be retried.
type PermanentError struct {
	Err error
}

// Permanent wraps the given err in a *PermanentError.
func ( error) error {
	if  == nil {
		return nil
	}
	return &PermanentError{
		Err: ,
	}
}

// Error returns a string representation of the Permanent error.
func ( *PermanentError) () string {
	return .Err.Error()
}

// Unwrap returns the wrapped error.
func ( *PermanentError) () error {
	return .Err
}

// RetryAfterError signals that the operation should be retried after the given duration.
type RetryAfterError struct {
	Duration time.Duration
}

// RetryAfter returns a RetryAfter error that specifies how long to wait before retrying.
func ( int) error {
	return &RetryAfterError{Duration: time.Duration() * time.Second}
}

// Error returns a string representation of the RetryAfter error.
func ( *RetryAfterError) () string {
	return fmt.Sprintf("retry after %s", .Duration)
}