Documentation
¶
Overview ¶
Package tasks contains the bookmark and collection related tasks.
Index ¶
- Variables
- func CleanDomProcessor(m *extract.ProcessMessage, next extract.Processor) extract.Processor
- func ExtractPage(params ExtractParams)
- func GetExtractedLinks(ctx context.Context) bookmarks.BookmarkLinks
- func OriginalLinkProcessor(m *extract.ProcessMessage, next extract.Processor) extract.Processor
- type ExtractParams
- type LabelDeleteParams
- type MultipartResource
Constants ¶
This section is empty.
Variables ¶
var ( // ExtractPageTask is the bookmark creation task. ExtractPageTask superbus.Task // DeleteBookmarkTask is the bookmark deletion task. DeleteBookmarkTask superbus.Task // DeleteCollectionTask is the collection deletion task. DeleteCollectionTask superbus.Task // DeleteLabelTask is the label deletion task. DeleteLabelTask superbus.Task )
Functions ¶
func CleanDomProcessor ¶
CleanDomProcessor is a last pass of cleaning on the resulting DOM node. It removes unwanted attributes, empty tags and set some defaults.
func ExtractPage ¶
func ExtractPage(params ExtractParams)
ExtractPage is the public function that run an extraction synchronously. Caution: it will panic and should only be run insisde another task.
func GetExtractedLinks ¶
func GetExtractedLinks(ctx context.Context) bookmarks.BookmarkLinks
GetExtractedLinks returns the extracted link list previously stored in the extractor context.
func OriginalLinkProcessor ¶
OriginalLinkProcessor looks for a rel=original link in HTTP headers. If it finds one, it sets the extracted URL to the original one. In the special case where a "readeck-original" header is present, it fully swaps the extracted page to its original version.
Types ¶
type ExtractParams ¶
type ExtractParams struct { BookmarkID int RequestID string Resources []MultipartResource FindMain bool }
ExtractParams contains the extraction parameters.
type LabelDeleteParams ¶
LabelDeleteParams contains the label deletion parameters.