caching

package
v0.0.0-...-b945540 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 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.
	ByBlameQuery = `` /* 533-byte string literal not displayed */

	// This query returns all traces for the given corpus which do not have any corresponding ignore rule.
	UnignoredQuery = `` /* 141-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func ByBlameKey

func ByBlameKey(corpus string) string

func NewCacheDataProvider

func NewCacheDataProvider(db *pgxpool.Pool, corpora []string, commitWindow int, sqlQuery string, cacheKeyFunc func(string) string) cacheDataProvider

NewCacheDataProvider returns a new instance of the cacheDataProvider struct.

func UnignoredKey

func UnignoredKey(corpus string) string

Types

type SearchCacheData

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

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

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, firstCommitId string, corpus string) ([]SearchCacheData, error)

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

func (SearchCacheManager) GetUnignoredTracesData

func (s SearchCacheManager) GetUnignoredTracesData(ctx context.Context, firstCommitId string, corpus string) ([]SearchCacheData, error)

GetUnignoredTracesData returns the unignored traces 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
	// Unignored_Corpus denotes the cache type for traces without ignore rules.
	Unignored_Corpus
)

Jump to

Keyboard shortcuts

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