github.com/cloudbase/juju-core@v0.0.0-20140504232958-a7271ac7912f/environs/simplestreams/export_test.go (about) 1 // Copyright 2013 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package simplestreams 5 6 func ExtractCatalogsForProducts(metadata CloudMetadata, productIds []string) []MetadataCatalog { 7 return metadata.extractCatalogsForProducts(productIds) 8 } 9 10 func ExtractIndexes(ind Indices) IndexMetadataSlice { 11 return ind.extractIndexes() 12 } 13 14 func HasCloud(metadata IndexMetadata, cloud CloudSpec) bool { 15 return metadata.hasCloud(cloud) 16 } 17 18 func HasProduct(metadata IndexMetadata, prodIds []string) bool { 19 return metadata.hasProduct(prodIds) 20 } 21 22 func Filter(entries IndexMetadataSlice, match func(*IndexMetadata) bool) IndexMetadataSlice { 23 return entries.filter(match) 24 } 25 26 func SetSeriesVersions(value map[string]string) func() { 27 origVersions := seriesVersions 28 origUpdated := updatedseriesVersions 29 seriesVersions = value 30 updatedseriesVersions = false 31 return func() { 32 seriesVersions = origVersions 33 updatedseriesVersions = origUpdated 34 } 35 }