Documentation ¶
Index ¶
- type AuthRepository
- func (a *AuthRepository) GitHubAccessURL(uuid string) (url string)
- func (a *AuthRepository) GitHubExchangeTokenByCode(code string) (accessToken string, err error)
- func (a *AuthRepository) GithubUserBing(sessionUser interface{}, githubUser *models.GithubUserInfo) (user *models.User, err error)
- func (a *AuthRepository) GithubUserCreate(github *models.GithubUserInfo) (user *models.User, err error)
- func (a *AuthRepository) GithubUserInfoByAccessToken(token string) (*models.GithubUserInfo, error)
- type CaptchaImageResponse
- type CaptchaRepository
- func (c *CaptchaRepository) GetCaptchaImage(length int) CaptchaImageResponse
- func (c *CaptchaRepository) ServeHTTPCaptcha(id string, reload bool) (content bytes.Buffer, err error)
- func (c *CaptchaRepository) ServeImage(id string, width, height int, reload bool) (content bytes.Buffer, err error)
- func (c *CaptchaRepository) VerifyCaptcha(captchaId string, value string) (err error)
- type CommentRepository
- type IAuthRepository
- type ICaptchaRepository
- type ICommentRepository
- type ILinkRepository
- type IMailRepository
- type IPageRepository
- type IPostRepository
- type ISubscriberRepository
- type ITagRepository
- type IUserRepository
- type IValidatorRepository
- type LinkRepository
- func (l *LinkRepository) Create() (link models.Link, err error)
- func (l *LinkRepository) Delete() (uint, error)
- func (l *LinkRepository) GetLinkById(id uint) (models.Link, error)
- func (l *LinkRepository) ListAllLink(columns []string) (links []*models.Link, err error)
- func (l *LinkRepository) ListLink(per, page int, columns []string) (links []*models.Link, err error)
- func (l *LinkRepository) Show() (link models.Link, err error)
- func (l *LinkRepository) Update(link *models.Link) error
- func (l *LinkRepository) UpdateAttr() (link models.Link, err error)
- type MailRepository
- type PageRepository
- func (p *PageRepository) Create(page models.Page) (models.Page, error)
- func (p *PageRepository) Delete(id uint) error
- func (p *PageRepository) FindPage(id uint) (models.Page, error)
- func (p *PageRepository) GinCreate() (err error)
- func (p *PageRepository) GinUpdate(id uint) error
- func (p *PageRepository) ListAllPage(attr map[string]interface{}) ([]*models.Page, error)
- func (p *PageRepository) ListPage(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Page, error)
- func (p *PageRepository) New() (models.Page, error)
- func (p *PageRepository) Publish(id uint) error
- func (p *PageRepository) PublishPage(per, page uint, attr map[string]interface{}, columns []string) (pages []*models.Page, err error)
- func (p *PageRepository) TotalPage(attr map[string]interface{}) (total int, err error)
- func (p *PageRepository) Update(page *models.Page) error
- func (p *PageRepository) UpdateAttr(page *models.Page, attr map[string]interface{}) error
- func (p *PageRepository) UpdatePage(page *models.Page) error
- type PostRepository
- func (p *PostRepository) CountPost(attr map[string]interface{}) (count int, err error)
- func (p *PostRepository) CountPostByTag(tagId uint) (count int, err error)
- func (p *PostRepository) Create(post *models.Post) error
- func (p *PostRepository) Delete(id uint) error
- func (p *PostRepository) GetPostById(id uint, isTags bool) (*models.Post, error)
- func (p PostRepository) ListAll(attr map[string]interface{}, column []string) (posts []*models.Post, err error)
- func (p *PostRepository) ListMaxCommentPost(columns []string) ([]*models.Post, error)
- func (p *PostRepository) ListMaxReadPost(column []string) ([]*models.Post, error)
- func (p *PostRepository) PublishPost(per, page uint, attr map[string]interface{}, columns []string, isTag bool) ([]*models.Post, error)
- func (p *PostRepository) TagsPost(per, page uint, attr map[string]interface{}, columns []string, tag string) (posts []*models.Post, err error)
- func (p *PostRepository) Update(post *models.Post) (err error)
- func (p *PostRepository) UpdateAttr(post *models.Post, attr map[string]interface{}) error
- type SubscriberRepository
- type TagRepository
- func (t *TagRepository) AllTag(attr map[string]interface{}, columns []string) ([]models.Tag, error)
- func (t *TagRepository) Create(tag models.Tag) (models.Tag, error)
- func (t *TagRepository) Delete(id uint) error
- func (t *TagRepository) DeletePostTagByPostId(postId uint) error
- func (t TagRepository) ListTagByPostId(id uint) (tags []*models.Tag, err error)
- func (t *TagRepository) PostTagCreate(tag *models.PostTag) error
- func (t *TagRepository) PublishTagsList() ([]*models.Tag, error)
- type UserRepository
- func (u *UserRepository) FirstUser() (user *models.User, err error)
- func (u *UserRepository) FirstUserByEmail(email string) (models.User, error)
- func (u *UserRepository) GetUser() (user *models.User, err error)
- func (u *UserRepository) GetUserByID(id int64) (user *models.User, err error)
- func (u *UserRepository) ListAdminUsers(per, page int, columns []string) ([]*models.User, error)
- func (u *UserRepository) ListAllAdminUsers(columns []string) ([]*models.User, error)
- func (u *UserRepository) Lock(user *models.User) error
- func (u *UserRepository) Register() (err error)
- func (u *UserRepository) ReloadGithub(user *models.User) (err error)
- func (u *UserRepository) SetUser(user *models.User) error
- func (u *UserRepository) SignIn(account string, password string) (*models.User, error)
- func (u *UserRepository) Update(user *models.User, attr map[string]interface{}) error
- func (u *UserRepository) UpdateUserAttr(attr map[string]interface{}) error
- type ValidatorRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
func (*AuthRepository) GitHubAccessURL ¶
func (a *AuthRepository) GitHubAccessURL(uuid string) (url string)
func (*AuthRepository) GitHubExchangeTokenByCode ¶
func (a *AuthRepository) GitHubExchangeTokenByCode(code string) (accessToken string, err error)
func (*AuthRepository) GithubUserBing ¶
func (a *AuthRepository) GithubUserBing(sessionUser interface{}, githubUser *models.GithubUserInfo) (user *models.User, err error)
func (*AuthRepository) GithubUserCreate ¶
func (a *AuthRepository) GithubUserCreate(github *models.GithubUserInfo) (user *models.User, err error)
通过github auth进行用户的创建
func (*AuthRepository) GithubUserInfoByAccessToken ¶
func (a *AuthRepository) GithubUserInfoByAccessToken(token string) (*models.GithubUserInfo, error)
通过github获取用户信息
type CaptchaImageResponse ¶
type CaptchaRepository ¶
type CaptchaRepository struct {
// contains filtered or unexported fields
}
func (*CaptchaRepository) GetCaptchaImage ¶
func (c *CaptchaRepository) GetCaptchaImage(length int) CaptchaImageResponse
func (*CaptchaRepository) ServeHTTPCaptcha ¶
func (*CaptchaRepository) ServeImage ¶
func (*CaptchaRepository) VerifyCaptcha ¶
func (c *CaptchaRepository) VerifyCaptcha(captchaId string, value string) (err error)
type CommentRepository ¶
type CommentRepository struct {
// contains filtered or unexported fields
}
func (*CommentRepository) CountComment ¶
func (c *CommentRepository) CountComment() int
func (*CommentRepository) ListCommentByPostID ¶
func (c *CommentRepository) ListCommentByPostID(postId uint) ([]*models.Comment, error)
func (*CommentRepository) MustListUnreadComment ¶
func (c *CommentRepository) MustListUnreadComment() ([]*models.Comment, error)
type IAuthRepository ¶
type IAuthRepository interface { GitHubAccessURL(uuid string) (url string) GitHubExchangeTokenByCode(code string) (accessToken string, err error) GithubUserInfoByAccessToken(token string) (*models.GithubUserInfo, error) GithubUserCreate(github *models.GithubUserInfo) (*models.User, error) GithubUserBing(sessionUser interface{}, githubUser *models.GithubUserInfo) (user *models.User, err error) }
func NewAuthRepository ¶
func NewAuthRepository() IAuthRepository
type ICaptchaRepository ¶
type ICaptchaRepository interface { GetCaptchaImage(length int) CaptchaImageResponse ServeHTTPCaptcha(id string, reload bool) (bytes.Buffer, error) ServeImage(id string, width, height int, reload bool) (content bytes.Buffer, err error) VerifyCaptcha(captchaId string, value string) (err error) }
func NewCaptchaRepository ¶
func NewCaptchaRepository(ctx *gin.Context) ICaptchaRepository
type ICommentRepository ¶
type ICommentRepository interface { MustListUnreadComment() ([]*models.Comment, error) CountComment() int ListCommentByPostID(postId uint) ([]*models.Comment, error) }
func NewCommentRepository ¶
func NewCommentRepository() ICommentRepository
type ILinkRepository ¶
type ILinkRepository interface { ListAllLink(columns []string) (links []*models.Link, err error) ListLink(per, page int, columns []string) (links []*models.Link, err error) Create() (link models.Link, err error) UpdateAttr() (models.Link, error) Update(link *models.Link) error Delete() (uint, error) Show() (link models.Link, err error) GetLinkById(id uint) (models.Link, error) }
func NewLinkRepository ¶
func NewLinkRepository(ctx *gin.Context) ILinkRepository
type IMailRepository ¶
type IMailRepository interface { SendToMail(to string) error SystemDefaultNotify() error GetSystemNotify() string }
func NewMailRepository ¶
func NewMailRepository(subject, body, mailType string) IMailRepository
type IPageRepository ¶
type IPageRepository interface { New() (models.Page, error) GinCreate() error GinUpdate(id uint) error Create(page models.Page) (models.Page, error) UpdateAttr(page *models.Page, attr map[string]interface{}) error Update(page *models.Page) error UpdatePage(page *models.Page) error Delete(id uint) error Publish(id uint) error FindPage(id uint) (models.Page, error) ListAllPage(attr map[string]interface{}) ([]*models.Page, error) ListPage(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Page, error) PublishPage(per, page uint, attr map[string]interface{}, columns []string) (pages []*models.Page, err error) TotalPage(attr map[string]interface{}) (total int, err error) }
func NewPageRepository ¶
func NewPageRepository(ctx *gin.Context) IPageRepository
type IPostRepository ¶
type IPostRepository interface { ListAll(attr map[string]interface{}, column []string) (posts []*models.Post, err error) Create(post *models.Post) error Delete(id uint) error UpdateAttr(post *models.Post, attr map[string]interface{}) error Update(post *models.Post) error GetPostById(id uint, isTags bool) (*models.Post, error) PublishPost(per, page uint, attr map[string]interface{}, columns []string, isTags bool) ([]*models.Post, error) CountPostByTag(tagId uint) (count int, err error) CountPost(attr map[string]interface{}) (count int, err error) ListMaxReadPost(column []string) ([]*models.Post, error) ListMaxCommentPost(columns []string) ([]*models.Post, error) TagsPost(per, page uint, attr map[string]interface{}, columns []string, tag string) (posts []*models.Post, err error) }
func NewPostRepository ¶
func NewPostRepository(ctx *gin.Context) IPostRepository
type ISubscriberRepository ¶
type ISubscriberRepository interface { AllListSubscriber(attr map[string]interface{}, columns []string) ([]*models.Subscriber, error) ListSubscriber(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Subscriber, error) }
func NewSubscriberRepository ¶
func NewSubscriberRepository(ctx *gin.Context) ISubscriberRepository
type ITagRepository ¶
type ITagRepository interface { ListTagByPostId(id uint) (tags []*models.Tag, err error) DeletePostTagByPostId(postId uint) error Create(tag models.Tag) (models.Tag, error) PostTagCreate(tag *models.PostTag) error Delete(id uint) error AllTag(attr map[string]interface{}, columns []string) ([]models.Tag, error) PublishTagsList() ([]*models.Tag, error) }
func NewTagRepository ¶
func NewTagRepository(ctx *gin.Context) ITagRepository
type IUserRepository ¶
type IUserRepository interface { Register() (err error) SignIn(account string, password string) (user *models.User, err error) FirstUser() (*models.User, error) GetUserByID(id int64) (*models.User, error) FirstUserByEmail(email string) (models.User, error) Update(user *models.User, attr map[string]interface{}) error UpdateUserAttr(attr map[string]interface{}) error ListAllAdminUsers(columns []string) ([]*models.User, error) ListAdminUsers(per, page int, columns []string) ([]*models.User, error) ReloadGithub(user *models.User) (err error) Lock(user *models.User) (err error) GetUser() (*models.User, error) SetUser(user *models.User) error }
func NewUserRepository ¶
func NewUserRepository(ctx *gin.Context) IUserRepository
type IValidatorRepository ¶
type IValidatorRepository interface {
HandlerError() error
}
func NewValidatorRepository ¶
func NewValidatorRepository(model interface{}) IValidatorRepository
type LinkRepository ¶
func (*LinkRepository) Create ¶
func (l *LinkRepository) Create() (link models.Link, err error)
创建链接
func (*LinkRepository) Delete ¶
func (l *LinkRepository) Delete() (uint, error)
func (*LinkRepository) GetLinkById ¶
func (l *LinkRepository) GetLinkById(id uint) (models.Link, error)
func (*LinkRepository) ListAllLink ¶
func (l *LinkRepository) ListAllLink(columns []string) (links []*models.Link, err error)
查询link没有进行分页
func (*LinkRepository) ListLink ¶
func (l *LinkRepository) ListLink(per, page int, columns []string) (links []*models.Link, err error)
查询link
func (*LinkRepository) UpdateAttr ¶
func (l *LinkRepository) UpdateAttr() (link models.Link, err error)
更新link
type MailRepository ¶
type MailRepository struct {
// contains filtered or unexported fields
}
邮箱发送功能 @params to: 接受者邮箱 @params subject: 发送主体 @params body: 主体内容 @params mailType: 发送的内容
func (*MailRepository) GetSystemNotify ¶
func (m *MailRepository) GetSystemNotify() string
func (*MailRepository) SendToMail ¶
func (m *MailRepository) SendToMail(to string) error
func (*MailRepository) SystemDefaultNotify ¶
func (m *MailRepository) SystemDefaultNotify() error
type PageRepository ¶
func (*PageRepository) Delete ¶
func (p *PageRepository) Delete(id uint) error
func (*PageRepository) GinCreate ¶
func (p *PageRepository) GinCreate() (err error)
func (*PageRepository) GinUpdate ¶
func (p *PageRepository) GinUpdate(id uint) error
func (*PageRepository) ListAllPage ¶
func (p *PageRepository) ListAllPage(attr map[string]interface{}) ([]*models.Page, error)
func (*PageRepository) Publish ¶
func (p *PageRepository) Publish(id uint) error
func (*PageRepository) PublishPage ¶
func (*PageRepository) TotalPage ¶
func (p *PageRepository) TotalPage(attr map[string]interface{}) (total int, err error)
func (*PageRepository) UpdateAttr ¶
func (p *PageRepository) UpdateAttr(page *models.Page, attr map[string]interface{}) error
func (*PageRepository) UpdatePage ¶
func (p *PageRepository) UpdatePage(page *models.Page) error
type PostRepository ¶
type PostRepository struct {
// contains filtered or unexported fields
}
func (*PostRepository) CountPost ¶
func (p *PostRepository) CountPost(attr map[string]interface{}) (count int, err error)
func (*PostRepository) CountPostByTag ¶
func (p *PostRepository) CountPostByTag(tagId uint) (count int, err error)
func (*PostRepository) Delete ¶
func (p *PostRepository) Delete(id uint) error
func (*PostRepository) GetPostById ¶
func (PostRepository) ListAll ¶
func (p PostRepository) ListAll(attr map[string]interface{}, column []string) (posts []*models.Post, err error)
@title: 获取所有的博客
func (*PostRepository) ListMaxCommentPost ¶
func (p *PostRepository) ListMaxCommentPost(columns []string) ([]*models.Post, error)
func (*PostRepository) ListMaxReadPost ¶
func (p *PostRepository) ListMaxReadPost(column []string) ([]*models.Post, error)
func (*PostRepository) PublishPost ¶
func (*PostRepository) UpdateAttr ¶
func (p *PostRepository) UpdateAttr(post *models.Post, attr map[string]interface{}) error
type SubscriberRepository ¶
func (SubscriberRepository) AllListSubscriber ¶
func (s SubscriberRepository) AllListSubscriber(attr map[string]interface{}, columns []string) ([]*models.Subscriber, error)
func (SubscriberRepository) ListSubscriber ¶
func (s SubscriberRepository) ListSubscriber(per, page uint, attr map[string]interface{}, columns []string) ([]*models.Subscriber, error)
type TagRepository ¶
type TagRepository struct {
// contains filtered or unexported fields
}
func (*TagRepository) Delete ¶
func (t *TagRepository) Delete(id uint) error
func (*TagRepository) DeletePostTagByPostId ¶
func (t *TagRepository) DeletePostTagByPostId(postId uint) error
func (TagRepository) ListTagByPostId ¶
func (t TagRepository) ListTagByPostId(id uint) (tags []*models.Tag, err error)
func (*TagRepository) PostTagCreate ¶
func (t *TagRepository) PostTagCreate(tag *models.PostTag) error
func (*TagRepository) PublishTagsList ¶
func (t *TagRepository) PublishTagsList() ([]*models.Tag, error)
type UserRepository ¶
func (*UserRepository) FirstUser ¶
func (u *UserRepository) FirstUser() (user *models.User, err error)
func (*UserRepository) FirstUserByEmail ¶
func (u *UserRepository) FirstUserByEmail(email string) (models.User, error)
func (*UserRepository) GetUserByID ¶
func (u *UserRepository) GetUserByID(id int64) (user *models.User, err error)
func (*UserRepository) ListAdminUsers ¶
func (*UserRepository) ListAllAdminUsers ¶
func (u *UserRepository) ListAllAdminUsers(columns []string) ([]*models.User, error)
func (*UserRepository) ReloadGithub ¶
func (u *UserRepository) ReloadGithub(user *models.User) (err error)
func (*UserRepository) Update ¶
func (u *UserRepository) Update(user *models.User, attr map[string]interface{}) error
func (*UserRepository) UpdateUserAttr ¶
func (u *UserRepository) UpdateUserAttr(attr map[string]interface{}) error
type ValidatorRepository ¶
type ValidatorRepository struct {
// contains filtered or unexported fields
}
func (*ValidatorRepository) HandlerError ¶
func (v *ValidatorRepository) HandlerError() error
handler validator error
Click to show internal directories.
Click to hide internal directories.