Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TimedMemoize ¶
type TimedMemoize[T any] struct { // contains filtered or unexported fields }
TimedMemoize wraps a function returning (value, error) and caches the value AND the error for a specific time. This cache is mainly used to ensure external calls rates are reasonable. The cache is thread-safe.
func NewTimedMemoize ¶
func NewTimedMemoize[T any](getter func(ctx context.Context) (T, error), duration time.Duration) *TimedMemoize[T]
NewTimedMemoize builds and returns a TimedMemoize
Click to show internal directories.
Click to hide internal directories.