(key string, iMap map[string]interface{}, v *InterfaceValidation)
| 41 | } |
| 42 | |
| 43 | func InterfaceFromInterfaceMap(key string, iMap map[string]interface{}, v *InterfaceValidation) (interface{}, error) { |
| 44 | inter, ok := ReadInterfaceMapValue(key, iMap) |
| 45 | if !ok { |
| 46 | val, err := ValidateInterfaceMissing(v) |
| 47 | if err != nil { |
| 48 | return nil, errors.Wrap(err, key) |
| 49 | } |
| 50 | return val, nil |
| 51 | } |
| 52 | val, err := ValidateInterfaceProvided(inter, v) |
| 53 | if err != nil { |
| 54 | return nil, errors.Wrap(err, key) |
| 55 | } |
| 56 | return val, nil |
| 57 | } |
| 58 | |
| 59 | func ValidateInterfaceMissing(v *InterfaceValidation) (interface{}, error) { |
| 60 | if v.Required { |
no test coverage detected