cache

package
v0.0.0-...-0adb5f9 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: BSD-3-Clause Imports: 7 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
}

func New

func New(cacheDir string, ttlDays int) (*Cache, error)

func (*Cache) CleanExpired

func (c *Cache) CleanExpired() error

func (*Cache) Clear

func (c *Cache) Clear() error

func (*Cache) Get

func (c *Cache) Get(query string) (*CacheEntry, bool)

func (*Cache) GetTTL

func (c *Cache) GetTTL() int

func (*Cache) Set

func (c *Cache) Set(query string, packages []Package) error

type CacheEntry

type CacheEntry struct {
	Query     string    `json:"query"`
	Results   []Package `json:"results"`
	Timestamp time.Time `json:"timestamp"`
}

type Package

type Package struct {
	Name        string `json:"name"`
	ImportPath  string `json:"import_path"`
	Description string `json:"description"`
	Version     string `json:"version,omitempty"`
	IsInstalled bool   `json:"is_installed,omitempty"`
}

Jump to

Keyboard shortcuts

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