wasify-go
wasify-go copied to clipboard
Add optional attributes [key:value] pair
Add optional Attributes field for ModuleConfig
type ModuleConfig struct {
...
Attributes map[string]string
....
}
These attributes will be accessible within the module with the help of Module Development Kit mdk
.
val := mdk.Attr("key") // val or nil
// Or mdk.GetAttr("key") ?
optionally, good to have built-in converters:
val := mdk.Attr("name").String()
val := mdk.Attr("age").Int()
...