types

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MPL-2.0 Imports: 3 Imported by: 7 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

package types contains types that are used by the request strategy and the torrent package and need to be shared between them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkSpec

type ChunkSpec struct {
	Begin, Length pp.Integer
}

TODO: Where is the doc/spec calling it this?

type PeerID added in v1.48.0

type PeerID [20]byte

Peer client ID.

func (PeerID) MarshalJSON added in v1.61.0

func (me PeerID) MarshalJSON() ([]byte, error)

func (PeerID) String added in v1.61.0

func (me PeerID) String() string

type PieceIndex

type PieceIndex = int

type PiecePriority

type PiecePriority byte

Describes the importance of obtaining a particular piece.

const (
	PiecePriorityNone      PiecePriority = iota // Not wanted. Must be the zero value.
	PiecePriorityNormal                         // Wanted.
	PiecePriorityHigh                           // Wanted a lot.
	PiecePriorityReadahead                      // May be required soon.
	// Deprecated. Succeeds a piece where a read occurred. This used to prioritize the earlier
	// pieces in the readahead window. The request strategy now does this, so it's no longer needed.
	// There is downstream code that still assumes it's in use.
	PiecePriorityNext
	PiecePriorityNow // A Reader is reading in this piece. Highest urgency.
)

func (*PiecePriority) Raise

func (pp *PiecePriority) Raise(maybe PiecePriority) bool

type Request

type Request struct {
	Index pp.Integer
	ChunkSpec
}

func (Request) String added in v1.59.0

func (r Request) String() string

func (Request) ToMsg

func (r Request) ToMsg(mt pp.MessageType) pp.Message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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