download

package
v0.0.0-...-34de315 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExist    = errors.New("download already exists")
	ErrNotExist = errors.New("download does not exist")
)

Errors exported by the package.

Functions

func Select

func Select(has []string, may []string, count map[string]uint) string

Select will return the best download candidate from a list of candidates who certainly have or possibly have an entity.

Types

type Manager

type Manager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Manager implement a simple download manager.

func (*Manager) CancelInv

func (mgr *Manager) CancelInv(hash types.Hash) error

CancelInv cancels the download of a block inventory.

func (*Manager) CancelTx

func (mgr *Manager) CancelTx(hash types.Hash) error

CancelTx cancels the download of a block inventory.

func (*Manager) HasInv

func (mgr *Manager) HasInv(hash types.Hash) bool

HasInv checks whether we are currently trying to download an inventory.

func (*Manager) HasTx

func (mgr *Manager) HasTx(hash types.Hash) bool

HasTx checks whether we are currently trying to download a transaction.

func (*Manager) StartInv

func (mgr *Manager) StartInv(hash types.Hash) error

StartInv starts the download of a block inventory.

func (*Manager) StartTx

func (mgr *Manager) StartTx(hash types.Hash) error

StartTx starts the download of a transaction.

type Network

type Network interface {
	Send(address string, msg interface{}) error
}

Network defines what we need from the network module.

type Peers

type Peers interface {
	Addresses(filters ...peers.FilterFunc) []string
}

Peers represents an interface to get access to the state of currently connected peers.

Jump to

Keyboard shortcuts

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