MCPcopy Create free account
hub / github.com/cloudwan/gohan / getAllResourceGroupsFromSchemas

Function getAllResourceGroupsFromSchemas

cli/template.go:266–277  ·  view source on GitHub ↗
(schemas []*SchemaWithPolicy)

Source from the content-addressed store, hash-verified

264}
265
266func getAllResourceGroupsFromSchemas(schemas []*SchemaWithPolicy) []string {
267 resourcesSet := make(map[string]bool)
268 for _, schema := range schemas {
269 metadata, _ := schema.Schema.Metadata["resource_group"].(string)
270 resourcesSet[metadata] = true
271 }
272 resources := make([]string, 0, len(resourcesSet))
273 for resource := range resourcesSet {
274 resources = append(resources, resource)
275 }
276 return resources
277}
278
279func filerSchemasByResourceGroup(resource string, schemas []*SchemaWithPolicy) []*SchemaWithPolicy {
280 var filteredSchemas []*SchemaWithPolicy

Callers 2

template_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected