armariaapi

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

armariaapi is the public API for armaria. Armaria is a fast, open, and local first bookmarks manager. The API makes heavy use of the options pattern: https://www.sohamkamani.com/golang/options-pattern/ Many of the types used by this API can be found in the armaria package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBook

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

AddBook adds a bookmark to the bookmarks database.

func AddFolder

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

AddFolder adds a folder to the bookmarks database.

func AddTags

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

AddTags adds tags to a bookmark in the bookmarks database.

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 added in v0.0.17

func DefaultGetBookOptions() *getBookOptions

DefaultGetBookOptions are the default options for GetBook.

func DefaultGetParentNameOptions added in v0.0.17

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 GetBook added in v0.0.17

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

GetBook gets a bookmark in the bookmarks database.

func GetConfig

func GetConfig() (armaria.Config, error)

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

func GetParentNames added in v0.0.17

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 added in v0.0.7

func InstallManifestChromium() error

InstallManifestChromium installs the app manifest for Firefox.

func InstallManifestFirefox

func InstallManifestFirefox() error

InstallManifestFirefox installs the app manifest for Firefox.

func ListBooks

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

ListBooks lists bookmarks and folders in the bookmarks database.

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 RemoveTags

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

RemoveTags removes tags from a bookmark in the bookmarks database.

func UpdateBook

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

UpdateBook updates a bookmark in 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.

func UpdateFolder

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

UpdateFolder updates a folder in the bookmarks database.

Types

type UpdateConfigCallback

type UpdateConfigCallback func(config *armaria.Config)

UpdateConfigCallback is a callback to update the current config

Jump to

Keyboard shortcuts

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