Documentation
¶
Index ¶
- Variables
- func CreateAPFollower(uid uint, follower string) error
- func CreateUser(username, email string) error
- func GenerateToken() string
- func Init(c *config.Config) error
- type APFollower
- type Bookmark
- type Collection
- type CommonFields
- type Database
- type Resource
- type Snapshot
- type Tag
- type TagCount
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
func CreateAPFollower ¶ added in v0.4.0
func CreateUser ¶
func GenerateToken ¶
func GenerateToken() string
Types ¶
type APFollower ¶ added in v0.4.0
type APFollower struct {
CommonFields
UserID uint `gorm:"uniqueIndex:uidx" json:"uid"`
Follower string `gorm:"uniqueIndex:uidx" 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"`
UserID uint `json:"user_id"`
User User `json:"-"`
}
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 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"`
}
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"`
}
func GetUserByLoginToken ¶
func GetUserByOAuthID ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.