cachelruttl

package module
v0.0.0-...-3bdb644 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cachelruttl is a naive implementation of a cache to use with awssecretmanager.

LRU: the size is fixed, it starts removing old entries when full.

TTL: it will not return old entries. Time precision: second. Old entries will still be in the cache, but filtered out on the Get().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func New

func New(size int, ttl time.Duration) *Cache

func (Cache) Add

func (c Cache) Add(key, value interface{})

func (Cache) Get

func (c Cache) Get(key interface{}) (value interface{}, ok bool)

Jump to

Keyboard shortcuts

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