Documentation
¶
Index ¶
Constants ¶
View Source
const ( KindMarkdown = "markdown" KindTweet = "tweet" KindYoutube = "youtube" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
ID int64 `gorm:"column:id;primarykey" json:"id"`
Kind string `gorm:"column:kind;type:varchar(24);not null" json:"kind"`
URL string `gorm:"column:url;type:varchar(256);not null" json:"url"`
Content string `gorm:"column:content;type:text" json:"content"`
Title string `gorm:"column:title;type:varchar(256);not null;uniqueIndex" json:"title"`
Tags ArticleTags `gorm:"foreignKey:ArticleID" json:"tags"`
Created time.Time `gorm:"column:created;type:datetime;not null" json:"created"`
LastModified time.Time `gorm:"column:last_modified;type:datetime;not null" json:"lastModified"`
}
func NewArticle ¶
type ArticleTag ¶
type ArticleTag struct {
ID int64 `gorm:"column:id;primarykey" json:"id"`
Tag string `gorm:"column:tag;type:varchar(512);not null" json:"tag"`
ArticleID int64 `gorm:"column:article_id;type:integer;not null" json:"articleID"`
}
func (*ArticleTag) TableName ¶
func (t *ArticleTag) TableName() string
type ArticleTagCountDTO ¶
type ArticleTags ¶
type ArticleTags []*ArticleTag
func (ArticleTags) ContainTag ¶
func (t ArticleTags) ContainTag(tag string) bool
func (ArticleTags) ExtractIDs ¶
func (t ArticleTags) ExtractIDs() []int64
func (ArticleTags) FilterExcluded ¶
func (t ArticleTags) FilterExcluded(tags common.Strings) (ArticleTags, ArticleTags)
type Misc ¶
type Misc struct {
ID int64 `gorm:"column:id;primarykey" json:"id"`
Key string `gorm:"column:key;varchar(60);not null" json:"key"`
Value string `gorm:"column:value;text;not null" json:"value"`
Created time.Time `gorm:"column:created;type:datetime;not null" json:"created"`
LastModified time.Time `gorm:"column:last_modified;type:datetime;not null" json:"lastModified"`
}
type Note ¶
type Note struct {
ID int64 `gorm:"column:id;primarykey" json:"id"`
Title string `gorm:"column:title;type:varchar(256);not null;uniqueIndex" json:"title"`
Paragraphs Paragraphs `gorm:"foreignKey:NoteID" json:"paragraphs"`
Created time.Time `gorm:"column:created;type:datetime;not null" json:"created"`
LastModified time.Time `gorm:"column:last_modified;type:datetime;not null" json:"lastModified"`
}
func (*Note) GetContent ¶
type Notes ¶
type Notes []*Note
func (Notes) ExtractParagraphs ¶
func (n Notes) ExtractParagraphs() Paragraphs
type Paragraph ¶
type Paragraph struct {
ID int64 `gorm:"column:id;primarykey" json:"id"`
NoteID int64 `gorm:"column:note_id;type:integer;not null" json:"noteID"`
Seq int `gorm:"column:seq;type:integer;not null" json:"seq"`
Content string `gorm:"column:content;type:text" json:"content"`
ReferenceArticles ReferenceArticles `gorm:"foreignKey:ParagraphID" json:"referenceArticles"`
ReferenceWebs ReferenceWebs `gorm:"foreignKey:ParagraphID" json:"referenceWebs"`
Created time.Time `gorm:"column:created;type:datetime;not null" json:"created"`
LastModified time.Time `gorm:"column:last_modified;type:datetime;not null" json:"lastModified"`
}
type Paragraphs ¶
type Paragraphs []*Paragraph
func (Paragraphs) ExtractIDs ¶
func (p Paragraphs) ExtractIDs() []int64
func (Paragraphs) ExtractReferenceArticleArticleIDs ¶
func (p Paragraphs) ExtractReferenceArticleArticleIDs() []int64
func (Paragraphs) ExtractReferenceArticleIDs ¶
func (p Paragraphs) ExtractReferenceArticleIDs() []int64
func (Paragraphs) ExtractReferenceWebIDs ¶
func (p Paragraphs) ExtractReferenceWebIDs() []int64
func (Paragraphs) MaxSeq ¶
func (p Paragraphs) MaxSeq() int
type ReferenceArticle ¶
type ReferenceArticle struct {
ID int64 `gorm:"column:id;primarykey" json:"id"`
ParagraphID int64 `gorm:"column:paragraph_id;type:integer;not null" json:"paragraphID"`
ArticleID int64 `gorm:"column:article_id;type:integer;not null" json:"articleID"`
Created time.Time `gorm:"column:created;type:datetime;not null" json:"created"`
LastModified time.Time `gorm:"column:last_modified;type:datetime;not null" json:"lastModified"`
}
func (*ReferenceArticle) BeforeSave ¶
func (a *ReferenceArticle) BeforeSave(db *gorm.DB) error
func (*ReferenceArticle) TableName ¶
func (a *ReferenceArticle) TableName() string
type ReferenceArticles ¶
type ReferenceArticles []*ReferenceArticle
func (ReferenceArticles) ContainArticleID ¶
func (a ReferenceArticles) ContainArticleID(articleID int64) bool
func (ReferenceArticles) ExtractArticleIDs ¶
func (a ReferenceArticles) ExtractArticleIDs() []int64
func (ReferenceArticles) ExtractIDs ¶
func (a ReferenceArticles) ExtractIDs() []int64
type ReferenceWeb ¶
type ReferenceWeb struct {
ID int64 `gorm:"column:id;primarykey" json:"id"`
ParagraphID int64 `gorm:"column:paragraph_id;type:integer;not null" json:"paragraphID"`
URL string `gorm:"column:url;type:varchar(256);not null" json:"url"`
Created time.Time `gorm:"column:created;type:datetime;not null" json:"created"`
LastModified time.Time `gorm:"column:last_modified;type:datetime;not null" json:"lastModified"`
}
func (*ReferenceWeb) BeforeSave ¶
func (w *ReferenceWeb) BeforeSave(db *gorm.DB) error
func (*ReferenceWeb) TableName ¶
func (w *ReferenceWeb) TableName() string
type ReferenceWebs ¶
type ReferenceWebs []*ReferenceWeb
func (ReferenceWebs) ContainURL ¶
func (a ReferenceWebs) ContainURL(url string) bool
func (ReferenceWebs) ExtractIDs ¶
func (a ReferenceWebs) ExtractIDs() []int64
type Tags ¶
type Tags []string
func (Tags) FilterExcluded ¶
func (t Tags) FilterExcluded(articleTags ArticleTags) Tags
func (Tags) RemoveDuplicates ¶ added in v0.14.0
Click to show internal directories.
Click to hide internal directories.