Back to godoc.org

Package search

v1.0.1
Latest Go to latest

The latest major version is .

Published: Jul 22, 2017 | License: MIT | Module: github.com/NyaaPantsu/nyaa

Index

func AuthorizedQuery

func AuthorizedQuery(c *gin.Context, pagenum int, authorized bool) (structs.TorrentParam, []models.Torrent, int, error)

AuthorizedQuery return a seach byquery according to the bool. If false, it doesn't look for hidden torrents, else it looks for every torrents

func ByQuery

func ByQuery(c *gin.Context, pagenum int, countAll bool, withUser bool, deleted bool, hidden bool) (structs.TorrentParam, []models.Torrent, int, error)

TODO Clean this up Some fields are postgres specific (countAll, withUser) elasticsearch always provide a count to how many hits ES doesn't store users deleted is unused because es doesn't index deleted torrents

func ByQueryDeleted

func ByQueryDeleted(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)

ByQueryDeleted : search deleted torrents according to request with user and count

func ByQueryNoCount

func ByQueryNoCount(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, err error)

ByQueryNoCount : search torrents according to request without user and count

func ByQueryNoHidden

func ByQueryNoHidden(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)

ByQueryNoHidden : search torrents and filter those hidden

func ByQueryNoUser

func ByQueryNoUser(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)

ByQueryNoUser : search torrents according to request without user

func ByQueryWithUser

func ByQueryWithUser(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)

ByQueryWithUser : search torrents according to request with user

func Configure

func Configure(conf *config.SearchConfig) (err error)

Configure : initialize search

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier