cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

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
}

Cache is a thread-safe in-memory cache for service resource lists. It stores items keyed by {AccountID, Region, Service} so that switching between services/regions can show previously loaded data instantly.

func New

func New() *Cache

New creates an empty cache.

func (*Cache) Clear

func (c *Cache) Clear()

Clear removes all entries from the cache.

func (*Cache) Delete

func (c *Cache) Delete(key Key)

Delete removes a single cache entry.

func (*Cache) Get

func (c *Cache) Get(key Key) (interface{}, bool)

Get retrieves cached items for the given key. Returns the items and true if found, nil and false otherwise.

func (*Cache) Len

func (c *Cache) Len() int

Len returns the number of entries in the cache.

func (*Cache) Set

func (c *Cache) Set(key Key, items interface{})

Set stores items in the cache under the given key.

type Key

type Key struct {
	AccountID string
	Region    string
	Service   string
}

Key identifies a cache entry by account, region, and service.

Jump to

Keyboard shortcuts

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