diskstore

package
v0.0.0-...-6ce3ea9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownAlgo     = errors.New("Unknown hash algorithm")
	ErrBadDigestLength = errors.New("Incorrect digest length")
	ErrCorruptedBlob   = errors.New("Loaded blob did not match expected digest")
	ErrNoRoot          = errors.New("No root object")
)

Functions

This section is empty.

Types

type DiskStore

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

func Create

func Create(path string) (*DiskStore, error)

func Open

func Open(path string) (*DiskStore, error)

func (*DiskStore) Checkpoint

func (s *DiskStore) Checkpoint() error

func (*DiskStore) Close

func (s *DiskStore) Close() error

func (*DiskStore) GetRoot

func (s *DiskStore) GetRoot() (Ref, error)

func (*DiskStore) Put

func (s *DiskStore) Put(data []byte) (Ref, error)

func (*DiskStore) ResolveHash

func (s *DiskStore) ResolveHash(h Hash) (Ref, error)

func (*DiskStore) SetRoot

func (s *DiskStore) SetRoot(r Ref) error

type Hash

type Hash [sha256.Size]byte

func ContentIdHash

func ContentIdHash(cid protocol.ContentId) (hash Hash, err error)

func (Hash) ToContentId

func (h Hash) ToContentId(cid protocol.ContentId)

type Ref

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

func (Ref) Get

func (r Ref) Get() ([]byte, error)

func (Ref) Hash

func (r Ref) Hash() Hash

Directories

Path Synopsis
package triemap implements an on-disk trie, where keys are byte slices which must all have the same length, and values are addresses.
package triemap implements an on-disk trie, where keys are byte slices which must all have the same length, and values are addresses.

Jump to

Keyboard shortcuts

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