Documentation ¶
Index ¶
- func AuthorizedQuery(c *gin.Context, pagenum int, authorized bool) (structs.TorrentParam, []models.Torrent, int, error)
- func ByQuery(c *gin.Context, pagenum int, countAll bool, withUser bool, deleted bool, ...) (structs.TorrentParam, []models.Torrent, int, error)
- func ByQueryDeleted(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)
- func ByQueryNoCount(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, err error)
- func ByQueryNoHidden(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)
- func ByQueryNoUser(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)
- func ByQueryWithUser(c *gin.Context, pagenum int) (search structs.TorrentParam, tor []models.Torrent, count int, err error)
- func Configure(conf *config.SearchConfig) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Types ¶
This section is empty.