armaria

package
v0.0.45 Latest Latest
Warning

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

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

Documentation

Overview

Armaria is a fast, open, and local first bookmarks manager.

Index

Constants

View Source
const DirectionAsc = db.DirectionAsc
View Source
const DirectionDesc = db.DirectionDesc
View Source
const OrderManual = db.OrderManual
View Source
const OrderModified = db.OrderModified
View Source
const OrderName = db.OrderName

Variables

View Source
var (
	// ErrNoUpdate is returned when an update is requested with no updates.
	ErrNoUpdate = errors.New("no update")
	// ErrBookNotFound is returned when a target bookmark was not found.
	ErrBookNotFound = errors.New("bookmark not found")
	// ErrFolderNotFound is returned when a target folder was not found.
	ErrFolderNotFound = errors.New("folder not found")
	// ErrTagNotFound is returned when a target tag was not found.
	ErrTagNotFound = errors.New("tag not found")
	// ErrNotFound is returned when a target bookmark or folder was not found.
	ErrNotFound = errors.New("bookmark or folder not found")
	// ErrURLTooShort is returned when a provided URL is too short.
	ErrURLTooShort = errors.New("URL too short")
	// ErrURLTooLong is too long when a provided URL is too long.
	ErrURLTooLong = errors.New("URL too long")
	// ErrNameTooShort is returned when a provided name is too short.
	ErrNameTooShort = errors.New("name too short")
	// ErrNameTooLong is returned when a provided name is too long.
	ErrNameTooLong = errors.New("name too long")
	// ErrDescriptionTooShort is returned when a provided description is too short.
	ErrDescriptionTooShort = errors.New("description too short")
	// ErrDescriptionTooLong is returned when a provided description is too long.
	ErrDescriptionTooLong = errors.New("description too long")
	// ErrTagTooShort is returned when a provided tag is too short.
	ErrTagTooShort = errors.New("tag too short")
	// ErrTagTooLong is returned when a provided tag is too long.
	ErrTagTooLong = errors.New("tag too long")
	// ErrDuplicateTag is returned when a tag is applied twice to a bookmark.
	ErrDuplicateTag = errors.New("tags must be unique")
	// ErrTooManyTags is returned when too many tags have been applied to bookmark.
	ErrTooManyTags = errors.New("too many tags")
	// ErrTagInvalidChar is returned when a provided tag has an invalid character.
	ErrTagInvalidChar = errors.New("tag had invalid chars")
	// ErrFirstTooSmall is returned when a provided first is too small.
	ErrFirstTooSmall = errors.New("first too small")
	// ErrInvalidOrder is returned when a provided order is invalid.
	ErrInvalidOrder = errors.New("invalid order")
	// ErrInvalidDirection is returned when a provided direction is invalid.
	ErrInvalidDirection = errors.New("invalid direction")
	// ErrQueryTooShort is returned when a provided query is too short.
	ErrQueryTooShort = errors.New("query too short")
	// ErrInvalidOrdering is returned previous book >= next book for manual ordering.
	ErrInvalidOrdering = errors.New("invalid ordering")
)
View Source
var ErrConfigMissing = config.ErrConfigMissing

Functions

func DefaultAddBookOptions

func DefaultAddBookOptions() *addBookOptions

DefaultAddBookOptions are the default options for AddBook.

func DefaultAddFolderOptions

func DefaultAddFolderOptions() *addFolderOptions

DefaultAddFolderOptions are the default options for AddFolder.

func DefaultAddTagsOptions

func DefaultAddTagsOptions() *addTagsOptions

DefaultAddTagsOptions are the default options for AddTags.

func DefaultGetBookOptions

func DefaultGetBookOptions() *getBookOptions

DefaultGetBookOptions are the default options for GetBook.

func DefaultGetParentNameOptions

func DefaultGetParentNameOptions() *getParentNameOptions

DefaultGetParentNameOptions are the default options for GetParentNames.

func DefaultListBooksOptions

func DefaultListBooksOptions() *listBookOptions

DefaultListBooksOptions are the default options for ListBooks.

func DefaultListTagsOptions

func DefaultListTagsOptions() *listTagsOptions

