cache

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Overview

Package cache implements an in-memory cache for arbitrary objects.

This package was originally adapted from https://github.com/google/exposure-notifications-server, but it has evolved beyond that specific use case.

At the time of this writing, there is no standard, general-purpose TTL-based caching library for Go. There are multiple LRU-based caches, but those do not satisfy the requirements for a TTL-based cache. If a standard package were to emerge in the future, we should consider switching.

This package assumes the system time has minimal skew. In case of major clock skew or system clock reset, cache expirations could occur out of order.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T