MCPcopy Create free account
hub / github.com/akalin/gopar / makeDecoderInputFileInfos

Function makeDecoderInputFileInfos

par2/decoder.go:55–77  ·  view source on GitHub ↗
(fileIDs []fileID, fileDescriptionPackets map[fileID]fileDescriptionPacket, ifscPackets map[fileID]ifscPacket)

Source from the content-addressed store, hash-verified

53}
54
55func 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
79type shardLocation struct {
80 fileID fileID

Callers 1

newDecoderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected