tarpatch

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tarpatch provides functionality for applying binary patches to tar archives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(delta io.Reader, dataSource DataSource, dst io.Writer) error

Apply applies a binary patch from a delta reader to produce output using the data source.

Types

type DataSource

type DataSource interface {
	io.ReadSeeker
	io.Closer
	SetCurrentFile(file string) error
}

DataSource provides an interface for reading data during patch application.

type FilesystemDataSource

type FilesystemDataSource struct {
	// contains filtered or unexported fields
}

FilesystemDataSource implements DataSource by reading from filesystem files.

func NewFilesystemDataSource

func NewFilesystemDataSource(basePath string) *FilesystemDataSource

NewFilesystemDataSource creates a new FilesystemDataSource with the specified base path.

func (*FilesystemDataSource) Close

func (f *FilesystemDataSource) Close() error

Close closes the current file if one is open.

func (*FilesystemDataSource) Read

func (f *FilesystemDataSource) Read(data []byte) (n int, err error)

func (*FilesystemDataSource) Seek

func (f *FilesystemDataSource) Seek(offset int64, whence int) (int64, error)

Seek changes the read position in the current file.

func (*FilesystemDataSource) SetCurrentFile

func (f *FilesystemDataSource) SetCurrentFile(file string) error

SetCurrentFile opens the specified file for reading.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL