db

package
v0.0.0-...-cb1d36a Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a store

func NewStore

func NewStore(dsn string) (*Store, error)

NewStore connects and initializes a new store

func (*Store) Close

func (s *Store) Close() error

func (*Store) PendingInfohashes

func (s *Store) PendingInfohashes(n int) (peers []*models.Peer, err error)

PendingInfohashes gets the next pending infohash from the store

func (*Store) RemovePeer

func (s *Store) RemovePeer(p *models.Peer) (err error)

func (*Store) RemoveTorrent

func (s *Store) RemoveTorrent(t *models.Torrent) (err error)

func (*Store) SavePeer

func (s *Store) SavePeer(p *models.Peer) (err error)

SavePeer implements torrentStore

func (*Store) SaveTag

func (s *Store) SaveTag(tag string) (int, error)

SaveTag implements tagStore interface

func (*Store) SaveTorrent

func (s *Store) SaveTorrent(t *models.Torrent) error

SaveTorrent implements torrentStore

func (*Store) TorrentByHash

func (s *Store) TorrentByHash(ih models.Infohash) (*models.Torrent, error)

TorrentsByHash implements torrentStore

func (*Store) TorrentsByName

func (s *Store) TorrentsByName(query string, offset int) ([]*models.Torrent, error)

TorrentsByName implements torrentStore

func (*Store) TorrentsByTag

func (s *Store) TorrentsByTag(tag string, offset int) ([]*models.Torrent, error)

TorrentsByTag implements torrentStore

Jump to

Keyboard shortcuts

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