Skip to main content

options.go

options.go - Overview

  1. Overview

This file defines the configuration options for the in-memory cache, including TTL (time-to-live) and cleanup interval.

  1. Detailed Documentation

Constants

  • defaultTTL

    • Purpose: Defines the default time-to-live for cache entries, set to no expiration.
    • Value: go_cache.NoExpiration
    • Type: go_cache.Expiration
  • defaultCleanupInterval

    • Purpose: Defines the default interval for cleaning up expired cache entries.
    • Value: 1 * time.Minute
    • Type: time.Duration

type Options

  • Purpose: Holds the configuration options for the in-memory cache.
  • Fields:
    • TTL
      • Purpose: The time to live for cache entries.
      • Type: time.Duration
    • CleanupInterval
      • Purpose: The interval at which the cache is cleaned up to remove expired entries.
      • Type: time.Duration

func defaultOptions() *Options

  • Purpose: Returns a pointer to an Options struct with default values for TTL and CleanupInterval.
  • Returns:
    • Type: *Options
    • Description: A pointer to an Options struct initialized with defaultTTL and defaultCleanupInterval.
  1. Code Examples

None

  1. Clarity and Accuracy

The documentation reflects the code accurately.

  1. Markdown & MDX Perfection

No issues found.

  1. Edge Cases To Avoid Breaking MDX

No issues found.

  1. Getting Started Relevance

Include in Getting Started: NO