func NewKeyData(t string, value interface{}) (*KeyData, error) { m, err := json.Marshal(value) if err != nil { return nil, err } return &KeyData{t, utils.RawMessage(m)}, nil }
func NewKeyPermission(t string, value interface{}) (*KeyPermission, error) { m, err := json.Marshal(value) if err != nil { return nil, err } raw := utils.RawMessage(m) return &KeyPermission{t, &raw}, nil }