settings

package
v0.0.0-...-22766dc Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Path string
)
View Source
var (
	StartTime time.Time
)

Functions

func AddInfo

func AddInfo(hash, info string) error

func CloseDB

func CloseDB()

func GetInfo

func GetInfo(hash string) string

func ReadSettings

func ReadSettings() error

func RemoveTorrentDB

func RemoveTorrentDB(hash string) error

func SaveSettings

func SaveSettings() error

func SaveTorrentDB

func SaveTorrentDB(torrent *Torrent) error

func SetViewed

func SetViewed(hash, filename string) error

func SortFiles

func SortFiles(files []File)

Types

type File

type File struct {
	Name   string
	Size   int64
	Viewed bool
}

type Settings

type Settings struct {
	CacheSize         int64 // in byte, def 200 mb
	PreloadBufferSize int64 // in byte, buffer for preload

	RetrackersMode int //0 - don`t add, 1 - add retrackers, 2 - remove retrackers

	//BT Config
	DisableTCP         bool
	DisableUTP         bool
	DisableUPNP        bool
	DisableDHT         bool
	DisableUpload      bool
	Encryption         int // 0 - Enable, 1 - disable, 2 - force
	DownloadRateLimit  int // in kb, 0 - inf
	UploadRateLimit    int // in kb, 0 - inf
	ConnectionsLimit   int
	DhtConnectionLimit int // 0 - inf
	PeersListenPort    int
}

func Get

func Get() *Settings

func (*Settings) String

func (s *Settings) String() string

type Torrent

type Torrent struct {
	Name      string
	Magnet    string
	Hash      string
	Size      int64
	Timestamp int64

	Files []File
}

func LoadTorrentDB

func LoadTorrentDB(hash string) (*Torrent, error)

func LoadTorrentsDB

func LoadTorrentsDB() ([]*Torrent, error)

Jump to

Keyboard shortcuts

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