Documentation ¶
Index ¶
- Constants
- Variables
- func ResolveFilenameFromPath(pathRel string) string
- func SanitisePath(pathRel string) (string, error)
- func StringToHash(str string) *[sha256.Size]byte
- type Acquisition
- type Chapter
- type ChapterExt
- type ChapterHistory
- type ChapterImages
- type ChapterIndexOrder
- type ChapterRelation
- type CompletionState
- type CompletionStates
- type Debug
- func (d *Debug) Delete(key DebugPayload) error
- func (d *Debug) Get(key DebugPayload) (DebugPayload, error)
- func (d *Debug) Has(key DebugPayload) (bool, error)
- func (d *Debug) List() ([]DebugPayload, error)
- func (d *Debug) Put(key, value DebugPayload) error
- func (d *Debug) Stats() (leveldb.DBStats, error)
- type DebugPayload
- type DirectoryPageCache
- type ImageIDExt
- type ImageLinkBig
- type ImageLinkPage
- type ImageMeta
- type ImagePreviewCache
- type Instance
- func (s *Instance) AcquireDebug(acquisition Acquisition) *Debug
- func (s *Instance) AddImage(data []byte) ([sha256.Size]byte, error)
- func (s *Instance) AmendChapter(identifier string, images ChapterImages, order ChapterIndexOrder) error
- func (s *Instance) AmendImageExt(id int, source *string, creation **time.Time) error
- func (s *Instance) Close() error
- func (s *Instance) DrainSearchPrimers()
- func (s *Instance) DropQueue() error
- func (s *Instance) Export(dir string, printer func(msg string)) error
- func (s *Instance) FlushCaches() error
- func (s *Instance) FlushChapterCache() error
- func (s *Instance) FlushImagePageCache() error
- func (s *Instance) FlushIndexCache(relType RelationType) error
- func (s *Instance) FlushPathCache() error
- func (s *Instance) FlushRelationPageCache() error
- func (s *Instance) GetChapter(identifier string) (*Chapter, error)
- func (s *Instance) GetChapterExt(identifier string) (*ChapterExt, error)
- func (s *Instance) GetChapterPrimer(identifier string) (map[string]interface{}, error)
- func (s *Instance) GetImage(hash [sha256.Size]byte) ([]byte, error)
- func (s *Instance) GetImageHashByPath(pathRel string) ([sha256.Size]byte, error)
- func (s *Instance) GetImageMeta(hash [sha256.Size]byte) (ImageMeta, error)
- func (s *Instance) GetImageMetaByPath(pathRel string) (ImageMeta, error)
- func (s *Instance) GetImagePathByID(id int) (string, error)
- func (s *Instance) GetImagePreview(hash [sha256.Size]byte, big bool) ([]byte, error)
- func (s *Instance) GetImagesPage(rRef RelationReference, page int) (ImageLinkPage, int, error)
- func (s *Instance) GetIndex(relType RelationType, page int) (DirectoryPageCache, int, error)
- func (s *Instance) GetPathHash(pathRel string) (*[sha256.Size]byte, error)
- func (s *Instance) GetQueue() (*Queue, error)
- func (s *Instance) GetRelationPage(rRef RelationReference, page int, view uint8) (*RelationPageCacheHeader, RelationPageCache, RelationPageLinkCache, bool, ...)
- func (s *Instance) HasImage(hash [sha256.Size]byte) (bool, error)
- func (s *Instance) ImageExt(id int) (ImageIDExt, error)
- func (s *Instance) MakeSearchPrimer(results []SearchResult, r *SearchRequest) map[string]interface{}
- func (s *Instance) Open() error
- func (s *Instance) PutAnthology(relation, category, identifier string, clear bool) error
- func (s *Instance) PutAuthor(relation, category, identifier string, clear bool) error
- func (s *Instance) PutChapter(identifier, title, releasePost string, images ChapterImages, ...) error
- func (s *Instance) PutDoujin(relation, category, identifier string, clear bool) error
- func (s *Instance) PutImageID(id int, path string) error
- func (s *Instance) PutIssue(relation, category, identifier string, clear bool) error
- func (s *Instance) PutPairing(relation, category, identifier string, clear bool) error
- func (s *Instance) PutRelationOrder(rRef RelationReference, order []string) error
- func (s *Instance) PutScanlator(relation, category, identifier string, clear bool) error
- func (s *Instance) PutSeries(relation, category, identifier string, clear bool) error
- func (s *Instance) PutTag(relation, category, identifier string, clear bool) error
- func (s *Instance) Relation(rRef RelationReference) (*Relation, error)
- func (s *Instance) RelationAddImage(rRef RelationReference, image int) error
- func (s *Instance) RelationDeduplicateOrder() error
- func (s *Instance) RelationExt(rRef RelationReference) (*RelationExt, error)
- func (s *Instance) RelationSortImages() error
- func (s *Instance) ResolveRelationLink(rRef RelationReference) (RelationLink, error)
- func (s *Instance) Scrub() error
- func (s *Instance) Search(r *SearchRequest) ([]SearchResult, error)
- func (s *Instance) SearchInit() error
- func (s *Instance) SearchPrimer(r *SearchRequest, page int) (map[string]interface{}, int, error)
- func (s *Instance) SetImagePath(hash [sha256.Size]byte, pathRel string) error
- func (s *Instance) SetImageRelation(id int, rRef RelationReference, clear bool) error
- func (s *Instance) SetRemovedChapter(identifier string, removed bool) error
- func (s *Instance) Stats() (Stats, error)
- func (s *Instance) StoreQueue(queue *Queue) error
- func (s *Instance) Suggest(substr string) Suggest
- func (s *Instance) UpdateAnthology(relation string, alias, tag, pairing, author, doujin []string, ...) error
- func (s *Instance) UpdateAuthor(relation string, alias []string, name, url, description *string) error
- func (s *Instance) UpdateDoujin(relation string, alias, tag, pairing []string, name, description *string) error
- func (s *Instance) UpdateImageExt(id int, f func(extRef *ImageIDExt)) error
- func (s *Instance) UpdateIssue(relation string, alias, author []string, name, category *string, ...) error
- func (s *Instance) UpdatePairing(relation string, doujin, alias []string, name, category, description *string) error
- func (s *Instance) UpdateScanlator(relation string, alias []string, name, url, description *string) error
- func (s *Instance) UpdateSeries(relation string, chapterCategory map[string][]RelationChapterLink, ...) error
- func (s *Instance) UpdateTag(relation string, alias []string, name, description *string) error
- type Job
- type Page
- type Pages
- type PendingChapter
- type PendingChapterImages
- type Queue
- func (q *Queue) CommitSatisfied() error
- func (q *Queue) Dequeue() *Job
- func (q *Queue) Drop()
- func (q *Queue) Dump(writer io.Writer) error
- func (q *Queue) DumpChapter(writer io.Writer) error
- func (q *Queue) DumpDirect(writer io.Writer) error
- func (q *Queue) DumpIDCache(writer io.Writer) error
- func (q *Queue) HasChapter(identifier string) bool
- func (q *Queue) ID(id int) (string, bool)
- func (q *Queue) PutChapter(identifier, title, releasePost string, pathToIndex PendingChapterImages, ...) bool
- func (q *Queue) PutChapterAmend(identifier string, pathToIndex PendingChapterImages, order ChapterIndexOrder) bool
- func (q *Queue) PutDirect(id int, rRef RelationReference)
- func (q *Queue) PutRelOp(pathRel string, op RelOp) bool
- func (q *Queue) Queue(pathRel, source string, creation time.Time, identifier string, id int)
- func (q *Queue) Size() int
- func (q *Queue) SizeChapter() int
- func (q *Queue) SizeDirect() int
- func (q *Queue) SizeIDCache() int
- func (q *Queue) UpdateChapterExt(identifier string, ...) bool
- type RelOp
- type Relation
- type RelationChapterEntry
- type RelationChapterLink
- type RelationExt
- type RelationGenericEntry
- type RelationLink
- type RelationPageCache
- type RelationPageCacheHeader
- type RelationPageLinkCache
- type RelationReference
- type RelationType
- type SearchRequest
- type SearchRequestRaw
- type SearchResult
- type Stats
- type StatsCached
- type StatsSearch
- type Suggest
- type SuggestEntry
Constants ¶
const ( CacheDirectory = iota CacheRelationPage CacheImagePage CacheChapter CachePath CacheTotal )
const ( RelationViewChapter uint8 = iota RelationViewGrouping RelationViewOneShot RelationViewPairing RelationViewTotal )
const ( DateLayout = "Jan 2, 2006" DateLayoutIndex = "Jan 2 '06" )
const (
MissingCoverPath = "/assets/cover_missing_medium.png"
)
const Revision = 2
Revision is the revision of the database format
Variables ¶
Functions ¶
func ResolveFilenameFromPath ¶
ResolveFilenameFromPath resolves an image's file name from a pathRel string
func SanitisePath ¶
SanitisePath sanitises a pathRel obtained from the website
Types ¶
type Acquisition ¶
type Acquisition struct {
// contains filtered or unexported fields
}
func DebugImage ¶
func DebugImage(t uint8) (a Acquisition)
DebugImage returns an Acquisition struct for specified image database
func DebugInternal ¶
func DebugInternal() (a Acquisition)
DebugInternal returns an Acquisition struct for the internal database
func DebugRelation ¶
func DebugRelation(relType RelationType, ext bool) (a Acquisition)
DebugRelation returns an Acquisition struct for specified relation, where ext is whether the extended index is acquired
type Chapter ¶
type Chapter struct { // Title is the title of the chapter Title string `json:"title"` // Creation records the time of creation of the chapter in database Creation time.Time `json:"creation"` // Release records the date/time of release of the chapter Release time.Time `json:"release"` // ReleasePost is the URL of the release post of the chapter ReleasePost string `json:"release_post"` // Images is an index to pathRel mapping Images ChapterImages `json:"images"` // Order stores the order of indexes Order ChapterIndexOrder `json:"order"` // contains filtered or unexported fields }
Chapter represents a chapter's metadata
func (*Chapter) Diff ¶
func (c *Chapter) Diff(images ChapterImages, order ChapterIndexOrder) bool
Diff returns whether chapter contents is identical
func (*Chapter) DiffPath ¶
func (c *Chapter) DiffPath(pathToIndex PendingChapterImages, order ChapterIndexOrder) bool
DiffPath diffs against path to index mapping instead
type ChapterExt ¶
type ChapterExt struct { Anthologies []ChapterRelation `json:"anthologies"` Doujins []ChapterRelation `json:"doujins"` Issues []ChapterRelation `json:"issues"` Series []ChapterRelation `json:"series"` Authors []ChapterRelation `json:"authors"` // note that chapters inherit authors from their series Scanlators []ChapterRelation `json:"scanlators"` Tags []ChapterRelation `json:"tags"` Pairings []ChapterRelation `json:"pairings"` // Xattr are extended attributes for internal housekeeping data Xattr map[string]any `json:"-"` }
ChapterExt are scalable extension data of a chapter
func (*ChapterExt) Has ¶
func (ext *ChapterExt) Has(relType RelationType, rel ChapterRelation) bool
Has returns whether a ChapterExt already has a relation
func (*ChapterExt) InheritAuthors ¶
func (ext *ChapterExt) InheritAuthors(s *Instance) error
InheritAuthors inherits authors from series
func (*ChapterExt) Removed ¶
func (ext *ChapterExt) Removed() bool
Removed returns whether chapter is recorded to have been removed from dynasty scans
type ChapterHistory ¶
type ChapterHistory map[time.Time]struct { ChapterImages ChapterIndexOrder }
ChapterHistory are snapshots of the chapter at the time of change, appended to when the chapter is amended
type ChapterImages ¶
ChapterImages are index to image mapping in a chapter
type ChapterIndexOrder ¶
type ChapterIndexOrder []string
ChapterIndexOrder is a slice storing order of chapter image indexes
type ChapterRelation ¶
ChapterRelation stores the relation name and category name of a chapter relation in ChapterExt
type CompletionState ¶
type CompletionState uint8
const ( CompletionAbandoned CompletionState = iota CompletionCancelled CompletionCompleted CompletionDropped CompletionLicensed CompletionOnHiatus CompletionOnHold CompletionOngoing CompletionRemoved CompletionTotal )
func (CompletionState) String ¶
func (c CompletionState) String() string
type CompletionStates ¶
type CompletionStates [CompletionTotal]bool
func (CompletionStates) All ¶
func (s CompletionStates) All() []CompletionState
All returns all CompletionState available in CompletionStates
func (CompletionStates) Has ¶
func (s CompletionStates) Has(c CompletionState) bool
Has returns whether CompletionState has a specific CompletionState
func (CompletionStates) String ¶
func (s CompletionStates) String() string
type Debug ¶
type Debug struct {
// contains filtered or unexported fields
}
func (*Debug) Delete ¶
func (d *Debug) Delete(key DebugPayload) error
func (*Debug) Get ¶
func (d *Debug) Get(key DebugPayload) (DebugPayload, error)
func (*Debug) Has ¶
func (d *Debug) Has(key DebugPayload) (bool, error)
func (*Debug) List ¶
func (d *Debug) List() ([]DebugPayload, error)
func (*Debug) Put ¶
func (d *Debug) Put(key, value DebugPayload) error
type DebugPayload ¶
type DebugPayload []byte
func (DebugPayload) String ¶
func (d DebugPayload) String() string
type DirectoryPageCache ¶
type DirectoryPageCache struct { Index []string Body map[string][]RelationLink Cover map[string]string }
type ImageIDExt ¶
type ImageIDExt struct { // Relations are direct image relations associated with the image Relations map[RelationReference]bool `json:"relations,omitempty"` // Source is the source of an image Source string `json:"source,omitempty"` // Creation is the creation time of the image on dynasty scans Creation *time.Time `json:"creation,omitempty"` }
func (ImageIDExt) RelationsSlice ¶
func (i ImageIDExt) RelationsSlice() []RelationReference
type ImageLinkPage ¶
type ImageLinkPage []ImageLinkBig
type ImageMeta ¶
type ImagePreviewCache ¶
ImagePreviewCache stores 10 structs where if ID equals to or greater than zero is an image ID, otherwise indicates an unset slot
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func (*Instance) AcquireDebug ¶
func (s *Instance) AcquireDebug(acquisition Acquisition) *Debug
AcquireDebug acquires Debug from an Acquisition struct
func (*Instance) AddImage ¶
AddImage hashes an image and writes it and its metadata into the store
func (*Instance) AmendChapter ¶
func (s *Instance) AmendChapter(identifier string, images ChapterImages, order ChapterIndexOrder) error
AmendChapter amends an existing chapter unconditionally and stores a snapshot of the chapter contents and modification date
func (*Instance) AmendImageExt ¶
AmendImageExt amends a direct relation image's extended metadata
func (*Instance) DrainSearchPrimers ¶
func (s *Instance) DrainSearchPrimers()
DrainSearchPrimers re-initialises the search primer cache
func (*Instance) DropQueue ¶
DropQueue drops the queue on a database level
func (*Instance) Export ¶
Export exports all chapters and basic metadata to the specified directory
func (*Instance) FlushCaches ¶
FlushCaches flushes all caches
func (*Instance) FlushIndexCache ¶
func (s *Instance) FlushIndexCache(relType RelationType) error
func (*Instance) GetChapter ¶
GetChapter returns primary metadata of a chapter
func (*Instance) GetChapterExt ¶
func (s *Instance) GetChapterExt(identifier string) (*ChapterExt, error)
GetChapterExt returns extended metadata of a chapter
func (*Instance) GetChapterPrimer ¶
func (*Instance) GetImage ¶
GetImage returns an image's data
func (*Instance) GetImageHashByPath ¶
GetImageHashByPath returns an image's hash by path
func (*Instance) GetImageMeta ¶
GetImageMeta returns an image's metadata
func (*Instance) GetImageMetaByPath ¶
GetImageMetaByPath returns an image's metadata from its pathRel
func (*Instance) GetImagePathByID ¶
GetImagePathByID returns path of image by ID
func (*Instance) GetImagePreview ¶
GetImagePreview returns an image's preview data (always in jpeg)
func (*Instance) GetImagesPage ¶
func (s *Instance) GetImagesPage(rRef RelationReference, page int) (ImageLinkPage, int, error)
func (*Instance) GetIndex ¶
func (s *Instance) GetIndex(relType RelationType, page int) (DirectoryPageCache, int, error)
func (*Instance) GetPathHash ¶
func (*Instance) GetQueue ¶
GetQueue gets the state of the current queue from disk
func (*Instance) GetRelationPage ¶
func (s *Instance) GetRelationPage(rRef RelationReference, page int, view uint8) (*RelationPageCacheHeader, RelationPageCache, RelationPageLinkCache, bool, error)
func (*Instance) HasImage ¶
HasImage returns whether an image exists
func (*Instance) ImageExt ¶
func (s *Instance) ImageExt(id int) (ImageIDExt, error)
ImageExt returns extended metadata of a direct relation image
func (*Instance) MakeSearchPrimer ¶
func (s *Instance) MakeSearchPrimer(results []SearchResult, r *SearchRequest) map[string]interface{}
MakeSearchPrimer generates a search primer from a search result slice
func (*Instance) Open ¶
Open opens all databases on an instance; cannot be used if already open
func (*Instance) PutAnthology ¶
PutAnthology adds an anthology relation
func (*Instance) PutAuthor ¶
PutAuthor adds an author relation
func (*Instance) PutChapter ¶
func (s *Instance) PutChapter(identifier, title, releasePost string, images ChapterImages, order ChapterIndexOrder, release time.Time) error
PutChapter adds a new chapter with unique identifier string found in the URLs, with specified images and release date
func (*Instance) PutDoujin ¶
PutDoujin adds a doujin relation
func (*Instance) PutImageID ¶
PutImageID puts image ID to path reference
func (*Instance) PutIssue ¶
PutIssue adds an issue relation
func (*Instance) PutPairing ¶
PutPairing adds a pairing relation
func (*Instance) PutRelationOrder ¶
func (s *Instance) PutRelationOrder(rRef RelationReference, order []string) error
PutRelationOrder puts an order slice to a relation
func (*Instance) PutScanlator ¶
PutScanlator adds a scanlator relation
func (*Instance) PutSeries ¶
PutSeries adds a series relation
func (*Instance) PutTag ¶
PutTag adds a tag relation
func (*Instance) Relation ¶
func (s *Instance) Relation(rRef RelationReference) (*Relation, error)
Relation returns a relation's base metadata
func (*Instance) RelationAddImage ¶
func (s *Instance) RelationAddImage(rRef RelationReference, image int) error
RelationAddImage adds a direct image reference to a relation
func (*Instance) RelationDeduplicateOrder ¶
RelationDeduplicateOrder de-duplicates the order slice of relations; this is necessary because the final page of any relation contains a duplicate entry as its first entry
func (*Instance) RelationExt ¶
func (s *Instance) RelationExt(rRef RelationReference) (*RelationExt, error)
RelationExt returns a relation's extended metadata
func (*Instance) RelationSortImages ¶
RelationSortImages sorts direct relation images
func (*Instance) ResolveRelationLink ¶
func (s *Instance) ResolveRelationLink(rRef RelationReference) (RelationLink, error)
ResolveRelationLink resolves a relation's RelationLink; avoid this method unless the Relation it fetches is not needed for anything else
func (*Instance) Scrub ¶
Scrub performs some miscellaneous database maintenance items
func (*Instance) Search ¶
func (s *Instance) Search(r *SearchRequest) ([]SearchResult, error)
Search returns up to searchEntryLimit SearchResult matching the SearchRequest, or nil if the SearchRequest is invalid
func (*Instance) SearchInit ¶
SearchInit loads search-related data into memory
func (*Instance) SearchPrimer ¶
SearchPrimer returns a search primer from a SearchRequest
func (*Instance) SetImagePath ¶
SetImagePath sets an image hash's associated path
func (*Instance) SetImageRelation ¶
func (s *Instance) SetImageRelation(id int, rRef RelationReference, clear bool) error
SetImageRelation creates a direct association between a direct relation image and a relation
func (*Instance) SetRemovedChapter ¶
SetRemovedChapter sets the removed extended attribute of a chapter
func (*Instance) Stats ¶
Stats returns a copy of system-wide stats
func (*Instance) StoreQueue ¶
StoreQueue stores the state of the current queue on disk
func (*Instance) Suggest ¶
Suggest suggests up to suggestLimit relations from a substring
func (*Instance) UpdateAnthology ¶
func (s *Instance) UpdateAnthology(relation string, alias, tag, pairing, author, doujin []string, name, description *string, completion *CompletionStates) error
UpdateAnthology updates the metadata of an anthology
func (*Instance) UpdateAuthor ¶
func (s *Instance) UpdateAuthor(relation string, alias []string, name, url, description *string) error
UpdateAuthor updates the metadata of an author; image can be set separately
func (*Instance) UpdateDoujin ¶
func (s *Instance) UpdateDoujin(relation string, alias, tag, pairing []string, name, description *string) error
UpdateDoujin updates the metadata of a doujin; image can be set separately
func (*Instance) UpdateImageExt ¶
func (s *Instance) UpdateImageExt(id int, f func(extRef *ImageIDExt)) error
UpdateImageExt provides a reference to an ImageIDExt struct to update
func (*Instance) UpdateIssue ¶
func (s *Instance) UpdateIssue(relation string, alias, author []string, name, category *string, completion *CompletionStates) error
UpdateIssue updates the metadata of an issue; note that completion state is set as-is unconditionally as it is optional
func (*Instance) UpdatePairing ¶
func (s *Instance) UpdatePairing(relation string, doujin, alias []string, name, category, description *string) error
UpdatePairing updates the metadata of a pairing; image can be set separately
func (*Instance) UpdateScanlator ¶
func (s *Instance) UpdateScanlator(relation string, alias []string, name, url, description *string) error
UpdateScanlator updates the metadata of a scanlator; category is a chapter to category map; image can be set separately
func (*Instance) UpdateSeries ¶
func (s *Instance) UpdateSeries(relation string, chapterCategory map[string][]RelationChapterLink, chapterCategoryOrder, alias, tag, pairing, author, doujin []string, name, description *string, completion *CompletionStates) error
UpdateSeries updates the metadata of a series; category is a chapter to category name map; image can be set separately
type Job ¶
type Job struct { Path string `json:"path"` Source string `json:"source,omitempty"` Creation *time.Time `json:"creation,omitempty"` ID int `json:"id,omitempty"` // Satisfies are chapter identifiers that Job satisfies on completion Satisfies map[string]bool `json:"-"` // Relation are pending relation operations for current image Relation []*RelOp `json:"-"` // contains filtered or unexported fields }
Job is a pending image download job, uniquely identified by its path in place of its to-be-acquired digest
func (*Job) Finalise ¶
Finalise commits the image into the database and completes its satisfaction information
type Page ¶
Page is information of a page, appearing in the web pages
type PendingChapter ¶
type PendingChapter struct { Title string `json:"title"` Identifier string `json:"identifier"` Release time.Time `json:"release"` ReleasePost string `json:"release_post"` Ext *ChapterExt `json:"ext"` // SatisfiedBy are jobs that satisfy the pending chapter SatisfiedBy map[string]bool `json:"satisfied_by"` // Satisfied is a ChapterImages map containing already satisfied images Satisfied ChapterImages `json:"satisfied"` // Amend stores whether the chapter should be an amendment Amend bool `json:"amend"` // PathToIndex is a relative path to index map used to construct the index to hash map on satisfaction PathToIndex PendingChapterImages `json:"-"` // Order is identical to the Order field in Chapter Order ChapterIndexOrder `json:"-"` }
PendingChapter is a chapter pending satisfaction from a slice of Job
type PendingChapterImages ¶
PendingChapterImages is a relative path to index map storing a pending chapter's images
type Queue ¶
func (*Queue) CommitSatisfied ¶
CommitSatisfied commits all fully satisfied PendingChapter and direct image relations
func (*Queue) Dequeue ¶
Dequeue removes an entry from the queue and returns it; the item being returned is undefined behaviour and thus shall not be relied on for order; trying to dequeue an empty queue returns nil
func (*Queue) Dump ¶
Dump dumps queue content in JSON to a writer
func (*Queue) DumpChapter ¶
DumpChapter dumps pending chapters in JSON to a writer
func (*Queue) DumpDirect ¶
DumpDirect dumps pending direct image relations in JSON to a writer
func (*Queue) DumpIDCache ¶
DumpIDCache dumps the ID cache in JSON to a writer
func (*Queue) HasChapter ¶
HasChapter returns whether the Queue already holds a PendingChapter with the specified identifier
func (*Queue) ID ¶
ID returns the in-queue pathRel of an ID
func (*Queue) PutChapter ¶
func (q *Queue) PutChapter(identifier, title, releasePost string, pathToIndex PendingChapterImages, order ChapterIndexOrder, release time.Time) bool
PutChapter adds a PendingChapter to the Queue
func (*Queue) PutChapterAmend ¶
func (q *Queue) PutChapterAmend(identifier string, pathToIndex PendingChapterImages, order ChapterIndexOrder) bool
PutChapterAmend adds an amending PendingChapter to the Queue
func (*Queue) PutDirect ¶
func (q *Queue) PutDirect(id int, rRef RelationReference)
PutDirect adds a direct image relation to the Queue
func (*Queue) PutRelOp ¶
PutRelOp registers a relation operation on a queued Job
func (*Queue) Queue ¶
Queue adds a Job to the Queue
func (*Queue) SizeChapter ¶
SizeChapter returns the size of pending chapters
func (*Queue) SizeDirect ¶
SizeDirect returns the size of pending direct image relations
func (*Queue) SizeIDCache ¶
SizeIDCache returns the size of the ID cache
func (*Queue) UpdateChapterExt ¶
func (q *Queue) UpdateChapterExt(identifier string, update func(extRef *ChapterExt, relLookup func(relType RelationType) *[]ChapterRelation)) bool
UpdateChapterExt updates a PendingChapter's Ext field
type RelOp ¶
type RelOp struct { Cover bool RelationReference }
RelOp represents a pending relation operation for when a job is complete
type Relation ¶
type Relation struct { // Name is the friendly name of the relation Name string `json:"name"` // Tag are tags associated with the relation Tag []string `json:"tag"` // Pairing are special pairing tags associated with the relation Pairing []string `json:"pairing"` // Author is optional author information Author []string `json:"author,omitempty"` // Doujin is the optional doujin information Doujin []string `json:"doujin,omitempty"` // Description is the optional description string Description string `json:"description,omitempty"` // Category is the relation's category, not applicable to all relations Category string `json:"category,omitempty"` // Cover is the pathRel of the relation's cover, not applicable to all relations Cover string `json:"cover,omitempty"` // Completion is the completion state of the relation, not applicable to all relations Completion CompletionStates `json:"completion"` // URL is the URL of the relation, not applicable to all relations URL string `json:"url,omitempty"` // Alias are alternative friendly names for the relation, not applicable to all relations Alias []string `json:"alias,omitempty"` }
Relation stores base relation metadata
type RelationChapterEntry ¶
type RelationChapterEntry struct { Chapter RelationChapterLink Author, Doujin, Tag, Pairing, Series []RelationLink ReleaseDate string // Category is set when this entry is a category spacer Category string IsCat bool }
type RelationExt ¶
type RelationExt struct { // Chapter are category to chapter mapping associated to the relation Chapter map[string][]string `json:"chapter"` // Order is the order of chapter identifiers, does not have to exist Order []string `json:"order"` // Image are standalone image IDs associated with the relation, not applicable to all relations Image []int `json:"image,omitempty"` // ChapterCategory is a category to RelationChapterLink map, not applicable to all relations ChapterCategory map[string][]RelationChapterLink `json:"chapter_category"` // CategoryOrder is the order of all category strings CategoryOrder []string `json:"category_order"` // Xattr are extended attributes for internal housekeeping data Xattr map[string]interface{} `json:"-"` }
RelationExt stores extended relation metadata
type RelationLink ¶
type RelationLink struct { Name string RelationReference }
func (RelationLink) String ¶
func (r RelationLink) String() string
type RelationPageCache ¶
type RelationPageCache []RelationChapterEntry
type RelationPageCacheHeader ¶
type RelationPageCacheHeader struct { // Pages is negative when relation is explicitly not paged Pages [RelationViewTotal]int Alias []string Images *ImagePreviewCache Cover string Completion CompletionStates // exact values in relation storage Title, Description, URL, Category string // these are for relation-wide relation links, should not overlap with guests Author, Doujin, Tags, Pairings []RelationLink // this is for author relations Series []relationLinkWithCover // this stores inline entries for relations with paging disabled Inline RelationPageCache // this is currently specific to series InlineOverride RelationPageCache }
RelationPageCacheHeader is a header that stores relation-wide cache information
type RelationPageLinkCache ¶
type RelationPageLinkCache []RelationGenericEntry
type RelationReference ¶
type RelationReference struct { Relation string RelType RelationType }
type RelationType ¶
type RelationType uint8
const ( RelationAnthology RelationType = iota RelationDoujin RelationIssue RelationSeries RelationAuthor RelationScanlator RelationTag RelationPairing RelationTotal )
func ParseRelation ¶
func ParseRelation(str string) RelationType
ParseRelation finds the corresponding relation of str
func (RelationType) String ¶
func (t RelationType) String() string
func (RelationType) StringPlural ¶
func (t RelationType) StringPlural() string
type SearchRequest ¶
type SearchRequest struct { SearchRequestRaw // contains filtered or unexported fields }
func (SearchRequest) Advanced ¶
func (r SearchRequest) Advanced() bool
type SearchRequestRaw ¶
type SearchResult ¶
type SearchResult struct { Tag bool Authors, Tags []RelationLink Release, Creation time.Time RelationLink }
func (*SearchResult) ReleaseDate ¶
func (s *SearchResult) ReleaseDate() string
type Stats ¶
type Stats struct { Search StatsSearch StatsCached }
type StatsCached ¶
type StatsCached struct {
Chapter, Paths, Hashes int
Relation [RelationTotal]int
}
type Suggest ¶
type Suggest []SuggestEntry
type SuggestEntry ¶
type SuggestEntry struct { // ID stores the unique relation string of the entry ID string `json:"id"` // this was supposed to be an integer, but I'll have relation here instead // Name stores the friendly name of the relation Name string `json:"name"` // Type stores the singular title case name of the relation, with tag being General as an exception Type string `json:"type"` }