pieceordering

package
v0.0.0-...-fdaaeef Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2016 License: MPL-2.0, MIT Imports: 2 Imported by: 0

Documentation

Overview

Implements ordering of torrent piece indices for such purposes as download prioritization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element interface {
	Piece() int
	Next() Element
}

type Instance

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

Maintains piece integers by their ascending assigned keys.

func New

func New() *Instance

func (*Instance) DeletePiece

func (me *Instance) DeletePiece(piece int)

func (*Instance) Empty

func (me *Instance) Empty() bool

func (*Instance) First

func (me *Instance) First() Element

Returns the piece with the lowest key.

func (*Instance) SetPiece

func (me *Instance) SetPiece(piece, key int)

Add the piece with the given key. If the piece is already present, change its key.

Jump to

Keyboard shortcuts

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