Documentation ¶
Index ¶
- Variables
- func GetBranches(platform, mid string, r *[]Post)
- func GetPosts(begin, end string, r *[]Post)
- func HasPost(platform, mid string) bool
- func Reset(resource, file string)
- type Attachment
- func (a *Attachment) Download(url string)
- func (a *Attachment) Make(url string) *Attachment
- func (a *Attachment) NotExist() bool
- func (a *Attachment) ParseType()
- func (a *Attachment) SaveToLocal()
- func (a *Attachment) Scan(val any) error
- func (a Attachment) String() string
- func (a Attachment) ToURL() string
- func (a Attachment) Value() (driver.Value, error)
- type Attachments
- type Blogger
- type Comment
- type Comments
- type Post
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 资源文件夹 Resource = "resource" // 数据库文件名 File = "posts.db" )
Functions ¶
Types ¶
type Attachment ¶
type Attachment struct { // 数据库内序号 ID int64 `gorm:"primaryKey;autoIncrement" json:"-"` // 同浏览器 MIME type 附件的媒体类型 MIME string // 本地路径 Path string `json:"path"` // contains filtered or unexported fields }
附件
func NewA ¶
func NewA(url string) Attachment
func (*Attachment) Scan ¶
func (a *Attachment) Scan(val any) error
type Attachments ¶
type Attachments []Attachment
附件合集
func (*Attachments) Make ¶
func (as *Attachments) Make(urls ...string)
func (*Attachments) Scan ¶
func (as *Attachments) Scan(val any) error
type Blogger ¶
type Blogger struct { ID int64 `gorm:"primaryKey;autoIncrement" form:"-" json:"-"` Platform string `form:"platform" json:"platform"` Uid string `form:"uid" json:"uid"` CreatedAt string `gorm:"column:create" form:"create" json:"create"` Name string `form:"name" json:"name"` Face Attachment `form:"-" json:"face"` Pendant Attachment `form:"-" json:"pendant"` Description string `form:"description" json:"description"` Follower string `form:"follower" json:"follower"` Following string `form:"following" json:"following"` }
博主信息部分
type Post ¶
type Post struct { ID int64 `gorm:"primaryKey;autoIncrement" form:"-" json:"-"` // 平台 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"` // 博主 Blogger // 附件 Attachments `form:"-" json:"attachments"` // 回复 Repost *Post `form:"-" json:"repost"` // 被回复 Comments []*Comment `gorm:"-" form:"-" json:"comments"` // 提交者 Submitter *user.User `form:"-"` }
博文或评论
Click to show internal directories.
Click to hide internal directories.