blocks

package
v0.4.5-pre1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

package blocks contains the lowest level of IPFS data structures, the raw block with a checksum.

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongHash = errors.New("data did not match given hash!")

Functions

This section is empty.

Types

type BasicBlock added in v0.4.3

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

Block is a singular block of data in ipfs

func NewBlock

func NewBlock(data []byte) *BasicBlock

NewBlock creates a Block object from opaque data. It will hash the data.

func NewBlockWithCid added in v0.4.5

func NewBlockWithCid(data []byte, c *cid.Cid) (*BasicBlock, error)

NewBlockWithHash creates a new block when the hash of the data is already known, this is used to save time in situations where we are able to be confident that the data is correct

func (*BasicBlock) Cid added in v0.4.5

func (b *BasicBlock) Cid() *cid.Cid

func (*BasicBlock) Loggable added in v0.4.3

func (b *BasicBlock) Loggable() map[string]interface{}

func (*BasicBlock) Multihash added in v0.4.3

func (b *BasicBlock) Multihash() mh.Multihash

func (*BasicBlock) RawData added in v0.4.5

func (b *BasicBlock) RawData() []byte

func (*BasicBlock) String added in v0.4.3

func (b *BasicBlock) String() string

type Block

type Block interface {
	RawData() []byte
	Cid() *cid.Cid
	String() string
	Loggable() map[string]interface{}
}

Directories

Path Synopsis
package blockstore implements a thin wrapper over a datastore, giving a clean interface for Getting and Putting block objects.
package blockstore implements a thin wrapper over a datastore, giving a clean interface for Getting and Putting block objects.
package bloom implements a simple bloom filter.
package bloom implements a simple bloom filter.
package set contains various different types of 'BlockSet's
package set contains various different types of 'BlockSet's

Jump to

Keyboard shortcuts

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