utils

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string)

func DeleteByPrefix

func DeleteByPrefix(prefix string)

func GetEnv

func GetEnv(key, fallback string) string

func GetEnvDuration

func GetEnvDuration(key string, defaultDuration time.Duration) time.Duration

func GetOrSet

func GetOrSet[T any](key string, ttl time.Duration, fn func() (T, error)) (T, error)

GetOrSet кеширует результат функции по ключу. Если значение есть в кеше — вернёт его. Если нет — вызовет `fn`, закеширует и вернёт.

Types

This section is empty.

Jump to

Keyboard shortcuts

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