cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(input string) string

Types

type Cache

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

func NewCache

func NewCache(store storage.Storage) *Cache

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, key string) ([]byte, bool, error)

func (*Cache) Set

func (c *Cache) Set(ctx context.Context, key string, response []byte, ttl time.Duration) error

type CacheItem

type CacheItem struct {
	Response  []byte        `json:"response"`
	CreatedAt time.Time     `json:"created_at"`
	TTL       time.Duration `json:"ttl"`
}

Jump to

Keyboard shortcuts

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