(name string, numBlocks int, seq int)
| 1278 | } |
| 1279 | |
| 1280 | func genFile(name string, numBlocks int, seq int) protocol.FileInfo { |
| 1281 | ts := timeutil.StrictlyMonotonicNanos() |
| 1282 | s := ts / 1e9 |
| 1283 | ns := int32(ts % 1e9) |
| 1284 | return protocol.FileInfo{ |
| 1285 | Name: name, |
| 1286 | Size: int64(numBlocks) * blockSize, |
| 1287 | ModifiedS: s, |
| 1288 | ModifiedBy: 1, |
| 1289 | Version: protocol.Vector{}.Update(1), |
| 1290 | Sequence: int64(seq), |
| 1291 | Blocks: genBlocks(name, 0, numBlocks), |
| 1292 | Permissions: 0o644, |
| 1293 | ModifiedNs: ns, |
| 1294 | RawBlockSize: blockSize, |
| 1295 | } |
| 1296 | } |
| 1297 | |
| 1298 | func genBlocks(name string, seed, count int) []protocol.BlockInfo { |
| 1299 | b := make([]protocol.BlockInfo, count) |
no test coverage detected