swarm

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Swarm

type Swarm interface {
	// common methods
	IsMaster() bool
	Bootstrap() error

	// master methods
	GetConnectedWorkers() map[string]*SwarmWorker
	RequestTorrentsFromWorker(string) ([]*deluge.Torrent, error)
	RequestFreeSpaceFromWorker(string) (uint64, error)
	SaveTorrentFile(string, string, *[]byte) (int64, error)
	RemoveTorrent(string, string, string, ...bool) (uint64, uint64, error)
	ForceReannounce(string) error
}

type SwarmWorker

type SwarmWorker struct {
	Id      string
	Version string

	sync.RWMutex
	FreeSpace uint64

	ActiveTorrents []*deluge.Torrent
}

func (*SwarmWorker) DecreaseFreeSpace added in v0.0.4

func (m *SwarmWorker) DecreaseFreeSpace(space uint64) bool

func (*SwarmWorker) GetFreeSpace added in v0.0.4

func (m *SwarmWorker) GetFreeSpace() (space uint64)

func (*SwarmWorker) HasEnoughSpace added in v0.0.4

func (m *SwarmWorker) HasEnoughSpace(space uint64) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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