lxd/db/profiles.mapper.go
func (c *ClusterTx) ProfileURIs(filter ProfileFilter) ([]string, error) {
	// Check which filter criteria are active.
	criteria := map[string]interface{}{}
	if filter.Project != "" {
		criteria["Project"] = filter.Project
	}
	if filter.Name != "" {
		criteria["Name"] = filter.Name
	}

	// Pick the prepared statement and arguments to use based on active criteria.
	var stmt *sql.Stmt
	var args []interface{}

	if criteria["Project"] != nil && criteria["Name"] != nil {
		stmt = c.stmt(profileNamesByProjectAndName)
		args = []interface{}{
			filter.Project,
			filter.Name,
		}
	} else if criteria["Project"] != nil {
		stmt = c.stmt(profileNamesByProject)
		args = []interface{}{
			filter.Project,
		}
	} else {
		stmt = c.stmt(profileNames)
		args = []interface{}{}
	}

	code := cluster.EntityTypes["profile"]
	formatter := cluster.EntityFormatURIs[code]

	return query.SelectURIs(stmt, formatter, args...)
}
func (c *ClusterTx) ProfileURIs(filter ProfileFilter) ([]string, error) {
	// Check which filter criteria are active.
	criteria := map[string]interface{}{}
	if filter.Project != "" {
		criteria["Project"] = filter.Project
	}
	if filter.Name != "" {
		criteria["Name"] = filter.Name
	}

	// Pick the prepared statement and arguments to use based on active criteria.
	var stmt *sql.Stmt
	var args []interface{}

	if criteria["Project"] != nil && criteria["Name"] != nil {
		stmt = c.stmt(profileNamesByProjectAndName)
		args = []interface{}{
			filter.Project,
			filter.Name,
		}
	} else if criteria["Project"] != nil {
		stmt = c.stmt(profileNamesByProject)
		args = []interface{}{
			filter.Project,
		}
	} else {
		stmt = c.stmt(profileNames)
		args = []interface{}{}
	}

	code := cluster.EntityTypes["profile"]
	formatter := cluster.EntityFormatURIs[code]

	return query.SelectURIs(stmt, formatter, args...)
}
func ( c * ClusterTx ) ProfileURIs ( filter ProfileFilter ) ( [ ] string , error ) { // Check which filter criteria are active. criteria := map [ string ] interface { } { } if filter . Project != " " { criteria [ " " ] = filter . Project } if filter . Name != " " { criteria [ " " ] = filter . Name } // Pick the prepared statement and arguments to use based on active criteria. var stmt * sql . Stmt var args [ ] interface { } if criteria [ " " ] != nil && criteria [ " " ] != nil { stmt = c . stmt ( profileNamesByProjectAndName ) args = [ ] interface { } { filter . Project , filter . Name , } } else if criteria [ " " ] != nil { stmt = c . stmt ( profileNamesByProject ) args = [ ] interface { } { filter . Project , } } else { stmt = c . stmt ( profileNames ) args = [ ] interface { } { } } code := cluster . EntityTypes [ " " ] formatter := cluster . EntityFormatURIs [ code ] return query . SelectURIs ( stmt , formatter , args ... ) }
// ProfileURIs returns all available profile URIs.
ProfileURIs returns all available profile URIs .