cache

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterRunsByCommit

func FilterRunsByCommit(runs []github.RunTiming, commitSHA string) []github.RunTiming

func FilterRunsByConclusion

func FilterRunsByConclusion(runs []github.RunTiming, conclusion string) []github.RunTiming

func GetLatestRunPerWorkflow

func GetLatestRunPerWorkflow(runs []github.RunTiming) []github.RunTiming

func GetRunsInDateRange

func GetRunsInDateRange(runs []github.RunTiming, since, until time.Time) []github.RunTiming

Types

type GHAPerfCache

type GHAPerfCache struct {
	UpdatedAt time.Time          `json:"updated_at"`
	Repo      string             `json:"repo"`
	Runs      []github.RunTiming `json:"runs"`
}

type GHAPerfCacheManager

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

func NewGHAPerfCacheManager

func NewGHAPerfCacheManager(cacheDir string) (*GHAPerfCacheManager, error)

func (*GHAPerfCacheManager) Clear

func (m *GHAPerfCacheManager) Clear(owner, repo string) error

func (*GHAPerfCacheManager) ClearAll

func (m *GHAPerfCacheManager) ClearAll() error

func (*GHAPerfCacheManager) GetCachedRunIDs

func (m *GHAPerfCacheManager) GetCachedRunIDs(owner, repo string) (map[int]bool, error)

func (*GHAPerfCacheManager) ListCaches

func (m *GHAPerfCacheManager) ListCaches() ([]string, error)

func (*GHAPerfCacheManager) Load

func (m *GHAPerfCacheManager) Load(owner, repo string) (*GHAPerfCache, error)

func (*GHAPerfCacheManager) MergeRuns

func (m *GHAPerfCacheManager) MergeRuns(existing, newRuns []github.RunTiming) []github.RunTiming

func (*GHAPerfCacheManager) Save

func (m *GHAPerfCacheManager) Save(owner, repo string, cache *GHAPerfCache) error

func (*GHAPerfCacheManager) Stats

func (m *GHAPerfCacheManager) Stats(owner, repo string) (int, time.Time, error)

type MemoryManager

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

MemoryManager implements an in-memory cache (temporary, will use SQLite later).

func NewMemoryManager

func NewMemoryManager(ttl time.Duration) *MemoryManager

NewMemoryManager creates a new in-memory cache manager.

func (*MemoryManager) CleanExpired

func (m *MemoryManager) CleanExpired() error

CleanExpired removes all expired entries.

func (*MemoryManager) Clear

func (m *MemoryManager) Clear() error

Clear removes all entries from the cache.

func (*MemoryManager) Close

func (m *MemoryManager) Close() error

Close does nothing for memory cache but implements the interface.

func (*MemoryManager) Delete

func (m *MemoryManager) Delete(key string) error

Delete removes a value from the cache.

func (*MemoryManager) Get

func (m *MemoryManager) Get(key string, dest interface{}) (bool, error)

Get retrieves a value from the cache.

func (*MemoryManager) Set

func (m *MemoryManager) Set(key string, value interface{}) error

Set stores a value in the cache.

func (*MemoryManager) Stats

func (m *MemoryManager) Stats() (total, expired int, err error)

Stats returns cache statistics.

Jump to

Keyboard shortcuts

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