You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than having only mtree.NewTarStreamer() with returning an io.Reader.
This currently requires either a goroutine, or a struct that keeps track of position and a buffered reader. (I opted for the goroutine)
Potentially we could have an internal model of collecting the mtree entries from tar headers. Something like:
fh, _:=os.Open("file.tar")
//...dh:= mtree.DirectoryHierarchy{}
entryRdr:=mtree.TarEntryReader(fh)
for {
e, err:=entryRdr.Next()
iferr!=nil {
break
}
dh.Entries=append(dh.Entries, e)
}
Then the current signature could just wrap this in a goroutine:
Rather than having only
mtree.NewTarStreamer()
with returning anio.Reader
.This currently requires either a goroutine, or a struct that keeps track of position and a buffered reader. (I opted for the goroutine)
Potentially we could have an internal model of collecting the mtree entries from tar headers. Something like:
Then the current signature could just wrap this in a goroutine:
And then we could more easily expose a non-goroutine, but more blocking, signature like:
The text was updated successfully, but these errors were encountered: