MCPcopy
hub / github.com/git-lfs/git-lfs / Seek

Method Seek

tools/copycallback.go:51–62  ·  view source on GitHub ↗

Seek wraps the underlying Seeker's "Seek" method, updating the number of bytes that have been consumed by this reader.

(offset int64, whence int)

Source from the content-addressed store, hash-verified

49// Seek wraps the underlying Seeker's "Seek" method, updating the number of
50// bytes that have been consumed by this reader.
51func (r *BodyWithCallback) Seek(offset int64, whence int) (int64, error) {
52 switch whence {
53 case io.SeekStart:
54 r.readSize = offset
55 case io.SeekCurrent:
56 r.readSize += offset
57 case io.SeekEnd:
58 r.readSize = r.totalSize + offset
59 }
60
61 return r.ReadSeekCloser.Seek(offset, whence)
62}
63
64// ResetProgress calls the callback with a negative read size equal to the
65// total number of bytes read so far, effectively "resetting" the progress.

Callers 13

TestCloneFileFunction · 0.80
fillFileFunction · 0.80
SpoolFunction · 0.80
SaveMethod · 0.80
SmudgeToFileMethod · 0.80
callWithCountFunction · 0.80
setContentTypeForMethod · 0.80
DoTransferMethod · 0.80
downloadMethod · 0.80
DoTransferMethod · 0.80
traceRequestMethod · 0.80

Calls

no outgoing calls

Tested by 3

TestCloneFileFunction · 0.64
fillFileFunction · 0.64