db

package
v0.0.0-...-a74ccbd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BookmarkInteractiveFileNameHeader        = "## Title"
	BookmarkInteractiveFileUrlHeader         = "## URL"
	BookmarkInteractiveFileDescriptionHeader = "## Description"
	BookmarkInteractiveFileTagsHeader        = "## Tags"
)
View Source
const BookmarkInteractiveFileFormatString = `` /* 160-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type AllTags

type AllTags struct {
	Tags  TagList
	Count TagCount
}

type Bookmark

type Bookmark struct {
	Number      int       `json:"index"`
	Url         Url       `json:"uri"`
	Name        string    `json:"title"`
	Description string    `json:"description"`
	Tags        TagList   `json:"tags"`
	WhenAdded   time.Time `json:"whenAdded"`
	LastUpdated time.Time `json:"lastUpdated"`
}

func (*Bookmark) DescriptionMatches

func (bm *Bookmark) DescriptionMatches(query string) bool

func (*Bookmark) FormatAsInteractiveFileString

func (bm *Bookmark) FormatAsInteractiveFileString() string

func (Bookmark) HasName

func (bm Bookmark) HasName() bool

func (*Bookmark) MarkUpdated

func (bm *Bookmark) MarkUpdated()

func (*Bookmark) NameMatches

func (bm *Bookmark) NameMatches(query string) bool

func (*Bookmark) UpdateFromInteractiveFileString

func (bm *Bookmark) UpdateFromInteractiveFileString(data string) error

func (*Bookmark) UrlMatches

func (bm *Bookmark) UrlMatches(query string) bool

type BookmarkLibrary

type BookmarkLibrary struct {
	Bookmarks []Bookmark
}

func (*BookmarkLibrary) DeleteByNumber

func (bmks *BookmarkLibrary) DeleteByNumber(number int) error

func (*BookmarkLibrary) GetAllTags

func (bmks *BookmarkLibrary) GetAllTags() AllTags

func (*BookmarkLibrary) GetByNumber

func (bmks *BookmarkLibrary) GetByNumber(number int) (*Bookmark, error)

func (*BookmarkLibrary) Len

func (bmks *BookmarkLibrary) Len() int

func (*BookmarkLibrary) Less

func (bmks *BookmarkLibrary) Less(i, j int) bool

func (*BookmarkLibrary) NewEntry

func (bmks *BookmarkLibrary) NewEntry() *Bookmark

func (*BookmarkLibrary) Swap

func (bmks *BookmarkLibrary) Swap(i, j int)

func (*BookmarkLibrary) Verify

func (bmks *BookmarkLibrary) Verify() error

type TagCount

type TagCount map[string]int

type TagList

type TagList struct {
	Tags []string
}

func (*TagList) Append

func (tl *TagList) Append(tag string)

func (*TagList) AppendFromString

func (tl *TagList) AppendFromString(tagStr string)

func (*TagList) Clear

func (tl *TagList) Clear()

func (*TagList) ContainsAllTags

func (tl *TagList) ContainsAllTags(tags []string) bool

func (*TagList) Len

func (tl *TagList) Len() int

func (*TagList) Less

func (tl *TagList) Less(i, j int) bool

func (TagList) MarshalJSON

func (tl TagList) MarshalJSON() ([]byte, error)

func (TagList) MultilineString

func (tl TagList) MultilineString() string

func (*TagList) Remove

func (tl *TagList) Remove(tag string)

func (TagList) String

func (tl TagList) String() string

func (*TagList) Swap

func (tl *TagList) Swap(i, j int)

func (*TagList) UnmarshalJSON

func (tl *TagList) UnmarshalJSON(b []byte) error

type Url

type Url struct {
	Url url.URL
}

func (*Url) MarshalJSON

func (u *Url) MarshalJSON() ([]byte, error)

func (*Url) Parse

func (u *Url) Parse(urlStr string) error

func (*Url) String

func (u *Url) String() string

func (*Url) UnmarshalJSON

func (u *Url) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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