Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDelete should be returned by an UpdaterFn when the file should be deleted. ErrDelete = errors.New("delete") )
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a tar index that can be used to read files from a tar.
func (*Index) Reader ¶
func (i *Index) Reader() *io.SectionReader
Reader returns an io.ReaderAt that can be used to read the entire tar.
func (*Index) Replace ¶ added in v0.2.0
func (i *Index) Replace(name string, rdr ReaderAtSized) error
Replace replaces the file with the passed in name with the passed in ReaderAtSized. If the passed in ReaderAtSized is nil, the file will be deleted. If the file does not exist, it will be added.
This function does not update the actual tar file, it only updates the index.
type ReaderAtSized ¶
ReaderAtSized is an io.ReaderAt that also implements a Size method.
type UpdaterFn ¶
type UpdaterFn func(string, ReaderAtSized) (ReaderAtSized, bool, error)
UpdaterFn is a function that is passed the name of the file and a ReaderAtSized
Click to show internal directories.
Click to hide internal directories.