Documentation ¶
Overview ¶
Package model .
Index ¶
- Constants
- Variables
- func CreateArticle(db *gorm.DB, a *Article) error
- func GetArticleStatistics(db *gorm.DB, loc *time.Location, date time.Time) ([]ArticleStat, []ArticleRank, error)
- type Article
- type ArticleExport
- type ArticleRank
- type ArticleRankResult
- type ArticleStat
- type ArticleStatResult
- type User
Constants ¶
View Source
const ( RTRead = "read" // have read RTSkim = "skim" // have skimmed RTUnread = "unread" // unread: 1. from read to unread; 2. read it later RTSkip = "skip" // skipped and will not read )
Read types
Variables ¶
View Source
var (
ErrDuplicatedQuery = errors.New("Duplicated record")
)
Model errors
Functions ¶
func GetArticleStatistics ¶
func GetArticleStatistics(db *gorm.DB, loc *time.Location, date time.Time) ( []ArticleStat, []ArticleRank, error, )
GetArticleStatistics .
Types ¶
type Article ¶
type Article struct { gorm.Model ReadType string `gorm:"read_type;size:16;not null" json:"Type,omitempty"` Title string `gorm:"title;size:128;not null" json:"Title,omitempty" yaml:"title"` URL string `gorm:"url;size:512;not null" json:"URL,omitempty"` Domain string `gorm:"domain;index;size:256;not null" json:"Domain,omitempty"` Author string `gorm:"author;index;size:128" json:"Author,omitempty"` Description string `gorm:"description;size:256" json:"Description,omitempty"` Device string `gorm:"device;index;size:32" json:"Device,omitempty"` ReadAtText string `gorm:"-" json:"CreatedAtText"` DescriptionText string `gorm:"-" json:"DescriptionText"` }
Article definition of an article
func ExportArticles ¶
ExportArticles .
type ArticleExport ¶
type ArticleExport struct { ID uint `yaml:"id"` ReadType string `yaml:"read_type"` Title string `yaml:"title"` URL string `yaml:"url"` Domain string `yaml:"domain"` Author string `yaml:"author,omitempty"` Description string `yaml:"description,omitempty"` Device string `yaml:"device,omitempty"` CreatedAt time.Time `yaml:"created_at"` UpdatedAt time.Time `yaml:"updated_at"` }
ArticleExport for export
type ArticleRank ¶
type ArticleRank struct { Name string Count int64 Result []ArticleRankResult }
ArticleRank .
type ArticleRankResult ¶
ArticleRankResult .
type ArticleStat ¶
ArticleStat .
type ArticleStatResult ¶
ArticleStatResult .
Click to show internal directories.
Click to hide internal directories.