Documentation ¶
Index ¶
- func NewDefaultTorrentClient() (ret *torrent.Client, err error)
- func ServeFile(w http.ResponseWriter, r *http.Request, t *torrent.Torrent, _path string)
- func ServeTorrent(w http.ResponseWriter, r *http.Request, t *torrent.Torrent)
- func ServeTorrentReader(w http.ResponseWriter, r *http.Request, tr torrent.Reader, name string)
- type Event
- type Handler
- type MetainfoStorage
- type ResourceProviderMetainfoStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultTorrentClient ¶
func ServeTorrent ¶ added in v1.3.0
func ServeTorrentReader ¶ added in v1.3.0
Types ¶
type Handler ¶
type Handler struct { Logger *log.Logger TC *torrent.Client TorrentGrace time.Duration OnTorrentGrace func(t *torrent.Torrent) // If non-nil, this is the directory to cache metainfos in. MetainfoCacheDir *string // A squirrel Cache to storage the metainfos. Supercedes the MetainfoCacheDir. MetainfoStorage *squirrel.Cache // Bring your own metainfo storage. Supercedes all alternatives. MetainfoStorageInterface MetainfoStorage // Called as soon as a new torrent is added, with the cached metainfo if it's found. OnNewTorrent func(newTorrent *torrent.Torrent, cachedMetainfo *metainfo.MetaInfo) DhtServers []*dht.Server Storage *storage.Client // Alter metainfos returned from upload handler. For example to add trackers, nodes, comments etc. ModifyUploadMetainfo func(mi *metainfo.MetaInfo) // contains filtered or unexported fields }
func (*Handler) GetTorrent ¶ added in v1.3.0
func (*Handler) PutMetainfo ¶ added in v1.3.0
We require the Torrent to be given to ensure we don't infer a torrent from the MetaInfo without any release semantics. A torrent is needed to merge in the spec from the metainfo, and then to save the merged metainfo.
type MetainfoStorage ¶ added in v1.15.0
type ResourceProviderMetainfoStorage ¶ added in v1.15.0
func (ResourceProviderMetainfoStorage) Get ¶ added in v1.15.0
func (m ResourceProviderMetainfoStorage) Get(ih infohash.T) (_ io.ReadCloser, err error)
Click to show internal directories.
Click to hide internal directories.