The store had no working tools: its TypeScript client was never built, and nothing could count what the store holds that no record names. A Go bundle lists the store's files through its own container, reads each manifest through its door, and sets that beside the controller's records. Collection is asked of the controller, which decides and records; the store's tools never delete. The image.pushed event was declared and never emitted, and nothing consumes it, so it goes.
32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
// The distribution module's Go bundle (novox/hq ADR 0251 §1–3, to-be 51): a process the node's runtime
|
||
// launches and speaks MCP over stdio to. It says what the artifact store holds — its repositories, its
|
||
// size, and what the controller's records say of each manifest — read from the store's own files
|
||
// through its own container and from its door, and writing to neither. A collection is asked of the
|
||
// controller, which decides and records what it lets go of (ADR 0189). stdout is the protocol; what
|
||
// this bundle says, it says on stderr.
|
||
package main
|
||
|
||
import (
|
||
"fmt"
|
||
"os"
|
||
|
||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||
)
|
||
|
||
func main() {
|
||
s := &Store{
|
||
URL: os.Getenv("MESH_STORE_URL"),
|
||
Container: os.Getenv("MESH_STORE_CONTAINER"),
|
||
Run: ExecRunner,
|
||
UID: os.Getuid(),
|
||
}
|
||
if s.URL == "" {
|
||
fmt.Fprintln(os.Stderr, "[store-tools] MESH_STORE_URL is not set: every manifest will be said as unread")
|
||
}
|
||
// An empty name serves as the module the runtime names (MESH_SERVED_MODULE): distribution.
|
||
if err := stdio.Serve("", Tools(s, Controller{Ask: stdio.Ask})); err != nil {
|
||
fmt.Fprintln(os.Stderr, err)
|
||
os.Exit(1)
|
||
}
|
||
}
|