Documentation ¶
Index ¶
- Constants
- func GetBookmarksKey(userID string) string
- func GetCodeBlockedLabels(names []string) string
- func GetLabelsKey(userID string) string
- type Bookmark
- type Bookmarks
- func (b *Bookmarks) AddBookmark(bmark *Bookmark) error
- func (b *Bookmarks) ApplyFilters(filters *Filters) (*Bookmarks, error)
- func (b *Bookmarks) ByPostCreateAt() ([]*Bookmark, error)
- func (b *Bookmarks) DeleteBookmark(bmarkID string) error
- func (b *Bookmarks) DeleteLabel(bmarkID string, labelID string) error
- func (b *Bookmarks) GetBmarkLabelNames(bmark *Bookmark) ([]string, error)
- func (b *Bookmarks) GetBmarkTextDetailed(bmark *Bookmark, labelNames []string, args *model.CommandArgs) (string, error)
- func (b *Bookmarks) GetBmarkTextOneLine(bmark *Bookmark, labelNames []string) (string, error)
- func (b *Bookmarks) GetBmarksEphemeralText(userID string, filters *Filters) (string, error)
- func (b *Bookmarks) GetBookmark(bmarkID string) (*Bookmark, error)
- func (b *Bookmarks) GetBookmarksWithLabelID(id string) (*Bookmarks, error)
- func (b *Bookmarks) StoreBookmarks() error
- type Filters
- type IBookmarks
- type Label
- type Labels
- func (l *Labels) AddLabel(labelName string) (*Label, error)
- func (l *Labels) DeleteByID(id string) error
- func (l *Labels) GetIDFromName(name string) (string, error)
- func (l *Labels) GetLabelByName(name string) *Label
- func (l *Labels) GetNameFromID(id string) (string, error)
- func (l *Labels) StoreLabels() error
Constants ¶
const StoreBookmarksKey = "bookmarks"
StoreBookmarksKey is the key used to store bookmarks in the plugin KV store
const StoreLabelsKey = "labels"
StoreLabelsKey is the key used to store labels in the plugin KV store
Variables ¶
This section is empty.
Functions ¶
func GetBookmarksKey ¶
func GetCodeBlockedLabels ¶
GetCodeBlockedLabels returns a list of individually codeblocked names
func GetLabelsKey ¶
Types ¶
type Bookmark ¶
type Bookmark struct { PostID string `json:"postid"` // PostID is the ID for the bookmarked post and doubles as the Bookmark ID Title string `json:"title,omitempty"` // Title given to the bookmark CreateAt int64 `json:"create_at"` // The original creation time of the bookmark ModifiedAt int64 `json:"update_at"` // The original creation time of the bookmark LabelIDs []string `json:"label_ids,omitempty"` // Array of labels added to the bookmark }
Bookmark contains information about an individual bookmark
func (*Bookmark) AddLabelIDs ¶
func (*Bookmark) GetLabelIDs ¶
func (*Bookmark) HasUserTitle ¶
type Bookmarks ¶
Bookmarks contains a map of bookmarks
func NewBookmarks ¶
func NewBookmarksWithUser ¶
NewBookmarksWithUser returns an initialized Bookmarks for a User
func (*Bookmarks) AddBookmark ¶
addBookmark stores the bookmark in a map,
func (*Bookmarks) ApplyFilters ¶
ApplyFilters will apply the available filters to an object of bookmarks
func (*Bookmarks) ByPostCreateAt ¶
ByPostCreateAt returns an array of bookmarks sorted by post.CreateAt times
func (*Bookmarks) DeleteBookmark ¶
DeleteBookmark deletes a bookmark from the store
func (*Bookmarks) DeleteLabel ¶
DeleteLabel deletes a label from a bookmark
func (*Bookmarks) GetBmarkLabelNames ¶
GetBmarkLabelNames returns an array of labelNames for a given bookmark
func (*Bookmarks) GetBmarkTextDetailed ¶
func (b *Bookmarks) GetBmarkTextDetailed(bmark *Bookmark, labelNames []string, args *model.CommandArgs) (string, error)
GetBmarkTextDetailed returns detailed, multi-line bookmark text used for an ephemeral post
func (*Bookmarks) GetBmarkTextOneLine ¶
GetBmarkTextOneLine returns a single line bookmark text used for an ephemeral post
func (*Bookmarks) GetBmarksEphemeralText ¶
getBmarksEphemeralText returns a the text for posting all bookmarks in an ephemeral message
func (*Bookmarks) GetBookmark ¶
getBookmark returns a bookmark with the specified bookmarkID
func (*Bookmarks) GetBookmarksWithLabelID ¶
func (b *Bookmarks) GetBookmarksWithLabelID(labelID string) (IBookmarks, error) {
func (*Bookmarks) StoreBookmarks ¶
storeBookmarks stores all the users bookmarks
type IBookmarks ¶
type IBookmarks interface { GetBookmark(bmarkID string) (*Bookmark, error) AddBookmark(bmark *Bookmark) error DeleteBookmark(bmarkID string) error DeleteLabel(bmarkID string, labelID string) error GetBookmarksWithLabelID(labelID string) (*Bookmarks, error) GetBmarkTextOneLine(bmark *Bookmark, labelNames []string) (string, error) ApplyFilters(filters *Filters) (*Bookmarks, error) ByPostCreateAt() ([]*Bookmark, error) GetBmarkLabelNames(bmark *Bookmark) ([]string, error) }
type Labels ¶
Labels contains a map of labels with the label name as the key
func LabelsFromJSON ¶
LabelsFromJSON returns unmarshalled bookmark or initialized bookmarks if bytes are empty
func NewLabelsWithUser ¶
NewLabelsWithUser returns an initialized Labels for a User
func (*Labels) DeleteByID ¶
DeleteByID deletes a label from the store
func (*Labels) GetIDFromName ¶
GetIDFromName returns a label name with the corresponding label ID
func (*Labels) GetLabelByName ¶
GetLabelByName returns a label with the provided label name
func (*Labels) GetNameFromID ¶
GetNameFromID returns the Name of a Label
func (*Labels) StoreLabels ¶
storeLabels stores all the users labels
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_bookmarks is a generated GoMock package.
|
Package mock_bookmarks is a generated GoMock package. |