Documentation
¶
Overview ¶
Package presetgen generates a preset-library index and definition files from the repo's authored presets (presets/sqi/*.yaml) and publishes them into a library checkout. It is the publisher counterpart to internal/presetlib (the server-side client): both share presetlib.IndexEntry so the index format never drifts between what is written and what is read. Not compiled into the server or worker — it is a release-time tool (cmd/presetgen).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Publish ¶
Publish generates the preset index + definition files from presetsDir and writes them into outDir (a checkout of the library repo). The owned definitionDir subtree is wiped and rewritten so removed/renamed presets are cleaned; the merged index preserves any foreign entries. Only outDir/index.json and outDir/<definitionDir>/ are touched.
Types ¶
type Generated ¶
type Generated struct {
Entry presetlib.IndexEntry
Path string
Data []byte
}
Generated is one published preset: its index entry, the path it is written to under the library root (e.g. "sqi/blender-batch-render.yaml"), and the raw definition bytes served at that path.
func Build ¶
Build reads every *.yaml in presetsDir, validates it against the product schema (a malformed preset is a hard error), and returns one Generated per preset sorted by name. definitionDir is the path prefix under the library root used for the index's definition field and the published file location. The sha256 is computed over the raw file bytes so the served file always matches the fingerprint the index vouches for.
type Index ¶
type Index struct {
Presets []presetlib.IndexEntry `json:"presets"`
}
Index is the library index document. It mirrors presetlib's internal index shape ({"presets": [...]}) using the exported IndexEntry.