inventories

package
v0.0.0-...-34de315 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExist    = errors.New("inventory already exists")
	ErrNotExist = errors.New("inventory does not exist")
)

Errors exported by the package.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo is a simple implementation of the inventory store.

func NewRepo

func NewRepo() *Repo

NewRepo creates a new store for block inventories.

func (*Repo) Add

func (repo *Repo) Add(inv *types.Inventory) error

Add stores a new inventory.

func (*Repo) Get

func (repo *Repo) Get(hash types.Hash) (*types.Inventory, error)

Get retrieves the inventory with the given block hash.

func (*Repo) Has

func (repo *Repo) Has(hash types.Hash) bool

Has checks if a given inventory is known.

Jump to

Keyboard shortcuts

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