cache

module
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0, MIT

README

cache

Project status GoDoc License

Contains multiple in-memory cache implementations including LRU & LFU

Requirements
  • Go 1.18+
Contents

Visit linked cache README's via the links below for more details.

Cache Description
LRU A Least recently Used cache.
LFU A Lead Frequently Used cache.
Thread Safety

These caches have the option of being built with no locking, allowing fine grained control of locking scemantics for the caller, and an auto locking option, for when fine grained control is not required.

When to control your own locking scemantics:

  • No additional overhead if not needed.
  • If one or more operations are desired to be done at once, which allows caller/locker/user to choose the locking strategy that best suits them. eg. can lock and do two gets and a set before unlocking.

When to use auto locking:

  • When only one operation will ever be done at once eg. Get, Set, Remove, ...
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this package by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Directories

Path Synopsis
_examples
lfu
lru

Jump to

Keyboard shortcuts

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