Documentation ¶ Index ¶ func Delete(key string) func DeleteByPrefix(prefix string) func GetEnv(key, fallback string) string func GetEnvDuration(key string, defaultDuration time.Duration) time.Duration func GetOrSet[T any](key string, ttl time.Duration, fn func() (T, error)) (T, error) 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. Source Files ¶ View all Source files cache.goenv.go Click to show internal directories. Click to hide internal directories.