Documentation ¶
Index ¶
- Constants
- type CortexStorage
- type MsgInfo
- type Peer
- type PeerInfo
- type PublicTorrentAPI
- type Query
- type TorrentFS
- func (fs *TorrentFS) APIs() []rpc.API
- func (fs *TorrentFS) Candidate() int
- func (fs *TorrentFS) Congress() int
- func (fs *TorrentFS) Download(ctx context.Context, ih string, request uint64) error
- func (fs *TorrentFS) Drop(ih string) error
- func (fs *TorrentFS) Envelopes() *ttlmap.Map
- func (fs *TorrentFS) GetFileWithSize(ctx context.Context, infohash string, rawSize uint64, subpath string) ([]byte, error)
- func (fs *TorrentFS) HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error
- func (fs *TorrentFS) IsActive(err error) bool
- func (fs *TorrentFS) ListAllTorrents(ctx context.Context) map[string]map[string]int
- func (fs *TorrentFS) LocalPort() int
- func (fs *TorrentFS) MaxMessageSize() uint32
- func (fs *TorrentFS) NasCounter() uint64
- func (fs *TorrentFS) Neighbors() int
- func (fs *TorrentFS) Nominee() int
- func (fs *TorrentFS) PauseLocalSeed(ctx context.Context, ih string) error
- func (fs *TorrentFS) Protocols() []p2p.Protocol
- func (fs *TorrentFS) ResumeLocalSeed(ctx context.Context, ih string) error
- func (fs *TorrentFS) SeedingLocal(ctx context.Context, filePath string, isLinkMode bool) (infoHash string, err error)
- func (fs *TorrentFS) Start(srvr *p2p.Server) (err error)
- func (fs *TorrentFS) Status(ctx context.Context, ih string) (int, error)
- func (fs *TorrentFS) Stop() error
- func (fs *TorrentFS) Tunnel(ctx context.Context, ih string) error
- func (fs *TorrentFS) Version() uint
Constants ¶
View Source
const ( STATUS_PENDING = 1 STATUS_RUNNING = 2 STATUS_SEEDING = 0 STATUS_UNKNOWN = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CortexStorage ¶
type CortexStorage interface { //Available(ctx context.Context, infohash string, rawSize uint64) (bool, error) //GetFile(ctx context.Context, infohash, path string) ([]byte, error) GetFileWithSize(ctx context.Context, infohash string, rawSize uint64, path string) ([]byte, error) Stop() error Download(ctx context.Context, ih string, request uint64) error // File uploaded SeedingLocal(ctx context.Context, filePath string, isLinkMode bool) (string, error) PauseLocalSeed(ctx context.Context, ih string) error ResumeLocalSeed(ctx context.Context, ih string) error ListAllTorrents(ctx context.Context) map[string]map[string]int //0 finish, 1 pending, 2 downloading, 3 none Status(ctx context.Context, ih string) (int, error) }
func GetStorage ¶
func GetStorage() CortexStorage
type PublicTorrentAPI ¶
type PublicTorrentAPI struct {
// contains filtered or unexported fields
}
func NewPublicTorrentAPI ¶
func NewPublicTorrentAPI(w *TorrentFS) *PublicTorrentAPI
type TorrentFS ¶
type TorrentFS struct {
// contains filtered or unexported fields
}
TorrentFS contains the torrent file system internals.
func (*TorrentFS) GetFileWithSize ¶
func (*TorrentFS) HandlePeer ¶
func (*TorrentFS) ListAllTorrents ¶
List All Torrents Status (read-only)
func (*TorrentFS) MaxMessageSize ¶
func (*TorrentFS) NasCounter ¶
func (*TorrentFS) PauseLocalSeed ¶
PauseSeeding Local File
func (*TorrentFS) ResumeLocalSeed ¶
ResumeSeeding Local File
func (*TorrentFS) SeedingLocal ¶
func (fs *TorrentFS) SeedingLocal(ctx context.Context, filePath string, isLinkMode bool) (infoHash string, err error)
Seeding Local File, validate folder, seeding and load files, default mode is copyMode, linkMode will limit user's operations for original files
func (*TorrentFS) Start ¶
Start starts the data collection thread and the listening server of the dashboard. Implements the node.Service interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
pack-blocklist
Takes P2P blocklist text format in stdin, and outputs the packed format from the iplist package.
|
Takes P2P blocklist text format in stdin, and outputs the packed format from the iplist package. |
seeding
Mounts a FUSE filesystem backed by torrents and magnet links.
|
Mounts a FUSE filesystem backed by torrents and magnet links. |
torrent
Downloads torrents from the command-line.
|
Downloads torrents from the command-line. |
torrentfs
Mounts a FUSE filesystem backed by torrents and magnet links.
|
Mounts a FUSE filesystem backed by torrents and magnet links. |
Click to show internal directories.
Click to hide internal directories.