assets

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package assets resolves the repository-relative files the engine reads. A file present in the workspace root wins, so a run inside an api-platform checkout reads the live source. Otherwise the embedded copy shipped with the framework module is used, which lets a project that imports the module run without an api-platform checkout.

Index

Constants

This section is empty.

Variables

View Source
var SnapshotSources = []string{
	"gateway/configs/config.toml",
	"gateway/configs/llm-pricing/model_prices.json",
	"gateway/gateway-controller/pkg/storage/gateway-controller-db.postgres.sql",
	"gateway/gateway-controller/pkg/storage/gateway-controller-db.sqlserver.sql",
}

SnapshotSources lists the repository files and directories outside the framework module that the engine reads and that the module therefore carries a copy of. Each is mirrored under snapshots/ at its repository-relative path.

Functions

func Resolve

func Resolve(workspaceRoot, rel string) string

Resolve maps a repository-relative path to a path on disk. A file or directory that exists beneath workspaceRoot is used as is. Otherwise the framework's embedded copy is extracted once and its path returned. A path that is empty, absolute or unknown is returned unchanged, or beneath workspaceRoot, so the caller's own error names the file.

func SyncSnapshots

func SyncSnapshots(repoRoot, moduleRoot string, write bool) ([]string, error)

SyncSnapshots compares each snapshot source in repoRoot with its copy under moduleRoot/snapshots and returns the repository-relative files that differ or are missing. When write is true it copies the sources over the snapshots. A snapshot file whose source no longer exists is reported as well and removed when write is true.

func Within

func Within(p string) bool

Within reports whether p lies inside the directory the embedded tree was extracted to. It is false until the first extraction.

Types

This section is empty.

Jump to

Keyboard shortcuts

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