agentpackages

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

func Get(name string, fetch func() ([]byte, error)) ([]byte, error)

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.

Jump to

Keyboard shortcuts

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