confluence

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MPL-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultTorrentClient

func NewDefaultTorrentClient() (ret *torrent.Client, err error)

func ServeFile added in v1.3.0

func ServeFile(w http.ResponseWriter, r *http.Request, t *torrent.Torrent, _path string)

func ServeTorrent added in v1.3.0

func ServeTorrent(w http.ResponseWriter, r *http.Request, t *torrent.Torrent)

func ServeTorrentReader added in v1.3.0

func ServeTorrentReader(w http.ResponseWriter, r *http.Request, tr torrent.Reader, name string)

Types

type Event

type Event struct {
	PieceChanged *int
}

type Handler

type Handler struct {
	TC               *torrent.Client
	TorrentGrace     time.Duration
	OnTorrentGrace   func(t *torrent.Torrent)
	MetainfoCacheDir *string
	// 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)
	// contains filtered or unexported fields
}

func (*Handler) GetTorrent added in v1.3.0

func (h *Handler) GetTorrent(ih metainfo.Hash) (t *torrent.Torrent, new bool, release func())

func (*Handler) PutMetainfo added in v1.3.0

func (h *Handler) PutMetainfo(t *torrent.Torrent, mi *metainfo.MetaInfo) error

We require the Torrent to be given to ensure we don't infer a torrent from the MetaInfo without any release semantics.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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