Documentation ¶
Index ¶
- Variables
- func MetafromHex(infohash string) (h metainfo.Hash, err error)
- func NewPsqlPieceCompletion(databaseurl string) (ret *psqlPieceCompletion, err error)
- func NewSqlitePieceCompletion(dir string) (ret *sqlitePieceCompletion, err error)
- type FileStateDb
- type LockStateDb
- type PcDb
- type PsqlFsDb
- func (db *PsqlFsDb) Add(fp string, ih metainfo.Hash) (err error)
- func (db *PsqlFsDb) Close()
- func (db *PsqlFsDb) Delete(ih metainfo.Hash) (err error)
- func (db *PsqlFsDb) Deletefile(fp string, ih metainfo.Hash) (err error)
- func (db *PsqlFsDb) Get(ih metainfo.Hash) (ret []string)
- func (db *PsqlFsDb) Open(dburl string)
- type PsqlLsDb
- type PsqlTDb
- type PsqlTrntDb
- func (db *PsqlTrntDb) Add(ih metainfo.Hash) (err error)
- func (db *PsqlTrntDb) Close()
- func (db *PsqlTrntDb) Delete(ih metainfo.Hash) (err error)
- func (db *PsqlTrntDb) Exists(ih metainfo.Hash) (ret bool)
- func (db *PsqlTrntDb) GetTorrent(ih metainfo.Hash) (*Torrent, error)
- func (db *PsqlTrntDb) GetTorrents() (Trnts []*Torrent, err error)
- func (db *PsqlTrntDb) HasStarted(ih string) (ret bool)
- func (db *PsqlTrntDb) Open(dburl string)
- func (db *PsqlTrntDb) SetStarted(ih metainfo.Hash, inp bool) (err error)
- func (db *PsqlTrntDb) Start(ih metainfo.Hash) (err error)
- type PsqlTrntUserDb
- func (db *PsqlTrntUserDb) Add(username string, ih metainfo.Hash) (err error)
- func (db *PsqlTrntUserDb) Close()
- func (db *PsqlTrntUserDb) HasUser(username string, ih string) (ret bool)
- func (db *PsqlTrntUserDb) ListTorrents(username string) (ret []metainfo.Hash)
- func (db *PsqlTrntUserDb) ListUsers(mi metainfo.Hash) (ret []string)
- func (db *PsqlTrntUserDb) Open(dburl string)
- func (db *PsqlTrntUserDb) Remove(username string, ih metainfo.Hash) (err error)
- func (db *PsqlTrntUserDb) RemoveAll(username string) (err error)
- func (db *PsqlTrntUserDb) RemoveAllMi(mi metainfo.Hash) (err error)
- type PsqlUserDb
- func (db *PsqlUserDb) Add(Username string, Password string, UserType int) (err error)
- func (db *PsqlUserDb) ChangeType(Username string, Type string) (err error)
- func (db *PsqlUserDb) Close()
- func (db *PsqlUserDb) Delete(username string) (err error)
- func (db *PsqlUserDb) GetID(username string) (ret int64)
- func (db *PsqlUserDb) GetUsers() (ret []*User)
- func (db *PsqlUserDb) Open(dburl string)
- func (db *PsqlUserDb) SetToken(Username string, Token string) (err error)
- func (db *PsqlUserDb) UpdatePw(Username string, Password string) (err error)
- func (db *PsqlUserDb) Validate(Username string, Password string) (ut int, b bool)
- func (db *PsqlUserDb) ValidateToken(Token string) (user string, ut int, err error)
- type Sqlite3Db
- func (db *Sqlite3Db) Add(ih metainfo.Hash) (err error)
- func (db *Sqlite3Db) Close()
- func (db *Sqlite3Db) Delete(ih metainfo.Hash) (err error)
- func (db *Sqlite3Db) Exists(ih metainfo.Hash) (ret bool)
- func (db *Sqlite3Db) GetTorrent(ih metainfo.Hash) (*Torrent, error)
- func (db *Sqlite3Db) GetTorrents() (Trnts []*Torrent, err error)
- func (db *Sqlite3Db) HasStarted(ih string) (ret bool)
- func (db *Sqlite3Db) IsLocked(ih string) (ret bool)
- func (db *Sqlite3Db) Open(fp string)
- func (db *Sqlite3Db) SetLocked(ih string, b bool) (err error)
- func (db *Sqlite3Db) SetStarted(ih metainfo.Hash, inp bool) (err error)
- func (db *Sqlite3Db) Start(ih metainfo.Hash) (err error)
- type Sqlite3UserDb
- func (db *Sqlite3UserDb) Add(Username string, Password string, UserType int) (err error)
- func (db *Sqlite3UserDb) ChangeType(Username string, Type string) (err error)
- func (db *Sqlite3UserDb) Close()
- func (db *Sqlite3UserDb) Delete(Username string) (err error)
- func (db *Sqlite3UserDb) GetUsers() (ret []*User)
- func (db *Sqlite3UserDb) Open(fp string)
- func (db *Sqlite3UserDb) SetToken(Username string, Token string) (err error)
- func (db *Sqlite3UserDb) UpdatePw(Username string, Password string) (err error)
- func (db *Sqlite3UserDb) Validate(Username string, Password string) (ut int, ret bool)
- func (db *Sqlite3UserDb) ValidateToken(Token string) (user string, ut int, err error)
- type SqliteFSDb
- func (db *SqliteFSDb) Add(fp string, ih metainfo.Hash) (err error)
- func (db *SqliteFSDb) Close()
- func (db *SqliteFSDb) Delete(ih metainfo.Hash) (err error)
- func (db *SqliteFSDb) Deletefile(fp string, ih metainfo.Hash) (err error)
- func (db *SqliteFSDb) Get(ih metainfo.Hash) (ret []string)
- func (db *SqliteFSDb) Open(fp string)
- type SqliteLSDb
- type SqliteTdb
- type SqliteTorrentUserDb
- func (db *SqliteTorrentUserDb) Add(username string, ih metainfo.Hash) (err error)
- func (db *SqliteTorrentUserDb) Close()
- func (db *SqliteTorrentUserDb) HasUser(username string, ih string) (ret bool)
- func (db *SqliteTorrentUserDb) ListTorrents(username string) (ret []metainfo.Hash)
- func (db *SqliteTorrentUserDb) ListUsers(mi metainfo.Hash) (ret []string)
- func (db *SqliteTorrentUserDb) Open(fp string)
- func (db *SqliteTorrentUserDb) Remove(username string, ih metainfo.Hash) (err error)
- func (db *SqliteTorrentUserDb) RemoveAll(username string) (err error)
- func (db *SqliteTorrentUserDb) RemoveAllMi(mi metainfo.Hash) (err error)
- type Torrent
- type TorrentDb
- type TorrentUserDb
- type TrackerDb
- type User
- type UserDb
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MetafromHex ¶
MetafromHex returns metainfo.Hash from given infohash string
func NewPsqlPieceCompletion ¶
Types ¶
type FileStateDb ¶
type LockStateDb ¶
type PsqlFsDb ¶
func (*PsqlFsDb) Deletefile ¶
type PsqlTrntDb ¶
func (*PsqlTrntDb) Close ¶
func (db *PsqlTrntDb) Close()
func (*PsqlTrntDb) GetTorrent ¶
func (db *PsqlTrntDb) GetTorrent(ih metainfo.Hash) (*Torrent, error)
func (*PsqlTrntDb) GetTorrents ¶
func (db *PsqlTrntDb) GetTorrents() (Trnts []*Torrent, err error)
func (*PsqlTrntDb) HasStarted ¶
func (db *PsqlTrntDb) HasStarted(ih string) (ret bool)
func (*PsqlTrntDb) Open ¶
func (db *PsqlTrntDb) Open(dburl string)
func (*PsqlTrntDb) SetStarted ¶
func (db *PsqlTrntDb) SetStarted(ih metainfo.Hash, inp bool) (err error)
type PsqlTrntUserDb ¶
func (*PsqlTrntUserDb) Add ¶
func (db *PsqlTrntUserDb) Add(username string, ih metainfo.Hash) (err error)
func (*PsqlTrntUserDb) Close ¶
func (db *PsqlTrntUserDb) Close()
func (*PsqlTrntUserDb) HasUser ¶
func (db *PsqlTrntUserDb) HasUser(username string, ih string) (ret bool)
func (*PsqlTrntUserDb) ListTorrents ¶
func (db *PsqlTrntUserDb) ListTorrents(username string) (ret []metainfo.Hash)
func (*PsqlTrntUserDb) ListUsers ¶
func (db *PsqlTrntUserDb) ListUsers(mi metainfo.Hash) (ret []string)
func (*PsqlTrntUserDb) Open ¶
func (db *PsqlTrntUserDb) Open(dburl string)
func (*PsqlTrntUserDb) Remove ¶
func (db *PsqlTrntUserDb) Remove(username string, ih metainfo.Hash) (err error)
func (*PsqlTrntUserDb) RemoveAll ¶
func (db *PsqlTrntUserDb) RemoveAll(username string) (err error)
func (*PsqlTrntUserDb) RemoveAllMi ¶
func (db *PsqlTrntUserDb) RemoveAllMi(mi metainfo.Hash) (err error)
type PsqlUserDb ¶
func (*PsqlUserDb) Add ¶
func (db *PsqlUserDb) Add(Username string, Password string, UserType int) (err error)
func (*PsqlUserDb) ChangeType ¶
func (db *PsqlUserDb) ChangeType(Username string, Type string) (err error)
func (*PsqlUserDb) Close ¶
func (db *PsqlUserDb) Close()
func (*PsqlUserDb) Delete ¶
func (db *PsqlUserDb) Delete(username string) (err error)
func (*PsqlUserDb) GetID ¶
func (db *PsqlUserDb) GetID(username string) (ret int64)
func (*PsqlUserDb) GetUsers ¶
func (db *PsqlUserDb) GetUsers() (ret []*User)
func (*PsqlUserDb) Open ¶
func (db *PsqlUserDb) Open(dburl string)
func (*PsqlUserDb) SetToken ¶
func (db *PsqlUserDb) SetToken(Username string, Token string) (err error)
func (*PsqlUserDb) UpdatePw ¶
func (db *PsqlUserDb) UpdatePw(Username string, Password string) (err error)
func (*PsqlUserDb) Validate ¶
func (db *PsqlUserDb) Validate(Username string, Password string) (ut int, b bool)
func (*PsqlUserDb) ValidateToken ¶
func (db *PsqlUserDb) ValidateToken(Token string) (user string, ut int, err error)
type Sqlite3Db ¶
func (*Sqlite3Db) GetTorrents ¶
func (*Sqlite3Db) HasStarted ¶
func (*Sqlite3Db) SetStarted ¶
type Sqlite3UserDb ¶
func (*Sqlite3UserDb) Add ¶
func (db *Sqlite3UserDb) Add(Username string, Password string, UserType int) (err error)
func (*Sqlite3UserDb) ChangeType ¶
func (db *Sqlite3UserDb) ChangeType(Username string, Type string) (err error)
func (*Sqlite3UserDb) Close ¶
func (db *Sqlite3UserDb) Close()
func (*Sqlite3UserDb) Delete ¶
func (db *Sqlite3UserDb) Delete(Username string) (err error)
func (*Sqlite3UserDb) GetUsers ¶
func (db *Sqlite3UserDb) GetUsers() (ret []*User)
func (*Sqlite3UserDb) Open ¶
func (db *Sqlite3UserDb) Open(fp string)
func (*Sqlite3UserDb) SetToken ¶
func (db *Sqlite3UserDb) SetToken(Username string, Token string) (err error)
func (*Sqlite3UserDb) UpdatePw ¶
func (db *Sqlite3UserDb) UpdatePw(Username string, Password string) (err error)
func (*Sqlite3UserDb) Validate ¶
func (db *Sqlite3UserDb) Validate(Username string, Password string) (ut int, ret bool)
func (*Sqlite3UserDb) ValidateToken ¶
func (db *Sqlite3UserDb) ValidateToken(Token string) (user string, ut int, err error)
type SqliteFSDb ¶
func (*SqliteFSDb) Close ¶
func (db *SqliteFSDb) Close()
func (*SqliteFSDb) Deletefile ¶
func (db *SqliteFSDb) Deletefile(fp string, ih metainfo.Hash) (err error)
func (*SqliteFSDb) Open ¶
func (db *SqliteFSDb) Open(fp string)
type SqliteLSDb ¶
func (*SqliteLSDb) Close ¶
func (db *SqliteLSDb) Close()
func (*SqliteLSDb) IsLocked ¶
func (db *SqliteLSDb) IsLocked(m string) (b bool)
func (*SqliteLSDb) Open ¶
func (db *SqliteLSDb) Open(fp string)
type SqliteTorrentUserDb ¶
func (*SqliteTorrentUserDb) Add ¶
func (db *SqliteTorrentUserDb) Add(username string, ih metainfo.Hash) (err error)
func (*SqliteTorrentUserDb) Close ¶
func (db *SqliteTorrentUserDb) Close()
func (*SqliteTorrentUserDb) HasUser ¶
func (db *SqliteTorrentUserDb) HasUser(username string, ih string) (ret bool)
func (*SqliteTorrentUserDb) ListTorrents ¶
func (db *SqliteTorrentUserDb) ListTorrents(username string) (ret []metainfo.Hash)
func (*SqliteTorrentUserDb) ListUsers ¶
func (db *SqliteTorrentUserDb) ListUsers(mi metainfo.Hash) (ret []string)
func (*SqliteTorrentUserDb) Open ¶
func (db *SqliteTorrentUserDb) Open(fp string)
func (*SqliteTorrentUserDb) Remove ¶
func (db *SqliteTorrentUserDb) Remove(username string, ih metainfo.Hash) (err error)
func (*SqliteTorrentUserDb) RemoveAll ¶
func (db *SqliteTorrentUserDb) RemoveAll(username string) (err error)
func (*SqliteTorrentUserDb) RemoveAllMi ¶
func (db *SqliteTorrentUserDb) RemoveAllMi(mi metainfo.Hash) (err error)
type TorrentUserDb ¶
type UserDb ¶
type UserDb interface { Open(string) Close() Add(string, string, int) error // Username , Password , Usertype ChangeType(string, string) error Delete(string) error UpdatePw(string, string) error GetUsers() []*User Validate(string, string) (int, bool) ValidateToken(string) (string, int, error) SetToken(string, string) error }
Click to show internal directories.
Click to hide internal directories.