blocks

package
v0.0.0-...-2963f48 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2015 License: MIT Imports: 4 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

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Multihash mh.Multihash
	Data      []byte
}

Block is a singular block of data in ipfs

func NewBlock

func NewBlock(data []byte) *Block

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

func NewBlockWithHash

func NewBlockWithHash(data []byte, h mh.Multihash) (*Block, 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 (*Block) Key

func (b *Block) Key() u.Key

Key returns the block's Multihash as a Key value.

func (*Block) String

func (b *Block) String() string

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