bookmark

package
v1.0.0-beta9 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRoute

func InitRoute(r fiber.Router)

Types

type Bookmark

type Bookmark struct {
	Id          string `gorm:"primaryKey" json:"id"`
	Name        string `json:"name,omitempty"`
	Url         string `json:"url,omitempty"`
	Icon        string `json:"icon,omitempty"`
	Description string `json:"description,omitempty"`
	Tags        []*Tag `gorm:"many2many:bookmark_tags" json:"tags,omitempty"`

	UserId string `gorm:"index" json:"-"`
}

type BookmarkRepository

type BookmarkRepository interface {
	GetAllBookmarks(userId string) ([]Bookmark, *exception.AppError)
	GetBookmarkById(userId string, id string) (Bookmark, *exception.AppError)
	CreateBookmark(b Bookmark) *exception.AppError
	UpdateBookmark(b Bookmark) *exception.AppError
	DeleteBookmark(id string, userId string) *exception.AppError
	GetBookmarkByTag(userId string, tag string) ([]Bookmark, *exception.AppError)
	GetBookmarkByTags(userId string, tags []string) ([]Bookmark, *exception.AppError)
	FindBookmarkByWord(userId string, word string) ([]Bookmark, *exception.AppError)
	GetTags(userId string) ([]Tag, *exception.AppError)
	GetUniqueTags(userId string) ([]Tag, *exception.AppError)
	DeleteTag(id string, userId string) *exception.AppError
	GetTagByName(userId string, name string) (Tag, *exception.AppError)
	CreateTag(t Tag) *exception.AppError
	DeleteUnusedTag(b Bookmark, t Tag) *exception.AppError
}

type BookmarkRepositoryDB

type BookmarkRepositoryDB struct {
	// contains filtered or unexported fields
}

func NewBookmarkRepository

func NewBookmarkRepository() BookmarkRepositoryDB

func (BookmarkRepositoryDB) CreateBookmark

func (d BookmarkRepositoryDB) CreateBookmark(b Bookmark) *exception.AppError

func (BookmarkRepositoryDB) CreateTag

func (d BookmarkRepositoryDB) CreateTag(t Tag) *exception.AppError

func (BookmarkRepositoryDB) DeleteBookmark

func (d BookmarkRepositoryDB) DeleteBookmark(id string, userId string) *exception.AppError

func (BookmarkRepositoryDB) DeleteTag

func (d BookmarkRepositoryDB) DeleteTag(id string, userId string) *exception.AppError

func (BookmarkRepositoryDB) DeleteUnusedTag

func (d BookmarkRepositoryDB) DeleteUnusedTag(b Bookmark, t Tag) *exception.AppError

func (BookmarkRepositoryDB) FindBookmarkByWord

func (d BookmarkRepositoryDB) FindBookmarkByWord(userId string, word string) ([]Bookmark, *exception.AppError)

func (BookmarkRepositoryDB) GetAllBookmarks

func (d BookmarkRepositoryDB) GetAllBookmarks(userId string) ([]Bookmark, *exception.AppError)

func (BookmarkRepositoryDB) GetBookmarkById

func (d BookmarkRepositoryDB) GetBookmarkById(userId string, id string) (Bookmark, *exception.AppError)

func (BookmarkRepositoryDB) GetBookmarkByTag

func (d BookmarkRepositoryDB) GetBookmarkByTag(userId string, tag string) ([]Bookmark, *exception.AppError)

func (BookmarkRepositoryDB) GetBookmarkByTags

func (d BookmarkRepositoryDB) GetBookmarkByTags(userId string, tags []string) ([]Bookmark, *exception.AppError)

func (BookmarkRepositoryDB) GetTagByName

func (d BookmarkRepositoryDB) GetTagByName(userId string, name string) (Tag, *exception.AppError)

func (BookmarkRepositoryDB) GetTags

func (d BookmarkRepositoryDB) GetTags(userId string) ([]Tag, *exception.AppError)

func (BookmarkRepositoryDB) GetUniqueTags

func (d BookmarkRepositoryDB) GetUniqueTags(userId string) ([]Tag, *exception.AppError)

func (BookmarkRepositoryDB) UpdateBookmark

func (d BookmarkRepositoryDB) UpdateBookmark(b Bookmark) *exception.AppError

type Tag

type Tag struct {
	Id   string `gorm:"primaryKey" json:"id"`
	Name string `json:"name"`

	Bookmarks []*Bookmark `gorm:"many2many:bookmark_tags;" json:"bookmarks,omitempty"`

	UserId string `gorm:"index" json:"-"`
}

Jump to

Keyboard shortcuts

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