blocks

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 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

This section is empty.

Functions

This section is empty.

Types

type Block

type Block interface {
	Multihash() mh.Multihash
	Data() []byte
	Key() key.Key
	String() string
	Loggable() map[string]interface{}
}

type RawBlock added in v0.4.2

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

Block is a singular block of data in ipfs

func NewBlock

func NewBlock(data []byte) *RawBlock

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

func NewBlockWithHash

func NewBlockWithHash(data []byte, h mh.Multihash) (*RawBlock, 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 (*RawBlock) Data added in v0.4.2

func (b *RawBlock) Data() []byte

func (*RawBlock) Key added in v0.4.2

func (b *RawBlock) Key() key.Key

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

func (*RawBlock) Loggable added in v0.4.2

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

func (*RawBlock) Multihash added in v0.4.2

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

func (*RawBlock) String added in v0.4.2

func (b *RawBlock) 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