Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileLease ¶
type FileLease struct {
File *torrent.File
Index int
Path string
DisplayPath string
Length int64
Reader io.ReadCloser
// contains filtered or unexported fields
}
FileLease is a completed torrent file handed to a consumer.
func (*FileLease) Discarded ¶ added in v1.54.5
Discarded reports whether Discard has completed successfully.
func (*FileLease) Finalized ¶ added in v1.54.5
Finalized reports whether Release or Discard has completed successfully.
type FileSelectionController ¶ added in v1.54.5
type FileSelectionController struct {
// contains filtered or unexported fields
}
FileSelectionController lets callers change the file set used by Files while it is running. A nil selection means all files; an empty non-nil selection means no files.
func NewFileSelectionController ¶ added in v1.54.5
func NewFileSelectionController(indexes []int) *FileSelectionController
func (*FileSelectionController) Close ¶ added in v1.54.5
func (c *FileSelectionController) Close()
func (*FileSelectionController) SelectedFileIndexes ¶ added in v1.54.5
func (c *FileSelectionController) SelectedFileIndexes() []int
func (*FileSelectionController) SetSelectedFileIndexes ¶ added in v1.54.5
func (c *FileSelectionController) SetSelectedFileIndexes(indexes []int) error
type FilesOptions ¶
type FilesOptions struct {
// FileIndexes selects zero-based torrent file indexes. Nil means all
// files; an empty non-nil slice means none.
FileIndexes []int
// Selection allows FileIndexes to be changed while Files is running. When
// set, FileIndexes is ignored and Files runs until the context is cancelled,
// the controller is closed, or an error occurs.
Selection *FileSelectionController
// MaxActive limits how many selected files are requested at once. Values
// <=0 request all selected files at once.
MaxActive int
// Readahead overrides the Reader default when non-zero.
Readahead int64
// RequireExplicitRelease makes Files wait for the handler to call Release
// or Discard when the handler returns nil without finalizing the lease.
// While waiting, the lease still counts against MaxActive.
RequireExplicitRelease bool
}
Click to show internal directories.
Click to hide internal directories.