index

package
v0.2.16-alpha Latest Latest
Warning

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

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

	Pathnames map[uint32]uint64

	ContentTypes map[string]uint32

	PathnameToObject  map[uint64]uint32
	ObjectToPathnames map[uint32][]uint64

	Objects             map[uint32][]uint32
	ObjectToContentType map[uint32]uint32

	Chunks         map[uint32]uint32
	ChunkToObjects map[uint32][]uint32

	ContentTypeToObjects 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)

Public

func (*Index) AddObject

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

func (*Index) ChecksumToId

func (index *Index) ChecksumToId(checksum [32]byte) (uint32, 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(pathnameID uint64, object *objects.Object)

func (*Index) ListChunks

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

func (*Index) ListContentTypes

func (index *Index) ListContentTypes() []string

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) LookupObjectForPathname

func (index *Index) LookupObjectForPathname(pathnameID uint64) *objects.Object

func (*Index) LookupObjectForPathnameHash

func (index *Index) LookupObjectForPathnameHash(pathnameHash [32]byte) *objects.Object

func (*Index) LookupObjectsForContentType

func (index *Index) LookupObjectsForContentType(contentType string) [][32]byte

func (*Index) RecordPathnameChecksum

func (index *Index) RecordPathnameChecksum(pathnameChecksum [32]byte, pathnameID uint64)

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