Documentation ¶
Index ¶
- Variables
- func AddTorrent(torr *TorrentDB)
- func CloseDB()
- func InitSets(readOnly, searchWA bool)
- func Migrate1()
- func Migrate2(bboltDB, jsonDB TorrServerDB) error
- func RemTorrent(hash metainfo.Hash)
- func RemViewed(vv *Viewed)
- func SetBTSets(sets *BTSets)
- func SetDefaultConfig()
- func SetViewed(vv *Viewed)
- type BTSets
- type DBReadCache
- type File
- type JsonDB
- type TDB
- type TorrServerDB
- type TorrentDB
- type Viewed
- type XPathDBRouter
- func (v *XPathDBRouter) CloseDB()
- func (v *XPathDBRouter) Get(xPath, name string) []byte
- func (v *XPathDBRouter) List(xPath string) []string
- func (v *XPathDBRouter) RegisterRoute(db TorrServerDB, xPath string) error
- func (v *XPathDBRouter) Rem(xPath, name string)
- func (v *XPathDBRouter) Set(xPath, name string, value []byte)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddTorrent ¶
func AddTorrent(torr *TorrentDB)
func Migrate2 ¶
func Migrate2(bboltDB, jsonDB TorrServerDB) error
=== Migrate 2 ===
Migrate 'Settings' and 'Viewed' buckets from BBolt ('config.db') to separate JSON files ('settings.json' and 'viewed.json')
'Torrents' data continues to remain in the BBolt database ('config.db') due to the fact that BLOBs are stored there
To make user be able to roll settings back, no data is deleted from 'config.db' file.
func RemTorrent ¶
func SetDefaultConfig ¶
func SetDefaultConfig()
Types ¶
type BTSets ¶
type BTSets struct { // Cache CacheSize int64 // in byte, def 64 MB ReaderReadAHead int // in percent, 5%-100%, [...S__X__E...] [S-E] not clean PreloadCache int // in percent // Disk UseDisk bool TorrentsSavePath string RemoveCacheOnDrop bool // Torrent ForceEncrypt bool RetrackersMode int // 0 - don`t add, 1 - add retrackers (def), 2 - remove retrackers 3 - replace retrackers TorrentDisconnectTimeout int // in seconds EnableDebug bool // debug logs // DLNA EnableDLNA bool FriendlyName string // Rutor EnableRutorSearch bool // BT Config EnableIPv6 bool DisableTCP bool DisableUTP bool DisableUPNP bool DisableDHT bool DisablePEX bool DisableUpload bool DownloadRateLimit int // in kb, 0 - inf UploadRateLimit int // in kb, 0 - inf ConnectionsLimit int PeersListenPort int // HTTPS SslPort int SslCert string SslKey string }
var BTsets *BTSets
type DBReadCache ¶
type DBReadCache struct {
// contains filtered or unexported fields
}
func (*DBReadCache) CloseDB ¶
func (v *DBReadCache) CloseDB()
func (*DBReadCache) Get ¶
func (v *DBReadCache) Get(xPath, name string) []byte
func (*DBReadCache) List ¶
func (v *DBReadCache) List(xPath string) []string
func (*DBReadCache) Rem ¶
func (v *DBReadCache) Rem(xPath, name string)
func (*DBReadCache) Set ¶
func (v *DBReadCache) Set(xPath, name string, value []byte)
type TorrServerDB ¶
type TorrServerDB interface { CloseDB() Get(xPath, name string) []byte Set(xPath, name string, value []byte) List(xPath string) []string Rem(xPath, name string) }
func NewDBReadCache ¶
func NewDBReadCache(db TorrServerDB) TorrServerDB
func NewJsonDB ¶
func NewJsonDB() TorrServerDB
func NewTDB ¶
func NewTDB() TorrServerDB
type TorrentDB ¶
type TorrentDB struct { *torrent.TorrentSpec Title string `json:"title,omitempty"` Poster string `json:"poster,omitempty"` Data string `json:"data,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Size int64 `json:"size,omitempty"` }
func ListTorrent ¶
func ListTorrent() []*TorrentDB
type Viewed ¶
func ListViewed ¶
type XPathDBRouter ¶
type XPathDBRouter struct {
// contains filtered or unexported fields
}
func NewXPathDBRouter ¶
func NewXPathDBRouter() *XPathDBRouter
func (*XPathDBRouter) CloseDB ¶
func (v *XPathDBRouter) CloseDB()
func (*XPathDBRouter) Get ¶
func (v *XPathDBRouter) Get(xPath, name string) []byte
func (*XPathDBRouter) List ¶
func (v *XPathDBRouter) List(xPath string) []string
func (*XPathDBRouter) RegisterRoute ¶
func (v *XPathDBRouter) RegisterRoute(db TorrServerDB, xPath string) error
func (*XPathDBRouter) Rem ¶
func (v *XPathDBRouter) Rem(xPath, name string)
func (*XPathDBRouter) Set ¶
func (v *XPathDBRouter) Set(xPath, name string, value []byte)
Click to show internal directories.
Click to hide internal directories.