| "github.com/mitchellh/mapstructure" |
| //The default generic openstack api |
| var OpenstackApi = map[string]interface{}{ |
| // Api for use with rackspace |
| var RackspaceApi = map[string]interface{}{ |
| "Name": "cloudServersOpenStack", |
| //Populates an ApiCriteria struct with the api values |
| //from one of the api maps |
| func PopulateApi(variant string) (ApiCriteria, error) { |
| var variantMap map[string]interface{} |
| variantMap = OpenstackApi |
| variantMap = OpenstackApi |
| variantMap = RackspaceApi |
| err := mapstructure.Decode(variantMap, &Api) |