Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Key ¶
func Key(rc resource.ResourceConfig) string
Key computes a cache key from a ResourceConfig by hashing only the Kind and sanitized Spec (via ReportConfig). This instantiates the resource plugin internally; on a cache miss the caller will instantiate it again for execution. Returns empty string when hashing fails; callers treat that as a cache miss.
Types ¶
type SourceCache ¶
type SourceCache struct {
// contains filtered or unexported fields
}
SourceCache is a thread-safe in-memory cache for source execution results, keyed by SHA256 of the sanitized resource configuration. The cache lives for the duration of one updatecli execution and is shared across all pipelines, allowing identical sources to be executed only once.
NOTE: today pipelines run sequentially and DAG nodes are serialized by a mutex, so concurrent cache misses for the same key cannot happen. If pipeline execution is ever parallelized, consider adding a singleflight.Group to coalesce concurrent lookups for the same key.
func NewSourceCache ¶
func NewSourceCache() *SourceCache
NewSourceCache creates a new empty source cache.
func (*SourceCache) Get ¶
func (c *SourceCache) Get(key string) (SourceEntry, bool)
Get retrieves a cached source entry. Returns the entry and true if found.
func (*SourceCache) Len ¶
func (c *SourceCache) Len() int
Len returns the number of entries currently held in the cache.
func (*SourceCache) Set ¶
func (c *SourceCache) Set(key string, entry SourceEntry)
Set stores a source entry in the cache.
type SourceEntry ¶
type SourceEntry struct {
Information string // Raw value returned by the plugin, before transformers
Description string
Result string // SUCCESS / FAILURE / etc.
}
SourceEntry stores the cached result of a source execution. Transformers are not included — they are re-applied on cache hit so that sources sharing the same underlying resource config but different transformer chains each get the correctly transformed output.