diff options
author | anon5 <anon5clam@protonmail.com> | 2021-06-21 18:47:26 +0000 |
---|---|---|
committer | anon5 <anon5clam@protonmail.com> | 2021-06-21 18:47:26 +0000 |
commit | 425da65ed46061303604610bb539d6495b2b1f3f (patch) | |
tree | 10ae3e665132c369ce0207676321cef870679923 /nodemeta.go | |
parent | 9f239d341ef46b656dda759020da87bdd0606344 (diff) |
Add high-level protocol (de)serialization
Diffstat (limited to 'nodemeta.go')
-rw-r--r-- | nodemeta.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/nodemeta.go b/nodemeta.go new file mode 100644 index 0000000..b91abbf --- /dev/null +++ b/nodemeta.go @@ -0,0 +1,27 @@ +package mt + +type NodeMeta struct { + //mt:len32 + Fields []NodeMetaField + + Inv Inv +} + +type NodeMetaField struct { + Field + Private bool +} + +func (nm *NodeMeta) Field(name string) *NodeMetaField { + if nm == nil { + return nil + } + + for i, f := range nm.Fields { + if f.Name == name { + return &nm.Fields[i] + } + } + + return nil +} |