Documentation
¶
Index ¶
- type StoragePostgres
- func (s *StoragePostgres) ApplyMigrations() error
- func (s *StoragePostgres) CheckIntegrity() error
- func (s *StoragePostgres) Connect() error
- func (s *StoragePostgres) CreateBookmark(tx *sql.Tx, bd *storage.BookmarkData) (bkmID int, err error)
- func (s *StoragePostgres) CreateGoogleUser(tx *sql.Tx, userID int, googleUserID, email string) error
- func (s *StoragePostgres) CreateTag(tx *sql.Tx, td *storage.TagData) (tagID int, err error)
- func (s *StoragePostgres) CreateTaggable(tx *sql.Tx, tgbd *storage.TaggableData) (tgbID int, err error)
- func (s *StoragePostgres) CreateUser(tx *sql.Tx, ud *storage.UserData) (userID int, err error)
- func (s *StoragePostgres) DeleteTag(tx *sql.Tx, tagID int, leafPolicy storage.TaggableLeafPolicy) (err error)
- func (s *StoragePostgres) DeleteTaggable(tx *sql.Tx, taggableID int) error
- func (s *StoragePostgres) DeleteUser(tx *sql.Tx, userID int) error
- func (s *StoragePostgres) GetAccessToken(tx *sql.Tx, userID int, descr string, createIfNotExist bool) (token string, err error)
- func (s *StoragePostgres) GetBookmarkByID(tx *sql.Tx, bookmarkID int, tagsFetchOpts *storage.TagsFetchOpts) (bookmark *storage.BookmarkDataWTags, err error)
- func (s *StoragePostgres) GetBookmarksByURL(tx *sql.Tx, url string, ownerID int, tagsFetchOpts *storage.TagsFetchOpts) (bookmarks []storage.BookmarkDataWTags, err error)
- func (s *StoragePostgres) GetRootTagID(tx *sql.Tx, ownerID int) (int, error)
- func (s *StoragePostgres) GetTag(tx *sql.Tx, tagID int, opts *storage.GetTagOpts) (*storage.TagData, error)
- func (s *StoragePostgres) GetTagIDByName(tx *sql.Tx, parentTagID int, tagName string) (int, error)
- func (s *StoragePostgres) GetTagIDByPath(tx *sql.Tx, ownerID int, tagPath string) (int, error)
- func (s *StoragePostgres) GetTagNames(tx *sql.Tx, tagID int) ([]string, error)
- func (s *StoragePostgres) GetTaggedBookmarks(tx *sql.Tx, tagIDs []int, ownerID *int, tagsFetchOpts *storage.TagsFetchOpts) (bookmarks []storage.BookmarkDataWTags, err error)
- func (s *StoragePostgres) GetTaggedTaggableIDs(tx *sql.Tx, tagIDs []int, ownerID *int, ttypes []storage.TaggableType) (taggableIDs []int, err error)
- func (s *StoragePostgres) GetTaggings(tx *sql.Tx, taggableID int, tm storage.TaggingMode) (tagIDs []int, err error)
- func (s *StoragePostgres) GetTags(tx *sql.Tx, parentTagID int, opts *storage.GetTagOpts) ([]storage.TagData, error)
- func (s *StoragePostgres) GetUser(tx *sql.Tx, args *storage.GetUserArgs) (*storage.UserData, error)
- func (s *StoragePostgres) GetUserByAccessToken(tx *sql.Tx, token string) (*storage.UserData, error)
- func (s *StoragePostgres) GetUserByGoogleUserID(tx *sql.Tx, googleUserID string) (*storage.UserData, error)
- func (s *StoragePostgres) GetUsers(tx *sql.Tx) ([]storage.UserData, error)
- func (s *StoragePostgres) SetTaggings(tx *sql.Tx, taggableID int, tagIDs []int, tm storage.TaggingMode) (err error)
- func (s *StoragePostgres) Tx(fn func(*sql.Tx) error) error
- func (s *StoragePostgres) TxOpt(ilevel storage.TxILevel, mode storage.TxMode, fn func(*sql.Tx) error) error
- func (s *StoragePostgres) UpdateBookmark(tx *sql.Tx, bd *storage.BookmarkData) (err error)
- func (s *StoragePostgres) UpdateTag(tx *sql.Tx, td *storage.TagData, leafPolicy storage.TaggableLeafPolicy) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StoragePostgres ¶
type StoragePostgres struct {
// contains filtered or unexported fields
}
Implements storage.Storage
func New ¶
func New(postgresURL string) (*StoragePostgres, error)
func (*StoragePostgres) ApplyMigrations ¶
func (s *StoragePostgres) ApplyMigrations() error
func (*StoragePostgres) CheckIntegrity ¶
func (s *StoragePostgres) CheckIntegrity() error
func (*StoragePostgres) Connect ¶
func (s *StoragePostgres) Connect() error
func (*StoragePostgres) CreateBookmark ¶
func (s *StoragePostgres) CreateBookmark(tx *sql.Tx, bd *storage.BookmarkData) (bkmID int, err error)
func (*StoragePostgres) CreateGoogleUser ¶
func (*StoragePostgres) CreateTaggable ¶
func (s *StoragePostgres) CreateTaggable(tx *sql.Tx, tgbd *storage.TaggableData) (tgbID int, err error)
func (*StoragePostgres) CreateUser ¶
func (*StoragePostgres) DeleteTag ¶
func (s *StoragePostgres) DeleteTag( tx *sql.Tx, tagID int, leafPolicy storage.TaggableLeafPolicy, ) (err error)
func (*StoragePostgres) DeleteTaggable ¶
func (s *StoragePostgres) DeleteTaggable(tx *sql.Tx, taggableID int) error
func (*StoragePostgres) DeleteUser ¶
func (s *StoragePostgres) DeleteUser(tx *sql.Tx, userID int) error
func (*StoragePostgres) GetAccessToken ¶
func (*StoragePostgres) GetBookmarkByID ¶
func (s *StoragePostgres) GetBookmarkByID( tx *sql.Tx, bookmarkID int, tagsFetchOpts *storage.TagsFetchOpts, ) (bookmark *storage.BookmarkDataWTags, err error)
func (*StoragePostgres) GetBookmarksByURL ¶
func (s *StoragePostgres) GetBookmarksByURL( tx *sql.Tx, url string, ownerID int, tagsFetchOpts *storage.TagsFetchOpts, ) (bookmarks []storage.BookmarkDataWTags, err error)
func (*StoragePostgres) GetRootTagID ¶
GetRootTagID returns the id of the root tag for the given user.
func (*StoragePostgres) GetTag ¶
func (s *StoragePostgres) GetTag( tx *sql.Tx, tagID int, opts *storage.GetTagOpts, ) (*storage.TagData, error)
func (*StoragePostgres) GetTagIDByName ¶
func (*StoragePostgres) GetTagIDByPath ¶
func (*StoragePostgres) GetTagNames ¶
func (*StoragePostgres) GetTaggedBookmarks ¶
func (s *StoragePostgres) GetTaggedBookmarks( tx *sql.Tx, tagIDs []int, ownerID *int, tagsFetchOpts *storage.TagsFetchOpts, ) (bookmarks []storage.BookmarkDataWTags, err error)
func (*StoragePostgres) GetTaggedTaggableIDs ¶
func (s *StoragePostgres) GetTaggedTaggableIDs( tx *sql.Tx, tagIDs []int, ownerID *int, ttypes []storage.TaggableType, ) (taggableIDs []int, err error)
func (*StoragePostgres) GetTaggings ¶
func (s *StoragePostgres) GetTaggings( tx *sql.Tx, taggableID int, tm storage.TaggingMode, ) (tagIDs []int, err error)
func (*StoragePostgres) GetTags ¶
func (s *StoragePostgres) GetTags( tx *sql.Tx, parentTagID int, opts *storage.GetTagOpts, ) ([]storage.TagData, error)
func (*StoragePostgres) GetUser ¶
func (s *StoragePostgres) GetUser( tx *sql.Tx, args *storage.GetUserArgs, ) (*storage.UserData, error)
func (*StoragePostgres) GetUserByAccessToken ¶
func (*StoragePostgres) GetUserByGoogleUserID ¶
func (*StoragePostgres) SetTaggings ¶
func (s *StoragePostgres) SetTaggings( tx *sql.Tx, taggableID int, tagIDs []int, tm storage.TaggingMode, ) (err error)
func (*StoragePostgres) UpdateBookmark ¶
func (s *StoragePostgres) UpdateBookmark(tx *sql.Tx, bd *storage.BookmarkData) (err error)
func (*StoragePostgres) UpdateTag ¶
func (s *StoragePostgres) UpdateTag( tx *sql.Tx, td *storage.TagData, leafPolicy storage.TaggableLeafPolicy, ) (err error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.