Documentation
¶
Index ¶
- Variables
- func CheckFiles() error
- func GetBranches(platform, mid string, r *[]Post)
- func GetPosts(begin, end string, r *[]Post)
- func HasPost(platform, mid string) bool
- func Init(r *configs.Config)
- func Public() resource.Explorer
- func Save(url string) string
- func SavePost(p *Post)
- func SavePosts(p ...*Post)
- type Attachment
- type Attachments
- type Blogger
- type Monitor
- type Post
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Data db.DB
)
Functions ¶
func CheckFiles ¶ added in v0.6.0
func CheckFiles() error
Types ¶
type Attachment ¶
type Attachment struct {
db.Model
// 原网址
Url string `form:"url" gorm:"unique" cmps:"1"`
// 本地路径
Local string
// 同浏览器 MIME type 附件的媒体类型
MIME string
}
附件
func (Attachment) MarshalJSON ¶
func (a Attachment) MarshalJSON() ([]byte, error)
func (*Attachment) Path ¶
func (a *Attachment) Path() string
func (*Attachment) Save ¶ added in v0.7.0
func (a *Attachment) Save()
func (*Attachment) Store ¶
func (a *Attachment) Store(data []byte)
func (Attachment) String ¶
func (a Attachment) String() string
type Attachments ¶
type Attachments []Attachment
附件合集
func (Attachments) String ¶
func (as Attachments) String() string
func (Attachments) Urls ¶
func (as Attachments) Urls() string
type Blogger ¶
type Blogger struct {
db.Model
Platform string `form:"platform" json:"platform"`
Uid string `form:"uid" json:"uid" cmps:"1"`
Create string `form:"create" json:"create"`
Name string `form:"name" json:"name"`
Description string `form:"description" json:"description"`
Follower string `form:"follower" json:"follower"`
Following string `form:"following" json:"following"`
FaceID int64 `gorm:"column:face" json:"-"`
Face Attachment `form:"face" json:"face" preload:"1"`
PendantID int64 `gorm:"column:pendant" json:"-"`
Pendant Attachment `form:"pendant" json:"pendant" preload:"2"`
}
博主信息部分
type Post ¶
type Post struct {
db.Model
// 平台
Platform string `form:"platform" json:"platform"`
// 博文序号
Mid string `form:"mid" json:"mid"`
// 发送时间
Time string `form:"time" json:"time"`
// 文本
Text string `form:"text" json:"text"`
// 内容
Content string `gorm:"-" form:"-" json:"-"`
// 来源
Source string `form:"source" json:"source"`
// 博主
BloggerID string `form:"-" json:"-" gorm:"column:blogger"`
Blogger Blogger `form:"blogger" json:"blogger" preload:""`
// 回复
RepostID *uint64 `form:"-" json:"-" gorm:"column:repost"`
Repost *Post `form:"repost" json:"repost"`
// 评论
CommentID *uint64 `form:"-" json:"-" gorm:"column:comment"`
Comments []Post `form:"comments" json:"comments" gorm:"foreignKey:CommentID"`
// 附件
Attachments Attachments `form:"attachments" json:"attachments" gorm:"many2many:post_attachments;"`
// 提交者
Submitter *user.User `form:"-" json:"submitter"`
// 编辑距离
Distance int `gorm:"-" form:"-" json:"-" cmps:"1"`
// 替换器
Replacer *strings.Replacer `gorm:"-" form:"-" json:"-"`
}
博文或评论
Click to show internal directories.
Click to hide internal directories.