index

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2016 License: MIT Imports: 5 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 map[core.Hash]int64

Index is a database of objects and their offset in a packfile. Objects are identified by their hash.

func NewFromIdx

func NewFromIdx(r io.Reader) (Index, error)

NewFromIdx returns a new index from an idx file reader.

func NewFromPackfile

func NewFromPackfile(rs io.ReadSeeker) (Index, error)

NewFrompackfile returns a new index from a packfile reader.

func (Index) Get

func (i Index) Get(h core.Hash) (int64, error)

Get returns the offset that an object has the packfile.

func (Index) Set

func (i Index) Set(h core.Hash, o int64) error

Set adds a new hash-offset pair to the index, or substitutes an existing one.

Jump to

Keyboard shortcuts

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