Versions in this module Expand all Collapse all v0 v0.5.0 Mar 7, 2017 Changes in this version + const MaxPostSize + const PieceSize + const TagsMax + const TitleMax + func IsAlnumWord(word string) bool + func SanitiseForAuto(in string) string + type AddressResolutionError struct + Address string + func (a AddressResolutionError) Error() string + type Collection struct + HashList []byte + Pieces []*Piece + RootHash hash.Hash + func CreateCollection(db *Database, start, pieceSize int) (*Collection, error) + func LoadCollection(path string) (col *Collection, err error) + func NewCollection() *Collection + func (c *Collection) Add(piece *Piece) + func (c *Collection) Hash() []byte + func (c *Collection) Rehash() + func (c *Collection) Save(path string) error + type Database struct + func NewDatabase(path string) *Database + func (db *Database) AddMeta(pid int, value string) error + func (db *Database) Close() + func (db *Database) Connect() error + func (db *Database) GenerateFts(since int64) error + func (db *Database) InsertPiece(piece *Piece) (err error) + func (db *Database) InsertPieces(pieces chan *Piece, fts bool) (err error) + func (db *Database) InsertPost(post Post) (int64, error) + func (db *Database) PaginatedQuery(query string, page int) ([]*Post, error) + func (db *Database) PostCount() uint + func (db *Database) QueryPiece(id uint, store bool) (*Piece, error) + func (db *Database) QueryPiecePosts(start, length int, store bool) chan *Post + func (db *Database) QueryPopular(page int) ([]*Post, error) + func (db *Database) QueryPostId(id uint) (Post, error) + func (db *Database) QueryRecent(page int) ([]*Post, error) + func (db *Database) Search(query string, page, pageSize int) ([]*Post, error) + func (db *Database) SetLeechers(id, leechers uint) error + func (db *Database) SetSeeders(id, seeders uint) error + func (db *Database) Suggest(query string) ([]string, error) + type ErrorReader struct + Err error + func NewErrorReader(r io.Reader) *ErrorReader + func (er *ErrorReader) ReadByte() (byte, error) + func (er *ErrorReader) ReadString(delim byte) string + type Piece struct + Id uint + Posts []Post + func (p *Piece) Add(post Post, store bool) error + func (p *Piece) Hash() []byte + func (p *Piece) Rehash() ([]byte, error) + func (p *Piece) Setup() + type Post struct + FileCount int + Id int + InfoHash string + Leechers int + Meta string + Seeders int + Size int + Tags string + Title string + UploadDate int + func (p *Post) Bytes(sep, term []byte, seedLeech bool) []byte + func (p *Post) String(sep, term string, seedLeech bool) string + func (p *Post) Valid() error + func (p *Post) Write(sep, term string, seedLeech bool, w io.Writer) + func (p Post) Json() ([]byte, error) + type SearchProvider struct + Loaded bool + func NewSearchProvider() *SearchProvider + func (sp *SearchProvider) Search(source string, db *Database, query string, page int) (SearchResult, error) + func (sp *SearchProvider) Suggest(db *Database, query string) ([]string, error) + type SearchResult struct + Posts []*Post + Source string