cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(lat, lon float64, lang string) string

Key generates a cache key from request params

Types

type Cache

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

Cache provides file-based caching for API responses

func New

func New(dir string, ttl time.Duration) *Cache

New creates a cache with given directory and TTL

func (*Cache) Get

func (c *Cache) Get(key string) ([]byte, error)

Get retrieves cached data, returns nil if not found or expired

func (*Cache) Set

func (c *Cache) Set(key string, data []byte) error

Set stores data with the cache key

Jump to

Keyboard shortcuts

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