World Conquest Chronicles

World Conquest Chronicles

go-cache, v1.4

The library that implements an in-memory cache with garbage collection in two modes: total (based on a full scan) and partial (based on expiration in Redis).

Support options for the implementation of an in-memory cache and for implementations of garbage collection.

Change Log

  • implementation of an in-memory cache:
    • options (optional):
      • implementation of a key-value storage;
      • callback for timing;
  • implementation of garbage collection:
    • implementation of total garbage collection (based on a full scan):
      • options (optional):
        • callback for timing;
    • implementation of partial garbage collection (based on expiration in Redis):
      • options (optional):
        • callback for timing;
        • maximum iteration count;
        • minimum percent of expired values;
  • refactoring:
    • update the github.com/thewizardplusplus/go-hashmap package;
    • use the hashmap.Storage interface;
  • misc.:
    • improve the Travis CI configuration.

Features

  • implementation of an in-memory cache:
    • operations:
      • getting a value by a key:
        • signaling a reason for the absence of a key - missed or expired;
      • getting a value by a key with deletion of expired values:
        • signaling a reason for the absence of a key - missed or expired;
      • setting a key-value pair with a specified time to live:
        • support of key-value pairs without a set time to live (persistent);
      • deletion;
    • options (optional):
      • implementation of a key-value storage;
      • callback for timing;
  • implementation of garbage collection:
    • independent implementation of garbage collection running:
      • support interruption via a context;
      • support specification of a running period;
    • implementation of total garbage collection (based on a full scan):
      • options (optional):
        • callback for timing;
    • implementation of partial garbage collection (based on expiration in Redis):
      • options (optional):
        • callback for timing;
        • maximum iteration count;
        • minimum percent of expired values.

Repository

Link: https://github.com/thewizardplusplus/go-cache/tree/v1.4.

Content: code.

License: MIT.