Documentation ¶
Overview ¶
Package torrent provides convenient functions for Torrent type
Index ¶
- Constants
- Variables
- func Verify(file *os.File, torrent *Torrent) error
- func Write(writer io.Writer, torrent *Torrent) error
- type Torrent
- func (*Torrent) Descriptor() ([]byte, []int)deprecated
- func (x *Torrent) GetFileHash() string
- func (x *Torrent) GetFileName() string
- func (x *Torrent) GetFileSize() int64
- func (x *Torrent) GetPieceHashes() []string
- func (x *Torrent) GetPieceSize() int64
- func (x *Torrent) GetTrackerAddress() string
- func (*Torrent) ProtoMessage()
- func (x *Torrent) ProtoReflect() protoreflect.Message
- func (x *Torrent) Reset()
- func (x *Torrent) String() string
Constants ¶
View Source
const FileExtension = ".torrent.json"
FileExtension is the default torrent file extension
Variables ¶
View Source
var FileSizeMismatchError = errors.New("recorded file size in torrent does not match the actual one")
View Source
var File_pkg_torrent_torrent_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Torrent ¶
type Torrent struct { FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` FileHash string `protobuf:"bytes,2,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"` FileSize int64 `protobuf:"varint,3,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"` PieceSize int64 `protobuf:"varint,4,opt,name=piece_size,json=pieceSize,proto3" json:"piece_size,omitempty"` PieceHashes []string `protobuf:"bytes,5,rep,name=piece_hashes,json=pieceHashes,proto3" json:"piece_hashes,omitempty"` TrackerAddress string `protobuf:"bytes,6,opt,name=tracker_address,json=trackerAddress,proto3" json:"tracker_address,omitempty"` // contains filtered or unexported fields }
func (*Torrent) Descriptor
deprecated
func (*Torrent) GetFileHash ¶
func (*Torrent) GetFileName ¶
func (*Torrent) GetFileSize ¶
func (*Torrent) GetPieceHashes ¶
func (*Torrent) GetPieceSize ¶
func (*Torrent) GetTrackerAddress ¶
func (*Torrent) ProtoMessage ¶
func (*Torrent) ProtoMessage()
func (*Torrent) ProtoReflect ¶
func (x *Torrent) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.