cache

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCacheDir

func GetCacheDir() (string, error)

GetCacheDir returns default root directory to use cached data

func IsExpired

func IsExpired(name string, ttl time.Duration) bool

IsExpired checks if cache file is older than ttl.

func LoadJSON

func LoadJSON(name string, v any) error

LoadJSON reads JSON from cache file into v.

func SaveJSON

func SaveJSON(name string, v any) error

SaveJSON writes v to a cache file with given name.

Types

type LicenseInfo

type LicenseInfo struct {
	Name  string `json:"name"`
	Risky bool   `json:"risky"`
}

type ModuleMetadata

type ModuleMetadata struct {
	Module  string      `json:"module"`
	Version string      `json:"version"`
	License LicenseInfo `json:"license"`
	CVEs    []string    `json:"cves"`
}

Jump to

Keyboard shortcuts

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