genie

package
v0.0.0-...-189a019 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockOrigin

type BlockOrigin struct {
	FileIndex int64
	Offset    int64
	Size      int64
}

func (*BlockOrigin) GetSize

func (bo *BlockOrigin) GetSize() int64

type Composition

type Composition struct {
	FileIndex  int64
	BlockIndex int64
	Origins    []Origin
	Size       int64
}

func (*Composition) Append

func (comp *Composition) Append(origin Origin)

func (*Composition) String

func (comp *Composition) String() string

type CompositionListener

type CompositionListener func(comp *Composition)

type FreshOrigin

type FreshOrigin struct {
	Size int64
}

func (*FreshOrigin) GetSize

func (fo *FreshOrigin) GetSize() int64

type Genie

type Genie struct {
	BlockSize int64

	PatchWire *wire.ReadContext

	TargetContainer *tlc.Container
	SourceContainer *tlc.Container
}

A Genie analyzes a patch to figure out which parts of the target container are used to build individual blocks of the source container.

func (*Genie) ParseContents

func (g *Genie) ParseContents(onComp CompositionListener) error

ParseContents sends a Composition for each block of the source container

func (*Genie) ParseHeader

func (g *Genie) ParseHeader(patchReader savior.SeekSource) error

ParseHeader is the first step of the genie's operation - it reads both containers, leaving the caller a chance to use them later, when parsing the contents

type Origin

type Origin interface {
	GetSize() int64
}

Jump to

Keyboard shortcuts

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