Documentation
¶
Overview ¶
Package cache provides build caching for Ludus pipeline stages. Each stage computes a hash key from its inputs (git state, config values, file metadata). If the key matches a cached entry, the stage is skipped. Cache entries are stored in .ludus/cache.json.
Index ¶
- func CheckSkip(stage StageKey, hash, projectName string, noCache bool) bool
- func ContainerKey(cfg *config.Config, serverBuildDir string) string
- func EngineKey(cfg *config.Config) string
- func GameClientKey(cfg *config.Config, engineHash string, platform string) string
- func GameServerKey(cfg *config.Config, engineHash string) string
- func RecordBuild(stage StageKey, hash string, dryRun bool)
- func Save(c *Cache) error
- type Cache
- type Entry
- type StageKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSkip ¶
CheckSkip loads the cache and returns true (with a skip message printed) if the stage is up to date. When noCache is true the check is bypassed. Returns false when the build should proceed.
func ContainerKey ¶
ContainerKey computes the cache key for the container build stage. It hashes a manifest of filenames and sizes in the server build directory.
func GameClientKey ¶
GameClientKey computes the cache key for the game client build stage.
func GameServerKey ¶
GameServerKey computes the cache key for the game server build stage.
func RecordBuild ¶
RecordBuild updates the cache entry for a stage on success. A dry-run is side-effect free: it returns without recording an entry, so a subsequent real build is not skipped as "up to date (cached)".
Types ¶
type Cache ¶
Cache holds all stage cache entries.
func (*Cache) MissReason ¶
MissReason explains why a cache check missed for a stage. Returns empty string if the cache is a hit (i.e., the stage is up to date).