handler

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Overview

Package handler handles parsing and processing of bookmark data operations.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOption = errors.New("invalid option")
	ErrNoItems       = errors.New("no items")
)
View Source
var ErrURLParamsNotFound = errors.New("params not found")

Functions

func CheckStatus

func CheckStatus(a *app.Context, bs []*bookmark.Bookmark) error

CheckStatus prints the status code of the bookmark URL.

func Copy

func Copy(bs []*bookmark.Bookmark) error

Copy copies the URLs to the system clipboard.

func Data

func Data(a *app.Context, m *menu.Menu[bookmark.Bookmark], args []string) ([]*bookmark.Bookmark, error)

Data retrieves and filters bookmarks based on configuration and arguments.

func DroppingDB

func DroppingDB(a *app.Context) error

DroppingDB drops a database.

func Edit added in v0.1.16

func Edit(a *app.Context, bs []*bookmark.Bookmark) error

Edit edits the bookmarks using a text editor.

func Export added in v0.1.22

func Export(bs []*bookmark.Bookmark) error

func FindDB

func FindDB(p string) (string, error)

FindDB returns the path to the database.

func LockRepo

func LockRepo(a *app.Context, rToLock string) error

LockRepo locks the database.

func MenuMainForRecords[T comparable](cfg *config.Config) *menu.Menu[T]

MenuMainForRecords builds the interactive FZF menu for selecting records.

func MenuSimple[T comparable](cfg *config.Config, opts ...menu.Option) *menu.Menu[T]

MenuSimple builds a simpler menu without all keybindings.

func NewBookmark added in v0.1.15

func NewBookmark(a *app.Context, b *bookmark.Bookmark, args []string) error

NewBookmark fetch metadata and parses the new bookmark.

func Open

func Open(a *app.Context, bs []*bookmark.Bookmark) error

Open opens the URLs in the browser for the bookmarks in the provided Slice.

func ParamHighlight added in v0.1.31

func ParamHighlight(raw string, color ansi.SGR, styles ...ansi.SGR) string

ParamHighlight returns the URL with its query parameters highlighted with the given ansi code.

func ParamsFilter added in v0.1.31

func ParamsFilter(bs []*bookmark.Bookmark) []*bookmark.Bookmark

ParamsFilter returns bookmarks that contain URL query parameters.

func ParamsURL added in v0.1.31

func ParamsURL(a *app.Context, bs []*bookmark.Bookmark) error

ParamsURL processes and optionally cleans query params for each bookmark.

func QR

func QR(a *app.Context, bs []*bookmark.Bookmark, open bool, appName string) error

QR handles creation, rendering or opening of QR-Codes.

func Remove

func Remove(a *app.Context, bs []*bookmark.Bookmark) error

Remove prompts the user the records to remove.

func RemoveBackups

func RemoveBackups(a *app.Context) error

RemoveBackups removes backups.

func RemoveRepo

func RemoveRepo(a *app.Context) error

RemoveRepo removes a repo.

func SaveNewBookmark added in v0.1.15

func SaveNewBookmark(a *app.Context, b *bookmark.Bookmark) error

SaveNewBookmark asks the user if they want to save the bookmark.

func SelectBackupMany added in v0.1.16

func SelectBackupMany(a *app.Context, root, header string) ([]string, error)

func SelectBackupOne added in v0.1.16

func SelectBackupOne(a *app.Context, bks []string) (string, error)

SelectBackupOne lets the user choose a backup and handles decryption if needed.

func SelectDatabase added in v0.1.15

func SelectDatabase(a *app.Context, ignoreDBPath string) (string, error)

func SelectFileLocked

func SelectFileLocked(a *app.Context, root, header string) ([]string, error)

SelectFileLocked lets the user choose a repo from a list of locked repos found in the given root directory.

func Snapshot added in v0.1.22

func Snapshot(a *app.Context, bs []*bookmark.Bookmark) error

func UnlockRepo

func UnlockRepo(a *app.Context, rToUnlock string) error

UnlockRepo unlocks the database.

func Update added in v0.1.16

func Update(a *app.Context, bs []*bookmark.Bookmark) error

Update updates the bookmarks.

It uses the scraper to update the title, description and favicon.

func WaybackLatestSnapshot added in v0.1.30

func WaybackLatestSnapshot(a *app.Context, bs []*bookmark.Bookmark) error

func WaybackSnapshots added in v0.1.30

func WaybackSnapshots(a *app.Context, bs []*bookmark.Bookmark) error

Types

type ParamsProcessor added in v0.1.31

type ParamsProcessor struct {
	// contains filtered or unexported fields
}

type SnapshotResult added in v0.1.30

type SnapshotResult struct {
	URL   string
	State string // "skipped", "error", "success"
	Msg   string
}

Jump to

Keyboard shortcuts

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