armaria

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: 1 Imported by: 0

Documentation

Overview

armaria is the public types for Armaria. Armaria is a fast, open, and local first bookmarks manager. The types need to be separate from the API to avoid circular dependencies.

Index

Constants

This section is empty.

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")
	// ErrConfigMissing is returned when the config file is missing.
	ErrConfigMissing = errors.New("config missing")
	// ErrInvalidOrdering is returned previous book >= next book for manual ordering.
	ErrInvalidOrdering = errors.New("invalid ordering")
)

Functions

This section is empty.

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.

type ChromeManifest added in v0.0.26

type ChromeManifest struct {
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	Path           string   `json:"path"`
	HostType       string   `json:"type"`
	AllowedOrigins []string `json:"allowed_origins"`
}

ChromeManifest is the data structure that gets marshalled into the app manifest for Chrome.

type Config

type Config struct {
	DB string `koanf:"db"`
}

Config is the configuration for Armaria.

type Direction

type Direction string

Direction is the direction results are ordered by.

const (
	DirectionAsc  Direction = "asc"
	DirectionDesc Direction = "desc"
)

type FirefoxManifest added in v0.0.26

type FirefoxManifest struct {
	Name              string   `json:"name"`
	Description       string   `json:"description"`
	Path              string   `json:"path"`
	HostType          string   `json:"type"`
	AllowedExtensions []string `json:"allowed_extensions"`
}

FirefoxManifest is the data structure that gets marshalled into the app manifest for Firefox.

type Order

type Order string

Order is the field results are ordered on.

const (
	OrderModified Order = "modified"
	OrderName     Order = "name"
	OrderManual   Order = "manual"
)

Jump to

Keyboard shortcuts

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