Documentation ¶
Index ¶
Constants ¶
View Source
const ( AutoMinPieceLength int64 = 16384 // 2^14 AutoMaxPieceLength = 67108864 // 2^26 )
Variables ¶
View Source
var AutoPieceLength = BoundPieceLength(AutoMinPieceLength, AutoMaxPieceLength)
View Source
var NoProgress *noProgress = nil
Functions ¶
This section is empty.
Types ¶
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
Digest needs to be constructed by NewHash.
func (*Digest) Complete ¶
Complete completes the hash first by appending to it the last irregular piece. Complete then returns the complete hash or error if any.
type Filesystem ¶
Filesystem can make torrents from your files or directories.
func NewFilesystem ¶
func NewFilesystem(ps Params) (*Filesystem, error)
func (Filesystem) MakeTorrent ¶
func (fs Filesystem) MakeTorrent(goroutines int, pro Progress) (Buffer, error)
type Info ¶
type Info struct { PieceLength int64 `bencode:"piece length"` Pieces string `bencode:"pieces"` Source string `bencode:"source,omitempty"` Private bool `bencode:"private,omitempty"` Name string `bencode:"name"` Files []File `bencode:"files,omitempty"` // multi-file mode only TotalLength int64 `bencode:"length,omitempty"` // single-file mode only }
type Params ¶
type Params struct { Path string PieceLength PieceLength Source string Private bool AnnounceList []string }
type PieceLength ¶
func BoundPieceLength ¶
func BoundPieceLength(min, max int64) PieceLength
func MaxPieceLength ¶
func MaxPieceLength(max int64) PieceLength
type Torrent ¶
type Torrent struct { AnnounceList [][]string `bencode:"announce-list,omitempty"` Announce string `bencode:"announce,omitempty"` CreationDate int64 `bencode:"creation date,omitempty"` Comment string `bencode:"comment,omitempty"` CreatedBy string `bencode:"created by,omitempty"` UrlList string `bencode:"url-list,omitempty"` Info `bencode:"info"` }
Click to show internal directories.
Click to hide internal directories.