index

package
v0.4.10-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 26, 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

	PathnameToObject map[uint32]uint32

	Objects map[uint32][]uint32

	Chunks map[uint32]uint32
	// contains filtered or unexported fields
}

func NewIndex

func NewIndex() *Index

func NewIndexFromBytes

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

func (*Index) AddChunk

func (index *Index) AddChunk(chunk *objects.Chunk) uint32

Public

func (*Index) AddObject

func (index *Index) AddObject(object *objects.Object) uint32

func (*Index) ChecksumToId

func (index *Index) ChecksumToId(checksum [32]byte) (uint32, bool)

func (*Index) ChunkExists

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

func (*Index) GetObject

func (index *Index) GetObject(checksum [32]byte) *objects.Object

func (*Index) IdToChecksum

func (index *Index) IdToChecksum(checksumID uint32) ([32]byte, bool)

func (*Index) LinkPathnameToObject

func (index *Index) LinkPathnameToObject(pathnameChecksum [32]byte, object *objects.Object)

func (*Index) ListChunks

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

func (*Index) ListObjects

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

func (*Index) LookupChunk

func (index *Index) LookupChunk(checksum [32]byte) *objects.Chunk

func (*Index) LookupObject

func (index *Index) LookupObject(checksum [32]byte) *objects.Object

func (*Index) LookupObjectForPathnameChecksum

func (index *Index) LookupObjectForPathnameChecksum(pathnameChecksum [32]byte) *objects.Object

func (*Index) ObjectExists

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

func (*Index) Serialize

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

Jump to

Keyboard shortcuts

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