Documentation ¶
Index ¶
- Constants
- Variables
- func CreateBoltDB(conf *config.Configuration, fileName string, backupFileName string) (*bolt.DB, error)
- func CreateStormDB(conf *config.Configuration, fileName string, backupFileName string) (*storm.DB, error)
- func GetStormDB() *storm.DB
- func ParseCacheItem(item []byte) (int64, []byte)
- func RestoreBackup(databasePath string, backupPath string)
- type BTItem
- type BoltDatabase
- func (d *BoltDatabase) AsWriter(bucket []byte, key string) *DBWriter
- func (d *BoltDatabase) BatchDelete(bucket []byte, keys []string) error
- func (d *BoltDatabase) BatchSet(bucket []byte, objects map[string]string) error
- func (d *BoltDatabase) BatchSetBytes(bucket []byte, objects map[string][]byte) error
- func (d *BoltDatabase) BatchSetObject(bucket []byte, objects map[string]interface{}) error
- func (d *BoltDatabase) BucketExists(bucket []byte) (res bool)
- func (d *BoltDatabase) CacheCleanup()
- func (d *BoltDatabase) CheckBucket(bucket []byte) error
- func (d *BoltDatabase) Close()
- func (d *BoltDatabase) CreateBackup(backupPath string)
- func (d *BoltDatabase) Delete(bucket []byte, key string) error
- func (d *BoltDatabase) DeleteWithPrefix(bucket []byte, prefix []byte)
- func (d *BoltDatabase) ForEach(bucket []byte, callback callBackWithError) error
- func (d *BoltDatabase) Get(bucket []byte, key string) (string, error)
- func (d *BoltDatabase) GetBytes(bucket []byte, key string) (value []byte, err error)
- func (d *BoltDatabase) GetCached(bucket []byte, key string) (string, error)
- func (d *BoltDatabase) GetCachedBool(bucket []byte, key string) (bool, error)
- func (d *BoltDatabase) GetCachedBytes(bucket []byte, key string) (cacheValue []byte, err error)
- func (d *BoltDatabase) GetCachedObject(bucket []byte, key string, item interface{}) (err error)
- func (d *BoltDatabase) GetFilename() string
- func (d *BoltDatabase) GetObject(bucket []byte, key string, item interface{}) (err error)
- func (d *BoltDatabase) Has(bucket []byte, key string) (ret bool)
- func (d *BoltDatabase) MaintenanceRefreshHandler()
- func (d *BoltDatabase) RecreateBucket(bucket []byte) error
- func (d *BoltDatabase) Seek(bucket []byte, prefix string, callback callBack) error
- func (d *BoltDatabase) Set(bucket []byte, key string, value string) error
- func (d *BoltDatabase) SetBytes(bucket []byte, key string, value []byte) error
- func (d *BoltDatabase) SetCached(bucket []byte, seconds int, key string, value string) error
- func (d *BoltDatabase) SetCachedBool(bucket []byte, seconds int, key string, value bool) error
- func (d *BoltDatabase) SetCachedBytes(bucket []byte, seconds int, key string, value []byte) error
- func (d *BoltDatabase) SetCachedObject(bucket []byte, seconds int, key string, item interface{}) error
- func (d *BoltDatabase) SetObject(bucket []byte, key string, item interface{}) error
- type DBWriter
- type LibraryItem
- type QueryHistory
- type SqliteDatabase
- type StormDatabase
- func (d *StormDatabase) AddSearchHistory(historyType, query string)
- func (d *StormDatabase) AddTorrentHistory(infoHash, name string, b []byte)
- func (d *StormDatabase) AddTorrentLink(tmdbID, infoHash string, b []byte)
- func (d *StormDatabase) CleanSearchHistory(historyType string)
- func (d *StormDatabase) CleanupTorrentLink(infoHash string)
- func (d *StormDatabase) Close()
- func (d *StormDatabase) CreateBackup(backupPath string)
- func (d *StormDatabase) DeleteBTItem(infoHash string) error
- func (d *StormDatabase) GetBTItem(infoHash string) *BTItem
- func (d *StormDatabase) GetFilename() string
- func (d *StormDatabase) MaintenanceRefreshHandler()
- func (d *StormDatabase) RemoveSearchHistory(historyType, query string)
- func (d *StormDatabase) UpdateBTItem(infoHash string, mediaID int, mediaType string, files []string, query string, ...) error
- func (d *StormDatabase) UpdateBTItemFiles(infoHash string, files []string) error
- func (d *StormDatabase) UpdateBTItemStatus(infoHash string, status int) error
- type TorrentAssignItem
- type TorrentAssignMetadata
- type TorrentHistory
Constants ¶
const ( // StatusRemove ... StatusRemove = iota // StatusActive ... StatusActive )
const ( // BTItemBucket ... BTItemBucket = "BTItem" // TorrentHistoryBucket ... TorrentHistoryBucket = "TorrentHistory" // TorrentAssignMetadataBucket ... TorrentAssignMetadataBucket = "TorrentAssignMetadata" // TorrentAssignItemBucket ... TorrentAssignItemBucket = "TorrentAssignItem" // QueryHistoryBucket ... QueryHistoryBucket = "QueryHistory" )
Variables ¶
var CacheBuckets = [][]byte{ CommonBucket, }
CacheBuckets represents buckets in Cache database
var ( // CommonBucket ... CommonBucket = []byte("Common") )
Functions ¶
func CreateBoltDB ¶
func CreateBoltDB(conf *config.Configuration, fileName string, backupFileName string) (*bolt.DB, error)
CreateBoltDB ...
func CreateStormDB ¶
func CreateStormDB(conf *config.Configuration, fileName string, backupFileName string) (*storm.DB, error)
CreateStormDB ...
Types ¶
type BTItem ¶
type BTItem struct { InfoHash string `json:"infoHash" storm:"id"` ID int `json:"id"` State int `json:"state"` Type string `json:"type"` Files []string `json:"files"` ShowID int `json:"showid"` Season int `json:"season"` Episode int `json:"episode"` Query string `json:"query"` }
BTItem ...
type BoltDatabase ¶
type BoltDatabase struct {
// contains filtered or unexported fields
}
BoltDatabase ...
func InitCacheDB ¶
func InitCacheDB(conf *config.Configuration) (*BoltDatabase, error)
InitCacheDB ...
func (*BoltDatabase) AsWriter ¶
func (d *BoltDatabase) AsWriter(bucket []byte, key string) *DBWriter
AsWriter ...
func (*BoltDatabase) BatchDelete ¶
func (d *BoltDatabase) BatchDelete(bucket []byte, keys []string) error
BatchDelete ...
func (*BoltDatabase) BatchSet ¶
func (d *BoltDatabase) BatchSet(bucket []byte, objects map[string]string) error
BatchSet ...
func (*BoltDatabase) BatchSetBytes ¶
func (d *BoltDatabase) BatchSetBytes(bucket []byte, objects map[string][]byte) error
BatchSetBytes ...
func (*BoltDatabase) BatchSetObject ¶
func (d *BoltDatabase) BatchSetObject(bucket []byte, objects map[string]interface{}) error
BatchSetObject ...
func (*BoltDatabase) BucketExists ¶
func (d *BoltDatabase) BucketExists(bucket []byte) (res bool)
BucketExists checks if bucket already exists in the database
func (*BoltDatabase) CheckBucket ¶
func (d *BoltDatabase) CheckBucket(bucket []byte) error
CheckBucket ...
func (*BoltDatabase) CreateBackup ¶
func (d *BoltDatabase) CreateBackup(backupPath string)
CreateBackup ...
func (*BoltDatabase) Delete ¶
func (d *BoltDatabase) Delete(bucket []byte, key string) error
Delete ...
func (*BoltDatabase) DeleteWithPrefix ¶
func (d *BoltDatabase) DeleteWithPrefix(bucket []byte, prefix []byte)
DeleteWithPrefix ...
func (*BoltDatabase) ForEach ¶
func (d *BoltDatabase) ForEach(bucket []byte, callback callBackWithError) error
ForEach ...
func (*BoltDatabase) Get ¶
func (d *BoltDatabase) Get(bucket []byte, key string) (string, error)
Get ...
func (*BoltDatabase) GetBytes ¶
func (d *BoltDatabase) GetBytes(bucket []byte, key string) (value []byte, err error)
GetBytes ...
func (*BoltDatabase) GetCached ¶
func (d *BoltDatabase) GetCached(bucket []byte, key string) (string, error)
GetCached ...
func (*BoltDatabase) GetCachedBool ¶
func (d *BoltDatabase) GetCachedBool(bucket []byte, key string) (bool, error)
GetCachedBool ...
func (*BoltDatabase) GetCachedBytes ¶
func (d *BoltDatabase) GetCachedBytes(bucket []byte, key string) (cacheValue []byte, err error)
GetCachedBytes ...
func (*BoltDatabase) GetCachedObject ¶
func (d *BoltDatabase) GetCachedObject(bucket []byte, key string, item interface{}) (err error)
GetCachedObject ...
func (*BoltDatabase) GetFilename ¶
func (d *BoltDatabase) GetFilename() string
GetFilename returns bolt filename
func (*BoltDatabase) GetObject ¶
func (d *BoltDatabase) GetObject(bucket []byte, key string, item interface{}) (err error)
GetObject ...
func (*BoltDatabase) Has ¶
func (d *BoltDatabase) Has(bucket []byte, key string) (ret bool)
Has checks for existence of a key
func (*BoltDatabase) MaintenanceRefreshHandler ¶
func (d *BoltDatabase) MaintenanceRefreshHandler()
MaintenanceRefreshHandler ...
func (*BoltDatabase) RecreateBucket ¶
func (d *BoltDatabase) RecreateBucket(bucket []byte) error
RecreateBucket ...
func (*BoltDatabase) Seek ¶
func (d *BoltDatabase) Seek(bucket []byte, prefix string, callback callBack) error
Seek ...
func (*BoltDatabase) Set ¶
func (d *BoltDatabase) Set(bucket []byte, key string, value string) error
Set ...
func (*BoltDatabase) SetBytes ¶
func (d *BoltDatabase) SetBytes(bucket []byte, key string, value []byte) error
SetBytes ...
func (*BoltDatabase) SetCachedBool ¶
SetCachedBool ...
func (*BoltDatabase) SetCachedBytes ¶
SetCachedBytes ...
func (*BoltDatabase) SetCachedObject ¶
func (d *BoltDatabase) SetCachedObject(bucket []byte, seconds int, key string, item interface{}) error
SetCachedObject ...
type LibraryItem ¶
type LibraryItem struct { ID int `storm:"id"` MediaType int `storm:"index"` State int `storm:"index"` ShowID int `storm:"index"` }
LibraryItem ...
type QueryHistory ¶
type QueryHistory struct { ID string `storm:"id"` Type string `storm:"index"` Query string `storm:"index"` Dt time.Time `storm:"index"` }
QueryHistory ...
type SqliteDatabase ¶
SqliteDatabase ...
type StormDatabase ¶
type StormDatabase struct {
// contains filtered or unexported fields
}
StormDatabase ...
func InitStormDB ¶
func InitStormDB(conf *config.Configuration) (*StormDatabase, error)
InitStormDB ...
func (*StormDatabase) AddSearchHistory ¶
func (d *StormDatabase) AddSearchHistory(historyType, query string)
AddSearchHistory adds query to search history, according to media type
func (*StormDatabase) AddTorrentHistory ¶
func (d *StormDatabase) AddTorrentHistory(infoHash, name string, b []byte)
AddTorrentHistory saves last used torrent
func (*StormDatabase) AddTorrentLink ¶
func (d *StormDatabase) AddTorrentLink(tmdbID, infoHash string, b []byte)
AddTorrentLink saves link between torrent file and tmdbID entry
func (*StormDatabase) CleanSearchHistory ¶
func (d *StormDatabase) CleanSearchHistory(historyType string)
CleanSearchHistory cleans search history for selected media type
func (*StormDatabase) CleanupTorrentLink ¶
func (d *StormDatabase) CleanupTorrentLink(infoHash string)
CleanupTorrentLink ...
func (*StormDatabase) CreateBackup ¶
func (d *StormDatabase) CreateBackup(backupPath string)
CreateBackup ...
func (*StormDatabase) DeleteBTItem ¶
func (d *StormDatabase) DeleteBTItem(infoHash string) error
DeleteBTItem ...
func (*StormDatabase) GetBTItem ¶
func (d *StormDatabase) GetBTItem(infoHash string) *BTItem
GetBTItem ...
func (*StormDatabase) GetFilename ¶
func (d *StormDatabase) GetFilename() string
GetFilename returns bolt filename
func (*StormDatabase) MaintenanceRefreshHandler ¶
func (d *StormDatabase) MaintenanceRefreshHandler()
MaintenanceRefreshHandler ...
func (*StormDatabase) RemoveSearchHistory ¶
func (d *StormDatabase) RemoveSearchHistory(historyType, query string)
RemoveSearchHistory removes query from the history
func (*StormDatabase) UpdateBTItem ¶
func (d *StormDatabase) UpdateBTItem(infoHash string, mediaID int, mediaType string, files []string, query string, infos ...int) error
UpdateBTItem ...
func (*StormDatabase) UpdateBTItemFiles ¶
func (d *StormDatabase) UpdateBTItemFiles(infoHash string, files []string) error
UpdateBTItemFiles ...
func (*StormDatabase) UpdateBTItemStatus ¶
func (d *StormDatabase) UpdateBTItemStatus(infoHash string, status int) error
UpdateBTItemStatus ...
type TorrentAssignItem ¶
type TorrentAssignItem struct { Pk int `storm:"id,increment"` InfoHash string `storm:"index"` TmdbID int `storm:"unique"` }
TorrentAssignItem ...
type TorrentAssignMetadata ¶
TorrentAssignMetadata ...