// Assuming a group metadata structure as follows
type GroupMetadata struct {
Roles map[string][]string `json:"roles"`
}
metadata := &GroupMetadata {
Roles: map[string][]string{
"000d8152-3258-457b-905b-05a9223c5c8c": { "bouncer" },
"2c0c8e80-fcbc-4b61-901a-dace129f45f5": { "bouncer", "vip" },
},
}
which shows that we can define a struct for a group metadata and then use it. But the sample doesn’t show how to write this struct to a group’s metadata. The problem is that the nk.GroupUpdate and nk.GroupCreate methods require map[string]interface{} parameter. So is the sample correct and if it is how can I write a custom struct to a group’s metadata?