Documentation ¶
Index ¶
- type Comment
- type Mysql
- func (m *Mysql) Close()
- func (m *Mysql) GetComment(articleKey, siteDomain string, lastCommentID *string) ([]Comment, []User)
- func (m *Mysql) GetSiteByDomain(domain string) *Site
- func (m *Mysql) GetUserByEmail(email string) *User
- func (m *Mysql) GetUserByID(id string) *User
- func (m *Mysql) InsertComment(comm *Comment) bool
- func (m *Mysql) InsertSite(site *Site) bool
- func (m *Mysql) InsertUser(user *User) bool
- type Site
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { CommentID uint32 ArticleID string ArticleKey string UserID string SiteID string Content string TimeStamp time.Time ReplyID sql.NullInt64 Deleted bool }
Comment comment表对应的数据结构
func NewComment ¶
NewComment 创建一个新评论的数据结构
type Mysql ¶
type Mysql struct {
// contains filtered or unexported fields
}
Mysql Mysql连接类
func (*Mysql) GetComment ¶
func (m *Mysql) GetComment(articleKey, siteDomain string, lastCommentID *string) ([]Comment, []User)
GetComment 通过articleKey和SiteDomain来查询评论 如果传入了lastCommentID 则返回 lastCommentID 以后的评论
func (*Mysql) GetSiteByDomain ¶
GetSiteByDomain 通过域名返回站点
func (*Mysql) GetUserByEmail ¶
GetUserByEmail 通过email获取用户信息
func (*Mysql) InsertComment ¶
InsertComment 向数据库中插入新用户
Click to show internal directories.
Click to hide internal directories.