delta

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDeltaReport

func GenerateDeltaReport(delta *Delta)

func Run

func Run(signatureFileName string, updatedFileName string, deltaFileName string, chunkSize int)

Types

type Delta

type Delta struct {
	Inserted []*SingleDelta `json:"inserted,omitempty"`
	Deleted  []*SingleDelta `json:"deleted,omitempty"`
	Copied   []*SingleDelta `json:"copied,omitempty"`
}

func NewDelta

func NewDelta() *Delta

func UnmarshalJSON

func UnmarshalJSON(bytes []byte) (*Delta, error)

func (*Delta) MarshalJSON

func (d *Delta) MarshalJSON() ([]byte, error)

type DeltaProcessor

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

func NewDeltaProcessor

func NewDeltaProcessor(signature *signature.Signature, reader io.ReadSeeker, content bool) *DeltaProcessor

func (*DeltaProcessor) AppendDiff added in v0.0.3

func (dp *DeltaProcessor) AppendDiff(md5Hash [16]byte) bool

func (*DeltaProcessor) BuildDelta

func (dp *DeltaProcessor) BuildDelta() *Delta

func (*DeltaProcessor) Next

func (dp *DeltaProcessor) Next() error

func (*DeltaProcessor) Roll

func (dp *DeltaProcessor) Roll(checksums map[uint32][16]byte) error

func (*DeltaProcessor) SetRemainingBytes

func (dp *DeltaProcessor) SetRemainingBytes()

type Report

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

type SingleDelta

type SingleDelta struct {
	AdlerChecksum uint32    `json:"adler,omitempty"`
	MD5Checksum   *[16]byte `json:"-"`
	Start         int       `json:"start,omitempty"`
	End           int       `json:"end,omitempty"`
	DiffBytes     []byte    `json:"diff,omitempty"`
}

Jump to

Keyboard shortcuts

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