DefaultListTagsOptions are the default options for ListTags.

func DefaultRemoveBookOptions

func DefaultRemoveBookOptions() *removeBookOptions

DefaultRemoveBookOptions are the default options for RemoveBook.

func DefaultRemoveFolderOptions

func DefaultRemoveFolderOptions() *removeFolderOptions

DefaultRemoveFolderOptions are the default options for RemoveFolder.

func DefaultRemoveTagsOptions

func DefaultRemoveTagsOptions() *removeTagsOptions

DefaultRemoveTagsOptions are the default options for RemoveTags.

func DefaultUpdateBookOptions

func DefaultUpdateBookOptions() *updateBookOptions

DefaultUpdateBookOptions are the default options for UpdateBook.

func DefaultUpdateFolderOptions

func DefaultUpdateFolderOptions() *updateFolderOptions

DefaultUpdateFolderOptions are the default options for UpdateFolder.

func GetParentNames

func GetParentNames(ID string, options *getParentNameOptions) ([]string, error)

GetParentNames gets the parent names of a bookmark or folder.

func InstallManifestChrome

func InstallManifestChrome() error

InstallManifestChrome installs the app manifest for Firefox.

func InstallManifestChromium

func InstallManifestChromium() error

InstallManifestChromium installs the app manifest for Firefox.

func InstallManifestFirefox

func InstallManifestFirefox() error

InstallManifestFirefox installs the app manifest for Firefox.

func ListTags

func ListTags(options *listTagsOptions) ([]string, error)

ListTags lists tags in the bookmarks database.

func RemoveBook

func RemoveBook(id string, options *removeBookOptions) (err error)

RemoveBook removes a bookmark from the bookmarks database.

func RemoveFolder

func RemoveFolder(id string, options *removeFolderOptions) error

RemoveFolder removes a folder from the bookmarks database.

func UpdateConfig

func UpdateConfig(update UpdateConfigCallback) error

UpdateConfig updates the current config. It will be created if it hasn't already been created.

Types

type Book

type Book struct {
	ID          string   // unique identifier of a bookmark/folder
	URL         *string  // address of a bookmark; not used for folders
	Name        string   // name of a bookmark/folder
	Description *string  // description of a bookmark/folder
	ParentID    *string  // optional ID of the parent folder for a bookmark/folder
	IsFolder    bool     // true if folder, and false otherwise
	ParentName  *string  // name of parent folder if bookmark/folder has one
	Tags        []string // tags applied to the bookmark
	Order       string   // user managed order of the bookmark
}

Book is a bookmark or folder.

func AddBook

func AddBook(url string, options *addBookOptions) (Book, error)

AddBook adds a bookmark to the bookmarks database.

func AddFolder

func AddFolder(name string, options *addFolderOptions) (Book, error)

AddFolder adds a folder to the bookmarks database.

func AddTags

func AddTags(id string, tags []string, options *addTagsOptions) (Book, error)

AddTags adds tags to a bookmark in the bookmarks database.

func GetBook

func GetBook(id string, options *getBookOptions) (book Book, err error)

GetBook gets a bookmark in the bookmarks database.

func ListBooks

func ListBooks(options *listBookOptions) ([]Book, error)

ListBooks lists bookmarks and folders in the bookmarks database.

func RemoveTags

func RemoveTags(id string, tags []string, options *removeTagsOptions) (Book, error)

RemoveTags removes tags from a bookmark in the bookmarks database.

func UpdateBook

func UpdateBook(id string, options *updateBookOptions) (Book, error)

UpdateBook updates a bookmark in the bookmarks database.

func UpdateFolder

func UpdateFolder(id string, options *updateFolderOptions) (Book, error)

UpdateFolder updates a folder in the bookmarks database.

type Config

type Config = config.Config

func GetConfig

func GetConfig() (Config, error)

GetConfig gets the current config. If the sentinel error ErrConfigMissing then it doesn't exist.

type Direction

type Direction = db.Direction

type Order

type Order = db.Order

type UpdateConfigCallback

type UpdateConfigCallback = config.UpdateConfigCallback

Jump to

Keyboard shortcuts

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