yamlgraph: Refactor parsing for dynamic resource registration

Avoid use of the reflect package, and use an extensible list of registred
resource kinds. This also has the benefit of removing the empty VirtRes and
AugeasRes struct types when compiling without libvirt and libaugeas.
This commit is contained in:
Mildred Ki'Lya
2017-03-24 22:38:06 +01:00
parent 64dc47d7e9
commit 525a1e8140
17 changed files with 474 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ import (
)
func init() {
RegisterResource("virt", func() Res { return &VirtRes{} })
gob.Register(&VirtRes{})
}