codeberg.org/gruf/go-cache/v3@v3.5.7/README.md (about)

     1  # go-cache
     2  
     3  Provides access to simple, yet flexible, and performant caches (with TTL if required) via the `cache.Cache{}` and `cache.TTLCache{}` interfaces.
     4  
     5  ## simple
     6  
     7  A `cache.Cache{}` implementation with much more of the inner workings exposed. Designed to be used as a base for your own customizations, or used as-is.
     8  
     9  ## ttl
    10  
    11  A `cache.TTLCache{}` implementation with much more of the inner workings exposed. Designed to be used as a base for your own customizations, or used as-is.
    12  
    13  ## result
    14  
    15  `result.Cache` is an example of a more complex cache implementation using `ttl.Cache{}` as its underpinning.
    16  
    17  It provides caching specifically of loadable struct types, with automatic keying by multiple different field members and caching of negative (error) values. All useful when wrapping, for example, a database.