blockservice

package
v0.0.0-...-bebc87d Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockService

type BlockService struct {
	Datastore ds.Datastore
	Remote    exchange.Interface
}

BlockService is a block datastore. It uses an internal `datastore.Datastore` instance to store values.

func NewBlockService

func NewBlockService(d ds.Datastore, rem exchange.Interface) (*BlockService, error)

NewBlockService creates a BlockService with given datastore instance.

func (*BlockService) AddBlock

func (s *BlockService) AddBlock(b *blocks.Block) (u.Key, error)

AddBlock adds a particular block to the service, Putting it into the datastore.

func (*BlockService) GetBlock

func (s *BlockService) GetBlock(k u.Key) (*blocks.Block, error)

GetBlock retrieves a particular block from the service, Getting it from the datastore using the key (hash).

Jump to

Keyboard shortcuts

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