repository
0.0.0-20161115182923-dc22212c11ae
Repository: https://github.com/sturfeeinc/gltf.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
glTF
Struct for marshaling and unmarshaling glTF
go get github.com/sturfeeinc/glTF/model
It's autogenerated code from official work group's specs. Don't edit it. Edit the generator
Libraries
-
easyjson for the fastest serialization.
-
validator.v9 for validation (via tags)
Validation
There are not auto validation. You can use validator.v9 explicitly before json.Marshal.
package main
import (
"encoding/json"
"github.com/sturfeeinc/glTF/model"
"gopkg.in/go-playground/validator.v9"
)
func main() {
validate := validator.New()
gltf := glTF{}
// ...
err := validate.Struct(gltf)
if err != nil {
// handling
}
res, err := json.Marshal(gltf)
println(res)
}
I thought about realization of strict validation in MarshalJSON and UnmarshalJSON for every struct. But for now it will to much complex.
Authors
- Petr Lozhkin [email protected]