cache

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cache manages local project caching and synchronization timestamps

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 the local project cache

func New

func New(dir string) *Cache

New creates a new Cache instance

func (*Cache) EnsureDir

func (c *Cache) EnsureDir() error

EnsureDir ensures the cache directory exists

func (*Cache) Exists

func (c *Cache) Exists() bool

Exists checks if the cache file exists

func (*Cache) LoadLastFullSyncTime

func (c *Cache) LoadLastFullSyncTime() (time.Time, error)

LoadLastFullSyncTime loads the last successful full sync timestamp Returns zero time if file doesn't exist (never had full sync)

func (*Cache) LoadLastSyncTime

func (c *Cache) LoadLastSyncTime() (time.Time, error)

LoadLastSyncTime loads the last successful sync timestamp Returns zero time if file doesn't exist (first sync)

func (*Cache) LoadUsername

func (c *Cache) LoadUsername() (string, error)

LoadUsername loads the GitLab username from cache Returns empty string if file doesn't exist

func (*Cache) ProjectsPath

func (c *Cache) ProjectsPath() string

ProjectsPath returns the full path to the projects cache file

func (*Cache) ReadProjects

func (c *Cache) ReadProjects() ([]model.Project, error)

ReadProjects reads the list of projects from cache Format: path|name|description (one per line, description may be empty) Also supports old format: path|name (for backward compatibility)

func (*Cache) SaveLastFullSyncTime

func (c *Cache) SaveLastFullSyncTime(t time.Time) error

SaveLastFullSyncTime saves the last successful full sync timestamp

func (*Cache) SaveLastSyncTime

func (c *Cache) SaveLastSyncTime(t time.Time) error

SaveLastSyncTime saves the last successful sync timestamp

func (*Cache) SaveUsername

func (c *Cache) SaveUsername(username string) error

SaveUsername saves the GitLab username to cache

func (*Cache) Stats

func (c *Cache) Stats() (int, error)

Stats returns cache statistics

func (*Cache) WriteProjects

func (c *Cache) WriteProjects(projects []model.Project) error

WriteProjects writes a list of projects to the cache Format: path|name|description (one per line, description may be empty)

Jump to

Keyboard shortcuts

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