// helper function to get release information about dataset func datasetParent(dataset string, ch chan Record) { api := "datasetparents" records, dbsinst := dbsInfo(dataset, api, "") for _, rec := range records { if rec != nil { dataset := rec["parent_dataset"].(string) rec["parent"] = utils.Hash2(dbsinst, dataset) ch <- rec return } } rec := make(Record) ch <- rec // we must send at least empty record }
// helper function to get release information about dataset func datasetSummary(dataset string, ch chan Record) { api := "filesummaries" records, dbsinst := dbsInfo(dataset, api, "") dbsRec := dbsInstances() dbsId, ok := dbsRec[dbsinst] if !ok { dbsId = -1 } for _, rec := range records { if rec != nil { rec["dataset"] = utils.Hash2(dbsinst, dataset) primds, procds, tier := datasetParts(dataset) rec["primds"] = primds rec["procds"] = procds rec["tier"] = tier rec["dbsinst"] = dbsId ch <- rec return } } rec := make(Record) ch <- rec // we must send at least empty record }