Documentation ¶
Index ¶
Constants ¶
View Source
const ( ShowAll Status = 0 FilterRemakes = 2 Trusted = 3 APlus = 4 )
Variables ¶
This section is empty.
Functions ¶
func ParseLanguages ¶
func ParseLanguages(s string) publicSettings.Languages
ParseLanguages sets languages by string
Types ¶
type Categories ¶
type Categories []*Category
type Category ¶
type Category struct {
Main, Sub uint8
}
func ParseCategories ¶
ParseCategories sets category by string
type DateFilter ¶
type DateFilter string
type TorrentCache ¶
type TorrentParam ¶
type TorrentParam struct { Full bool // True means load all members Order bool // True means ascending Hidden bool // True means filter hidden torrents Deleted bool // False means filter deleted torrents Status Status Sort SortMode Category Categories Max uint32 Offset uint32 UserID uint32 TorrentID uint32 FromID uint32 FromDate DateFilter ToDate DateFilter NotNull string // csv NameLike string // csv Languages publicSettings.Languages MinSize SizeBytes MaxSize SizeBytes }
TorrentParam defines all parameters that can be provided when searching for a torrent
func (*TorrentParam) Clone ¶
func (p *TorrentParam) Clone() TorrentParam
Clone : To clone a torrent params
func (*TorrentParam) Find ¶
Find :
Uses elasticsearch to find the torrents based on TorrentParam * We decided to fetch only the ids from ES and then query these ids to the * database
func (*TorrentParam) FromRequest ¶
func (p *TorrentParam) FromRequest(c *gin.Context)
FromRequest : parse a request in torrent param TODO Should probably return an error ?
func (*TorrentParam) Identifier ¶
func (p *TorrentParam) Identifier() string
func (*TorrentParam) ToFilterQuery ¶
func (p *TorrentParam) ToFilterQuery() string
ToFilterQuery : Builds a query string with for es query string query defined here https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
type WhereParams ¶
type WhereParams struct { Conditions string // Ex : name LIKE ? AND category_id LIKE ? Params []interface{} }
WhereParams struct for search
func CreateWhereParams ¶
func CreateWhereParams(conditions string, params ...interface{}) WhereParams
CreateWhereParams : function to create WhereParams struct for search
Click to show internal directories.
Click to hide internal directories.