skyhub

package
v0.0.0-...-13d4fa3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Index index.Index
	// contains filtered or unexported fields
}

func NewClient

func NewClient(
	set config.Settings,
) (*Client, error)

func (*Client) GetFile

func (c *Client) GetFile(idNum uint64, doi string) (io.ReadCloser, string, uint64, error)

func (*Client) GetFileByDOI

func (c *Client) GetFileByDOI(doi string) (io.ReadCloser, string, uint64, error)

func (*Client) InitFromSave

func (s *Client) InitFromSave() error

func (*Client) LookForRegisteredTorrent

func (s *Client) LookForRegisteredTorrent(id uint64) (*torrent.Torrent, error)

LookForRegisteredTorrent looks for an already-registered torrent for the given id.

func (*Client) LookupTorrent

func (c *Client) LookupTorrent(idNum uint64) (*torrent.Torrent, error)

LookupTorrent looks for a torrent either registered or unregistered corresponding to the given id. If the found torrent is unregistered it is registered before being returned.

func (*Client) RandomDOI

func (c *Client) RandomDOI() (string, error)

func (*Client) RecentDOI

func (c *Client) RecentDOI(n int) (string, error)

func (*Client) Register

func (s *Client) Register(rge util.Range, mi *torrent.TorrentSpec) error

func (*Client) Status

func (c *Client) Status() Status

type ConnStatus

type ConnStatus struct {
	BytesWritten     display.Size
	BytesWrittenData display.Size
	ChunksWritten    int64

	BytesRead           display.Size
	BytesReadData       display.Size
	BytesReadUsefulData display.Size
	ChunksRead          int64
}

type SaveState

type SaveState []SaveStateEntry

type SaveStateEntry

type SaveStateEntry struct {
	FromTo util.Range
	Info   metainfo.MetaInfo
}

type Status

type Status struct {
	ConnStats     ConnStatus
	TorrentStatus []TorrentStatus
}

type TorrentStatus

type TorrentStatus struct {
	Name             string
	Size             display.Size
	Completed        display.Size
	Uploaded         display.Size
	TotalPeers       int
	ActivePeers      int
	ConnectedSeeders int
}

Jump to

Keyboard shortcuts

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