Welvet examples
46. stub/serialization
Part: VIII Β· Stubs
Package: github.com/openfluke/welvet/stub/serialization
Status: partial β π§
When
Scaffold / experimental stub stub/serialization (may be partial).
Where
import "github.com/openfluke/welvet/stub/serialization"
cd 46-stub-serialization && source ../env.sh && go run .
Why
Volumetric grids need JSON/ENTITY persist beyond transformer packs.
What
SerializeEntity/LoadEntity, SerializeGrid/GridFromSpec β native FormatNone bytes; packed via wire.
Sample output (captured)
101 <nil>
Live capture from go run ./cmd/runall on local ../../welvet (exit 0).
Source
Copied from the Welvet feature book examples (openfluke.github.io/welvet/examples/46-stub-serialization).
main.go
Download source βpackage main
import (
"fmt"
"github.com/openfluke/welvet/architecture"
"github.com/openfluke/welvet/stub/serialization"
)
func main() {
g := architecture.NewGrid(1, 1, 1, 1)
raw, err := serialization.SerializeGrid(g)
fmt.Println(len(raw), err)
}