caching

package
v0.0.0-...-fcfcbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ByBlameQuery = `` /* 703-byte string literal not displayed */

)

This query collects untriaged image digests within the specified commit window for the given corpus where an ignore rule is not applied. This data is used when the user wants to see a list of untriaged digests for the specific corpus in the UI.

Variables

This section is empty.

Functions

func ByBlameKey

func ByBlameKey(corpus string) string

Types

type ByBlameData

type ByBlameData struct {
	TraceID    schema.TraceID     `json:"traceID"`
	GroupingID schema.GroupingID  `json:"groupingID"`
	Digest     schema.DigestBytes `json:"digest"`
}

ByBlameData provides a struct to hold data for the entry in by blame cache.

type ByBlameDataProvider

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

ByBlameDataProvider implements cacheDataProvider.

func NewByBlameDataProvider

func NewByBlameDataProvider(db *pgxpool.Pool, corpora []string, commitWindow int) ByBlameDataProvider

func (ByBlameDataProvider) GetCacheData

func (prov ByBlameDataProvider) GetCacheData(ctx context.Context) (map[string]string, error)

GetCacheData implements cacheDataProvider.

func (ByBlameDataProvider) GetDataForCorpus

func (prov ByBlameDataProvider) GetDataForCorpus(ctx context.Context, corpus string) ([]ByBlameData, error)

GetDataForCorpus returns the byblame data for the given corpus.

type SearchCacheManager

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

SearchCacheManager provides a struct to handle the cache operations for gold search.

func New

func New(cacheClient cache.Cache, db *pgxpool.Pool, corpora []string, commitWindow int) *SearchCacheManager

New returns a new instance of the SearchCacheManager.

func (SearchCacheManager) GetByBlameData

func (s SearchCacheManager) GetByBlameData(ctx context.Context, corpus string) ([]ByBlameData, error)

GetByBlameData returns the by blame data for the given corpus from cache.

func (SearchCacheManager) RunCachePopulation

func (s SearchCacheManager) RunCachePopulation(ctx context.Context) error

RunCachePopulation gets the cache data from the providers and stores it in the cache instance.

type SearchCacheType

type SearchCacheType int
const (
	// ByBlame_Corpus denotes the cache type for untriaged images by commits for a given corpus.
	ByBlame_Corpus SearchCacheType = iota
)

Jump to

Keyboard shortcuts

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