| 53 | } |
| 54 | |
| 55 | func makeDecoderInputFileInfos(fileIDs []fileID, fileDescriptionPackets map[fileID]fileDescriptionPacket, ifscPackets map[fileID]ifscPacket) ([]decoderInputFileInfo, error) { |
| 56 | var decoderInputFileInfos []decoderInputFileInfo |
| 57 | for _, fileID := range fileIDs { |
| 58 | descriptionPacket, ok := fileDescriptionPackets[fileID] |
| 59 | if !ok { |
| 60 | return nil, errors.New("file description packet not found") |
| 61 | } |
| 62 | ifscPacket, ok := ifscPackets[fileID] |
| 63 | if !ok { |
| 64 | return nil, errors.New("input file slice checksum packet not found") |
| 65 | } |
| 66 | decoderInputFileInfos = append(decoderInputFileInfos, decoderInputFileInfo{ |
| 67 | fileID, |
| 68 | descriptionPacket.filename, |
| 69 | descriptionPacket.byteCount, |
| 70 | descriptionPacket.sixteenKHash, |
| 71 | descriptionPacket.hash, |
| 72 | ifscPacket.checksumPairs, |
| 73 | }) |
| 74 | } |
| 75 | |
| 76 | return decoderInputFileInfos, nil |
| 77 | } |
| 78 | |
| 79 | type shardLocation struct { |
| 80 | fileID fileID |