Opsmaru.Incus.NativeConfig (opsmaru_incus v0.1.0)

Copy Markdown View Source

Explicit pinned ConfigMap/DevicesMap JSON and YAML coercion, separate from lossless models.

String, boolean, number and null config values become native strings. JSON numbers use the official decoder's float64 semantics, including integer precision loss. YAML decoding is delegated to Opsmaru.Incus.NativeYaml, a deliberately small strict-subset decoder that matches the native go-yaml v4 result on every accepted input and reports {:error, :invalid_native_config} for everything outside the subset (explicit tags, directives, extra documents, sequences outside merge lists, nesting deeper than four levels, non-string keys, timestamps, ...). Decoding into an existing map merges keys; a null document resets the target while an absent document leaves it untouched. Device updates merge individual properties. Inputs and results are bounded to 1 MiB. No backend, filesystem state or global configuration is involved.

Summary

Functions

from_json(type, json, existing \\ nil)

from_yaml(type, yaml, existing \\ nil)