tasks

package
v0.0.0-...-60192f8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 34 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      superbus.Task // ExtractPageTask is the bookmark creation task.
	DeleteBookmarkTask   superbus.Task // DeleteBookmarkTask is the bookmark deletion task.
	DeleteCollectionTask superbus.Task // DeleteCollectionTask is the collection deletion task.
	DeleteLabelTask      superbus.Task // DeleteLabelTask is the label deletion 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.

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