blocks

package
v0.4.3-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 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 BasicBlock

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 NewBlockWithHash

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

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

func (*BasicBlock) Key

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

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

func (*BasicBlock) Loggable

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

func (*BasicBlock) Multihash

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

func (*BasicBlock) String

func (b *BasicBlock) String() string

type Block

type Block interface {
	Multihash() mh.Multihash
	Data() []byte
	Key() key.Key
	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