cache

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 11 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 manages directory data caching

func NewCache

func NewCache(cfg *config.Config, apiClient *api.Client) *Cache

NewCache creates a new cache instance

func (*Cache) Clear

func (c *Cache) Clear() error

Clear clears the cache

func (*Cache) FilterDirectories

func (c *Cache) FilterDirectories(directories []models.Directory, options *models.FilterOptions) []models.Directory

FilterDirectories filters directories based on criteria

func (*Cache) GetCacheInfo

func (c *Cache) GetCacheInfo() (map[string]interface{}, error)

GetCacheInfo returns cache information

func (*Cache) GetDirectories

func (c *Cache) GetDirectories(ctx context.Context, forceRefresh bool) ([]models.Directory, error)

GetDirectories retrieves directories from cache or API

func (*Cache) Sync

func (c *Cache) Sync(ctx context.Context) error

Sync forces a cache refresh

type CacheMetadata

type CacheMetadata struct {
	LastUpdated time.Time `json:"last_updated"`
	Version     string    `json:"version"`
	Count       int       `json:"count"`
}

CacheMetadata holds cache metadata

Jump to

Keyboard shortcuts

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