ehloader

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QOpAnd  = "and"
	QOpOr   = "or"
	QOpLike = "like"
	QOpEq   = "="
)
View Source
const (
	OrderByGId    = ""
	OrderByPosted = "posted"
	OrderByRating = "rating"
)

Variables

This section is empty.

Functions

func BuildKV

func BuildKV(pair string, defaultTagK string) (string, string)

func Index added in v0.0.5

func Index(jsonPath string, urlPath string, fileDirPath string, fileMapPath string) error

Types

type Gallery struct {
	GId          int
	Token        string
	ArchiverKey  string
	Title        string
	TitleExt     map[string]string
	TitleJpn     string
	TitleJpnExt  map[string]string
	Category     string
	Thumb        string
	Uploader     string
	Posted       time.Time
	FileCount    int
	FileSize     int64
	Expunged     bool
	Rating       float32
	TorrentCount int
	Tags         map[string][]string
	Exists       bool
	ExistsIn     string
	ExistFiles   []string
}
func Search(searchTags map[TagK]map[TagV]struct{}, offset, limit int) []*Gallery

func SearchQ added in v0.0.3

func SearchQ(orderBy string, offset, limit int, q Q) ([]*Gallery, int)

type JGallery

type JGallery struct {
	GId          int      `json:"gid"`
	Token        string   `json:"token"`
	ArchiverKey  string   `json:"archiver_key"`
	Title        string   `json:"title"`
	TitleJpn     string   `json:"title_jpn"`
	Category     string   `json:"category"`
	Thumb        string   `json:"thumb"`
	Uploader     string   `json:"uploader"`
	Posted       string   `json:"posted"`
	FileCount    string   `json:"filecount"`
	FileSize     int64    `json:"filesize"`
	Expunged     bool     `json:"expunged"`
	Rating       string   `json:"rating"`
	TorrentCount string   `json:"torrentcount"`
	Tags         []string `json:"tags"`
}

type Q added in v0.0.3

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

func And added in v0.0.3

func And(qs ...Q) Q

func Eq added in v0.0.3

func Eq(k TagK, v TagV) Q

func Like added in v0.0.3

func Like(k TagK, v TagV) Q

func Or added in v0.0.3

func Or(qs ...Q) Q

func (Q) Dump added in v0.0.4

func (q Q) Dump(prefix string, indent string, sep string) string

type TagK

type TagK = string
const (
	TagKAll       TagK = "*"
	TagKCategory  TagK = "category"
	TagKUploader  TagK = "uploader"
	TagKMisc      TagK = "misc"
	TagKExpunged  TagK = "expunged"
	TagKMinRating TagK = "min rating"
	TagKExists    TagK = "exists"
	TagKExistsIn  TagK = "exists in"
	TagKGId       TagK = "gid"
)
const (
	// title
	TagKRIdxTitlePrefix      TagK = "title "
	TagKRIdxTitleConvention  TagK = TagKRIdxTitlePrefix + rIdxTitleConvention
	TagKRIdxTitleGroup       TagK = TagKRIdxTitlePrefix + rIdxTitleGroup
	TagKRIdxTitleArtist      TagK = TagKRIdxTitlePrefix + rIdxTitleArtist
	TagKRIdxTitleTitle       TagK = TagKRIdxTitlePrefix + rIdxTitleTitle
	TagKRIdxTitleParody      TagK = TagKRIdxTitlePrefix + rIdxTitleParody
	TagKRIdxTitleTranslation TagK = TagKRIdxTitlePrefix + rIdxTitleTranslation
	// title jpn
	TagKRIdxTitleJpnPrefix      TagK = "title_jpn "
	TagKRIdxTitleJpnConvention  TagK = TagKRIdxTitleJpnPrefix + rIdxTitleConvention
	TagKRIdxTitleJpnGroup       TagK = TagKRIdxTitleJpnPrefix + rIdxTitleGroup
	TagKRIdxTitleJpnArtist      TagK = TagKRIdxTitleJpnPrefix + rIdxTitleArtist
	TagKRIdxTitleJpnTitle       TagK = TagKRIdxTitleJpnPrefix + rIdxTitleTitle
	TagKRIdxTitleJpnParody      TagK = TagKRIdxTitleJpnPrefix + rIdxTitleParody
	TagKRIdxTitleJpnTranslation TagK = TagKRIdxTitleJpnPrefix + rIdxTitleTranslation
)

rIdx

type TagV

type TagV = string
const (
	TagVExpungedFalse TagV = "0"
	TagVExpungedTrue  TagV = "1"
	TagVExistsFalse   TagV = "0"
	TagVExistsTrue    TagV = "1"
	TagVExistsInURL   TagV = "url"
	TagVExistsInFile  TagV = "file"
)

Jump to

Keyboard shortcuts

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