bookmark

package
v1.0.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`

	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
}

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) 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) 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) 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"`

	BookmarkId string `gorm:"index"`

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

Jump to

Keyboard shortcuts

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