index

package
v0.4.16-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	Checksums map[[32]byte]uint32

	Chunks map[uint32]Subpart

	Objects map[uint32]Subpart

	Contains map[uint32]struct{}
	// contains filtered or unexported fields
}

func New

func New() *Index

func NewFromBytes

func NewFromBytes(serialized []byte) (*Index, error)

func (*Index) ChunkExists

func (index *Index) ChunkExists(chunkChecksum [32]byte) bool

func (*Index) GetPackfileForChunk

func (index *Index) GetPackfileForChunk(chunkChecksum [32]byte) ([32]byte, bool)

func (*Index) GetPackfileForObject

func (index *Index) GetPackfileForObject(objectChecksum [32]byte) ([32]byte, bool)

func (*Index) GetSubpartForChunk

func (index *Index) GetSubpartForChunk(chunkChecksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*Index) GetSubpartForObject

func (index *Index) GetSubpartForObject(objectChecksum [32]byte) ([32]byte, uint32, uint32, bool)

func (*Index) IsDirty

func (index *Index) IsDirty() bool

func (*Index) ListContains

func (index *Index) ListContains() [][32]byte

func (*Index) LookupChecksum

func (index *Index) LookupChecksum(checksumID uint32) [32]byte

func (*Index) Merge

func (index *Index) Merge(indexID [32]byte, deltaIndex *Index)

func (*Index) ObjectExists

func (index *Index) ObjectExists(objectChecksum [32]byte) bool

func (*Index) ResetDirty

func (index *Index) ResetDirty()

func (*Index) Serialize

func (index *Index) Serialize() ([]byte, error)

func (*Index) SetPackfileForChunk

func (index *Index) SetPackfileForChunk(packfileChecksum [32]byte, chunkChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

func (*Index) SetPackfileForObject

func (index *Index) SetPackfileForObject(packfileChecksum [32]byte, objectChecksum [32]byte, packfileOffset uint32, chunkLength uint32)

type Subpart

type Subpart struct {
	PackfileID uint32
	Offset     uint32
	Length     uint32
}

Jump to

Keyboard shortcuts

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