Documentation
¶
Overview ¶
Package agentpackages caches scriptling package zips (knot.zip, libs.zip) for the in-space agent service API. The agent never builds zips — it fetches them from the knot server and serves the cached bytes to in-space scriptling processes. libs.zip is invalidated when the server notifies a library change; knot.zip is invalidated whenever the agent establishes a new server session (a server restart produces a fresh package).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the cached package bytes, fetching them via the supplied function on a cache miss. The fetch is performed at most once per wait group; concurrent callers share the result.
func Init ¶
func Init(dir string)
Init sets the cache directory (e.g. ~/.knot/cache) and clears it — both the in-memory entries and any files a previous agent run left behind — so every agent start serves the latest packages fetched fresh from the server.
func Invalidate ¶
func Invalidate(name string)
Invalidate drops the cached package with the given name (e.g. "libs.zip").
Types ¶
This section is empty.