Skip to content

v1.5.2

Latest

Choose a tag to compare

@thewizardplusplus thewizardplusplus released this 28 Jul 00:03

Pass a context to the cache.NewCacheWithGC() method directly.

Change Log

  • pass a context to the cache.NewCacheWithGC() method directly.

Features

  • implementation of an in-memory cache:
    • operations:
      • running garbage collection at the same time as initializing a cache (optional);
      • 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;
      • iteration over values and their keys:
        • support stopping of iteration:
          • via a handling result;
          • via a context;
      • iteration over values and their keys with deletion of expired values:
        • support stopping of iteration:
          • via a handling result;
          • via a context;
      • 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):
      • without running garbage collection:
        • implementation of a key-value storage;
        • callback for timing;
      • with running garbage collection:
        • context for stopping of iteration;
        • implementation of a key-value storage;
        • callback for timing;
        • callback that produces an instance of an implementation of garbage collection;
        • period of running of garbage collection;
  • 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.