Documentation ¶
Index ¶
- type DBBookmark
- type DBSession
- type DBTag
- type DBUser
- type Repository
- func (r *Repository) BookmarkAdd(b bookmark.Bookmark) error
- func (r *Repository) BookmarkAddMany(bookmarks []bookmark.Bookmark) (int64, error)
- func (r *Repository) BookmarkDelete(userUUID, uid string) error
- func (r *Repository) BookmarkGetAll(userUUID string) ([]bookmark.Bookmark, error)
- func (r *Repository) BookmarkGetAllPrivate(userUUID string) ([]bookmark.Bookmark, error)
- func (r *Repository) BookmarkGetAllPublic(userUUID string) ([]bookmark.Bookmark, error)
- func (r *Repository) BookmarkGetByTag(userUUID string, tag string) ([]bookmark.Bookmark, error)
- func (r *Repository) BookmarkGetByUID(userUUID, uid string) (bookmark.Bookmark, error)
- func (r *Repository) BookmarkGetByURL(userUUID, u string) (bookmark.Bookmark, error)
- func (r *Repository) BookmarkGetCount(userUUID string, visibility querying.Visibility) (uint, error)
- func (r *Repository) BookmarkGetN(userUUID string, visibility querying.Visibility, n uint, offset uint) ([]bookmark.Bookmark, error)
- func (r *Repository) BookmarkGetPublicByUID(userUUID, uid string) (bookmark.Bookmark, error)
- func (r *Repository) BookmarkIsURLRegistered(userUUID, url string) (bool, error)
- func (r *Repository) BookmarkIsURLRegisteredToAnotherUID(userUUID, url, uid string) (bool, error)
- func (r *Repository) BookmarkSearchCount(userUUID string, visibility querying.Visibility, searchTerms string) (uint, error)
- func (r *Repository) BookmarkSearchN(userUUID string, visibility querying.Visibility, searchTerms string, n uint, ...) ([]bookmark.Bookmark, error)
- func (r *Repository) BookmarkTagUpdateMany(bookmarks []bookmark.Bookmark) (int64, error)
- func (r *Repository) BookmarkUpdate(b bookmark.Bookmark) error
- func (r *Repository) BookmarkUpsertMany(bookmarks []bookmark.Bookmark) (int64, error)
- func (r *Repository) OwnerGetByUUID(userUUID string) (querying.Owner, error)
- func (r *Repository) SessionAdd(sess session.Session) error
- func (r *Repository) SessionGetByRememberTokenHash(hash string) (session.Session, error)
- func (r *Repository) TagFilterCount(userUUID string, visibility querying.Visibility, filterTerm string) (uint, error)
- func (r *Repository) TagFilterN(userUUID string, visibility querying.Visibility, filterTerm string, n uint, ...) ([]querying.Tag, error)
- func (r *Repository) TagGetAll(userUUID string, visibility querying.Visibility) ([]querying.Tag, error)
- func (r *Repository) TagGetCount(userUUID string, visibility querying.Visibility) (uint, error)
- func (r *Repository) TagGetN(userUUID string, visibility querying.Visibility, n uint, offset uint) ([]querying.Tag, error)
- func (r *Repository) UserAdd(u user.User) error
- func (r *Repository) UserDeleteByUUID(userUUID string) error
- func (r *Repository) UserGetAll() ([]user.User, error)
- func (r *Repository) UserGetByEmail(email string) (user.User, error)
- func (r *Repository) UserGetByNickName(nick string) (user.User, error)
- func (r *Repository) UserGetByUUID(userUUID string) (user.User, error)
- func (r *Repository) UserIsEmailRegistered(email string) (bool, error)
- func (r *Repository) UserIsNickNameRegistered(nick string) (bool, error)
- func (r *Repository) UserUpdate(u user.User) error
- func (r *Repository) UserUpdateInfo(info user.InfoUpdate) error
- func (r *Repository) UserUpdatePasswordHash(passwordHash user.PasswordHashUpdate) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBBookmark ¶
type DBBookmark struct { UID string `db:"uid"` UserUUID string `db:"user_uuid"` URL string `db:"url"` Title string `db:"title"` Description string `db:"description"` Private bool `db:"private"` Tags []string `db:"tags"` FullTextSearchString string `db:"fulltextsearch_string"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository provides a PostgreSQL persistence layer.
func NewRepository ¶
func NewRepository(pool *pgxpool.Pool) *Repository
NewRepository initializes and returns a PostgreSQL Repository.
func (*Repository) BookmarkAdd ¶
func (r *Repository) BookmarkAdd(b bookmark.Bookmark) error
func (*Repository) BookmarkAddMany ¶
func (r *Repository) BookmarkAddMany(bookmarks []bookmark.Bookmark) (int64, error)
func (*Repository) BookmarkDelete ¶
func (r *Repository) BookmarkDelete(userUUID, uid string) error
func (*Repository) BookmarkGetAll ¶
func (r *Repository) BookmarkGetAll(userUUID string) ([]bookmark.Bookmark, error)
func (*Repository) BookmarkGetAllPrivate ¶
func (r *Repository) BookmarkGetAllPrivate(userUUID string) ([]bookmark.Bookmark, error)
func (*Repository) BookmarkGetAllPublic ¶
func (r *Repository) BookmarkGetAllPublic(userUUID string) ([]bookmark.Bookmark, error)
func (*Repository) BookmarkGetByTag ¶
func (*Repository) BookmarkGetByUID ¶
func (r *Repository) BookmarkGetByUID(userUUID, uid string) (bookmark.Bookmark, error)
func (*Repository) BookmarkGetByURL ¶
func (r *Repository) BookmarkGetByURL(userUUID, u string) (bookmark.Bookmark, error)
func (*Repository) BookmarkGetCount ¶
func (r *Repository) BookmarkGetCount(userUUID string, visibility querying.Visibility) (uint, error)
func (*Repository) BookmarkGetN ¶
func (r *Repository) BookmarkGetN(userUUID string, visibility querying.Visibility, n uint, offset uint) ([]bookmark.Bookmark, error)
func (*Repository) BookmarkGetPublicByUID ¶
func (r *Repository) BookmarkGetPublicByUID(userUUID, uid string) (bookmark.Bookmark, error)
func (*Repository) BookmarkIsURLRegistered ¶
func (r *Repository) BookmarkIsURLRegistered(userUUID, url string) (bool, error)
func (*Repository) BookmarkIsURLRegisteredToAnotherUID ¶
func (r *Repository) BookmarkIsURLRegisteredToAnotherUID(userUUID, url, uid string) (bool, error)
func (*Repository) BookmarkSearchCount ¶
func (r *Repository) BookmarkSearchCount(userUUID string, visibility querying.Visibility, searchTerms string) (uint, error)
func (*Repository) BookmarkSearchN ¶
func (r *Repository) BookmarkSearchN(userUUID string, visibility querying.Visibility, searchTerms string, n uint, offset uint) ([]bookmark.Bookmark, error)
func (*Repository) BookmarkTagUpdateMany ¶
func (r *Repository) BookmarkTagUpdateMany(bookmarks []bookmark.Bookmark) (int64, error)
func (*Repository) BookmarkUpdate ¶
func (r *Repository) BookmarkUpdate(b bookmark.Bookmark) error
func (*Repository) BookmarkUpsertMany ¶
func (r *Repository) BookmarkUpsertMany(bookmarks []bookmark.Bookmark) (int64, error)
func (*Repository) OwnerGetByUUID ¶
func (r *Repository) OwnerGetByUUID(userUUID string) (querying.Owner, error)
func (*Repository) SessionAdd ¶
func (r *Repository) SessionAdd(sess session.Session) error
func (*Repository) SessionGetByRememberTokenHash ¶
func (r *Repository) SessionGetByRememberTokenHash(hash string) (session.Session, error)
func (*Repository) TagFilterCount ¶
func (r *Repository) TagFilterCount(userUUID string, visibility querying.Visibility, filterTerm string) (uint, error)
func (*Repository) TagFilterN ¶
func (r *Repository) TagFilterN(userUUID string, visibility querying.Visibility, filterTerm string, n uint, offset uint) ([]querying.Tag, error)
func (*Repository) TagGetAll ¶
func (r *Repository) TagGetAll(userUUID string, visibility querying.Visibility) ([]querying.Tag, error)
func (*Repository) TagGetCount ¶
func (r *Repository) TagGetCount(userUUID string, visibility querying.Visibility) (uint, error)
func (*Repository) TagGetN ¶
func (r *Repository) TagGetN(userUUID string, visibility querying.Visibility, n uint, offset uint) ([]querying.Tag, error)
func (*Repository) UserDeleteByUUID ¶
func (r *Repository) UserDeleteByUUID(userUUID string) error
func (*Repository) UserGetAll ¶
func (r *Repository) UserGetAll() ([]user.User, error)
func (*Repository) UserGetByEmail ¶
func (r *Repository) UserGetByEmail(email string) (user.User, error)
func (*Repository) UserGetByNickName ¶
func (r *Repository) UserGetByNickName(nick string) (user.User, error)
func (*Repository) UserGetByUUID ¶
func (r *Repository) UserGetByUUID(userUUID string) (user.User, error)
func (*Repository) UserIsEmailRegistered ¶
func (r *Repository) UserIsEmailRegistered(email string) (bool, error)
func (*Repository) UserIsNickNameRegistered ¶
func (r *Repository) UserIsNickNameRegistered(nick string) (bool, error)
func (*Repository) UserUpdate ¶
func (r *Repository) UserUpdate(u user.User) error
func (*Repository) UserUpdateInfo ¶
func (r *Repository) UserUpdateInfo(info user.InfoUpdate) error
func (*Repository) UserUpdatePasswordHash ¶
func (r *Repository) UserUpdatePasswordHash(passwordHash user.PasswordHashUpdate) error
Click to show internal directories.
Click to hide internal directories.