tasks

package
v0.0.0-...-62de999 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: AGPL-3.0 Imports: 36 Imported by: 0

Documentation

Overview

Package tasks contains the bookmark and collection related tasks.

Index

Constants

This section is empty.

Variables

View Source
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

func CleanDomProcessor(m *extract.ProcessMessage, next extract.Processor) extract.Processor

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(ctx context.Context) bookmarks.BookmarkLinks

GetExtractedLinks returns the extracted link list previously stored in the extractor context.

func OriginalLinkProcessor

func OriginalLinkProcessor(m *extract.ProcessMessage, next extract.Processor) extract.Processor

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

type LabelDeleteParams struct {
	UserID int
	Name   string
}

LabelDeleteParams contains the label deletion parameters.

type MultipartResource

type MultipartResource struct {
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
	Data    []byte            `json:"data"`
}

MultipartResource contains information loaded from a form/multipart request body.

Jump to

Keyboard shortcuts

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