download

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCache

func GetCache(background bool, c *thread.Cache) bool

GetCache checks nodes in lookuptable have the cache. if found gets records.

func Getall

func Getall()

Getall reload all records in cache in cachelist from network.

Types

type Manager

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

Manager manages download range of records.

func NewManger

func NewManger(ca *thread.Cache) *Manager

NewManger sets recs as finished recs and returns DownloadManager obj.

func (*Manager) Finished

func (dm *Manager) Finished(n *node.Node, success bool)

Finished set records n is downloading as finished.

func (*Manager) Get

func (dm *Manager) Get(n *node.Node) (int64, int64)

Get returns begin and end stamp to be gotten for node n.

func (*Manager) Set

func (dm *Manager) Set(res []string, n *node.Node)

Set sets res as targets n is holding.

type TargetRecSlice

type TargetRecSlice []*targetRec

TargetRecSlice represents slice of targetRec

func (TargetRecSlice) Len

func (t TargetRecSlice) Len() int

Len returns length of TargetRecSlice

func (TargetRecSlice) Less

func (t TargetRecSlice) Less(i, j int) bool

Len returns true if stamp of targetRec[i] is less.

func (TargetRecSlice) Swap

func (t TargetRecSlice) Swap(i, j int)

Swap swaps the location of TargetRecSlice

Jump to

Keyboard shortcuts

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