Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// Template of the cache entry.
Template string
// The registry to use which defaults to "~".
Registry string
// ID of the cache entry to save.
ID string
// Key of the cache entry to save, this can be a template string.
Key string
// Fallback keys to use, this is a comma delimited list of key template strings.
FallbackKeys []string
// Paths to remove.
Paths []string
}
func ExpandCacheConfiguration ¶
Takes a list of cache configurations and expands them into a list of cache of resolved Cache objects. This does the following:
* Expands cache.Template with the template values from template.json
* Expands cache.Key using templatable arguments (such as id, agent.os, agent.arch, env, checksum etc)
* Expands cache.FallbackKeys using templatable arguments (such as id, agent.os, agent.arch, env, checksum etc)
* Expands cache.Paths using templatable arguments (such as id, agent.os, agent.arch, env, checksum etc)
Uses the OS environment variables for template expansion.
func ExpandCacheConfigurationWithEnv ¶
ExpandCacheConfigurationWithEnv expands cache configurations using a provided environment map instead of reading from the OS environment. This is useful for library usage where the environment is controlled programmatically.
Parameters:
- caches: List of cache configurations to expand
- env: Map of environment variables to use for template expansion
Returns the expanded cache configurations or an error if expansion fails.