Documentation
¶
Index ¶
- Constants
- Variables
- func AddFeedItem(i *FeedItem) int64
- func CreateAPFollower(uid uint, follower string) error
- func CreateUser(username, email string) error
- func DeleteUserFeed(f *UserFeed) error
- func GenerateToken() string
- func GetUnreadBookmarkCount(uid uint) int64
- func GetUnreadFeedItemCount(uid uint) int64
- func Init(c *config.Config) error
- type APFollower
- type Bookmark
- type Collection
- type CommonFields
- type Database
- type Feed
- type FeedItem
- type Resource
- type Snapshot
- type Tag
- type TagCount
- type Token
- type UnreadFeedItem
- type User
- type UserFeed
- type UserFeedItem
- type UserFeedSummary
Constants ¶
View Source
const (
RSSFeed = "rss"
)
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func AddFeedItem ¶ added in v0.6.0
func CreateAPFollower ¶ added in v0.4.0
func CreateUser ¶
func DeleteUserFeed ¶ added in v0.6.0
func GenerateToken ¶
func GenerateToken() string
func GetUnreadBookmarkCount ¶ added in v0.6.0
func GetUnreadFeedItemCount ¶ added in v0.6.0
Types ¶
type APFollower ¶ added in v0.4.0
type APFollower struct {
CommonFields
UserID uint `gorm:"uniqueIndex:apuidx" json:"uid"`
Follower string `gorm:"uniqueIndex:apuidx" json:"follower"`
}
type Bookmark ¶
type Bookmark struct {
CommonFields
URL string `json:"url"`
Title string `json:"title"`
Notes string `json:"notes"`
Domain string `json:"domain"`
Favicon string `json:"favicon"`
Tags []Tag `gorm:"many2many:bookmark_tags;" json:"tags"`
Snapshots []Snapshot `json:"snapshots"`
CollectionID uint `json:"-"`
Collection *Collection `json:"collection"`
Public bool `json:"public"`
Unread bool `json:"unread"`
UserID uint `json:"user_id"`
User User `json:"-"`
}
func GetOrCreateBookmark ¶ added in v0.4.0
func GetOrCreateBookmark(u *User, urlString, title, tags, notes, public, favicon, collection, unread string) (*Bookmark, bool, error)
TODO use Bookmark as parameter instead of strings
func GetUnreadBookmarkItems ¶ added in v0.6.0
type Collection ¶ added in v0.5.0
type Collection struct {
CommonFields
Name string `gorm:"uniqueIndex:cuid" json:"name"`
UserID uint `gorm:"uniqueIndex:cuid" json:"user_id"`
ParentID uint
Children []*Collection `gorm:"foreignKey:parent_id"`
User User `json:"-"`
Bookmarks []Bookmark `json:"bookmarks"`
}
func GetCollection ¶ added in v0.5.0
func GetCollection(uid uint, cid string) *Collection
func GetCollectionByName ¶ added in v0.5.0
func GetCollectionByName(uid uint, cname string) *Collection
func GetCollectionTree ¶ added in v0.5.0
func GetCollectionTree(uid uint) []*Collection
func GetCollections ¶ added in v0.5.0
func GetCollections(uid uint) []*Collection
type CommonFields ¶ added in v0.2.0
type Feed ¶ added in v0.6.0
type Feed struct {
CommonFields
Name string `json:"name"`
URL string `json:"gorm:"unique" url"`
Type string `json:"type"`
Favicon string `json:"favicon"`
Items []*FeedItem `json:"items"`
Users []*User `gorm:"many2many:user_feeds;" json:"-"`
}
func GetFeedByID ¶ added in v0.6.0
func GetFeedByURL ¶ added in v0.6.0
type Resource ¶ added in v0.2.0
type Snapshot ¶
type Snapshot struct {
CommonFields
Title string `json:"title"`
Key string `json:"key"`
Text string `json:"text"`
BookmarkID uint `json:"bookmark_id"`
Bookmark Bookmark `json:"bookmark"`
Size uint `json:"size"`
Resources []Resource `gorm:"many2many:snapshot_resources;" json:"resources"`
}
func GetSnapshotWithResources ¶ added in v0.5.0
type Tag ¶
type Tag struct {
CommonFields
Text string `gorm:"unique" json:"text"`
Bookmarks []Bookmark `gorm:"many2many:bookmark_tags;" json:"bookmarks"`
}
func GetOrCreateTag ¶ added in v0.2.0
type TagCount ¶ added in v0.4.0
func GetFrequentPublicTags ¶ added in v0.4.0
type Token ¶
type Token struct {
CommonFields
UserID uint `json:"user_id"`
Text string `json:"text"`
}
func CreateAddonToken ¶ added in v0.6.0
type UnreadFeedItem ¶ added in v0.6.0
func GetUnreadFeedItems ¶ added in v0.6.0
func GetUnreadFeedItems(uid, limit uint) []*UnreadFeedItem
type User ¶
type User struct {
CommonFields
Username string `gorm:"unique" json:"username"`
Email *string `gorm:"unique" json:"email"`
OAuthID *string `gorm:"unique" json:"-"`
LoginToken string `json:"-"`
SubmissionTokens []Token `json:"-"`
Bookmarks []Bookmark `json:"bookmarks"`
Feeds []*Feed `gorm:"many2many:user_feeds;" json:"feeds"`
FeedsItems []*FeedItem `gorm:"many2many:user_feed_items;" json:"feed_items"`
}
func GetUserByLoginToken ¶
func GetUserByOAuthID ¶ added in v0.3.0
type UserFeed ¶ added in v0.6.0
type UserFeedItem ¶ added in v0.6.0
type UserFeedSummary ¶ added in v0.6.0
func GetUserFeeds ¶ added in v0.6.0
func GetUserFeeds(uid uint) ([]*UserFeedSummary, error)
Click to show internal directories.
Click to hide internal directories.