Documentation ¶
Index ¶
- Variables
- type Bookmark
- type Feed
- type FeedItem
- type FeedItems
- type ListBookmarksOptions
- type ListFeedsOptions
- type ListThoughtsOptions
- type Store
- func (store *Store) Authenticate(username string, password string) (string, error)
- func (store *Store) DeleteBookmark(bookmark *Bookmark) error
- func (store *Store) DeleteFeed(feed *Feed) error
- func (store *Store) DeleteThought(thought *Thought) error
- func (store *Store) GetBookmark(bookmark *Bookmark) error
- func (store *Store) GetFeed(feed *Feed) error
- func (store *Store) GetThought(thought *Thought) error
- func (store *Store) GetUser(user *User) error
- func (store *Store) ListBookmarks(options *ListBookmarksOptions) (*[]*Bookmark, int)
- func (store *Store) ListFeeds(options *ListFeedsOptions) (*[]*Feed, int)
- func (store *Store) ListThoughts(options *ListThoughtsOptions) (*[]*Thought, int)
- func (store *Store) PersistBookmark(bookmark *Bookmark) error
- func (store *Store) PersistFeed(feed *Feed) error
- func (store *Store) PersistThought(thought *Thought) error
- func (store *Store) RefreshFeed(feed *Feed) error
- func (store *Store) UserTokenExists(token string) bool
- type Tags
- type Thought
- type User
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoBookmarkURL is returned if the Bookmark does not have a URL ErrNoBookmarkURL = errors.New("Missing Bookmark.URL") // ErrNoBookmarkKey is returned if the Bookmark does not have a ID or URL ErrNoBookmarkKey = errors.New("Missing Bookmark.ID or Bookmark.URL") )
var ( // ErrNoFeedURL is returned if the Feed does not have a URL ErrNoFeedURL = errors.New("Missing Feed.URL") // ErrNoFeedKey is returned if the Feed does not have a ID or URL ErrNoFeedKey = errors.New("Missing Feed.ID or Feed.URL") // ErrNotExistingFeedItem is returned if a feed does not contain an item ErrNotExistingFeedItem = errors.New("Item does not exist in Feed") )
var ( // ErrNoThoughtTitle is returned if the Thought does not have a Title ErrNoThoughtTitle = errors.New("Missing Thought.Title") // ErrNoThoughtKey is returned if the Thought does not have a ID or Title ErrNoThoughtKey = errors.New("Missing Thought.ID or Thought.Title") )
Functions ¶
This section is empty.
Types ¶
type Bookmark ¶
type Bookmark struct { ID string URL string Title string Created time.Time Updated time.Time Excerpt string Content string `json:",omitempty"` Tags Tags Archived bool }
Bookmark represents a single bookmark
type Feed ¶
type Feed struct { ID string Created time.Time Updated time.Time Refreshed time.Time LastAuthored time.Time Title string URL string Etag string Tags Tags Items FeedItems }
Feed represents a feed in the database
func (*Feed) DeleteItem ¶
DeleteItem removes an item by ID from this feed list of items
type FeedItem ¶
type FeedItem struct { ID string Created time.Time Updated time.Time Title string Date time.Time URL string Content string }
FeedItem represents a FeedItem as part of a Feed
func (*FeedItem) ToBookmark ¶
ToBookmark converts the feed item to a bookmark
type FeedItems ¶
type FeedItems []*FeedItem
FeedItems represents a slice of FeedItem
type ListBookmarksOptions ¶
ListBookmarksOptions can be passed to ListBookmarks to filter bookmarks
type ListFeedsOptions ¶
type ListFeedsOptions struct { Search string Tags Tags NotRefreshedSince time.Time Limit int Offset int }
ListFeedsOptions is used to pass filters to ListFeeds
type ListThoughtsOptions ¶
ListThoughtsOptions can be passed to ListThoughts to filter thoughts
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is used to persist Bookmark, Feed and Thougt
func (*Store) Authenticate ¶
Authenticate authenticates a user with a password and returns the token for the user
func (*Store) DeleteBookmark ¶
DeleteBookmark deletes the given bookmark from the database
func (*Store) DeleteFeed ¶
DeleteFeed deletes the given feed from the database
func (*Store) DeleteThought ¶
DeleteThought removes a thought from the database
func (*Store) GetBookmark ¶
GetBookmark finds a single bookmark by ID or URL
func (*Store) GetThought ¶
GetThought gets a single thought from the database
func (*Store) ListBookmarks ¶
func (store *Store) ListBookmarks(options *ListBookmarksOptions) (*[]*Bookmark, int)
ListBookmarks fetches multiple bookmarks from the database
func (*Store) ListFeeds ¶
func (store *Store) ListFeeds(options *ListFeedsOptions) (*[]*Feed, int)
ListFeeds fetches multiple feeds from the database
func (*Store) ListThoughts ¶
func (store *Store) ListThoughts(options *ListThoughtsOptions) (*[]*Thought, int)
ListThoughts lists thoughts from the database
func (*Store) PersistBookmark ¶
PersistBookmark persists a bookmark to the database and schedules an async job to fetch the content
func (*Store) PersistFeed ¶
PersistFeed persists a feed to the database and schedules an async job to fetch the content
func (*Store) PersistThought ¶
PersistThought adds a thought to the database
func (*Store) RefreshFeed ¶
RefreshFeed fetches the rss feed items and persists those to the database
func (*Store) UserTokenExists ¶
UserTokenExists checks if there is exactly one user with the given token
type Tags ¶
type Tags []string
Tags is a slice of string values