core

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSupportedImageType = errors.New("unsupported image type")

Functions

func DownloadBookImage added in v1.6.0

func DownloadBookImage(deps *dependencies.Dependencies, url, dstPath string) error

func DownloadBookmark

func DownloadBookmark(url string) (io.ReadCloser, string, error)

DownloadBookmark downloads bookmarked page from specified URL. Return response body, make sure to close it later.

func GenerateEbook added in v1.5.5

func GenerateEbook(deps *dependencies.Dependencies, req ProcessRequest, dstPath string) (book model.BookmarkDTO, err error)

GenerateEbook receives a `ProcessRequest` and generates an ebook file in the destination path specified. The destination path `dstPath` should include file name with ".epub" extension The bookmark model will be used to update the UI based on whether this function is successful or not.

func ProcessBookmark

func ProcessBookmark(deps *dependencies.Dependencies, req ProcessRequest) (book model.BookmarkDTO, isFatalErr bool, err error)

ProcessBookmark process the bookmark and archive it if needed. Return three values, is error fatal, and error value.

func RemoveUTMParams

func RemoveUTMParams(url string) (string, error)

RemoveUTMParams removes the UTM parameters from URL.

Types

type ProcessRequest

type ProcessRequest struct {
	DataDir     string
	Bookmark    model.BookmarkDTO
	Content     io.Reader
	ContentType string
	KeepTitle   bool
	KeepExcerpt bool
	LogArchival bool
}

ProcessRequest is the request for processing bookmark.

Jump to

Keyboard shortcuts

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