Documentation ¶
Index ¶
- func NewDB() (db *gorm.DB, err error)
- type AuthRepository
- type OGPRepository
- type PostRepository
- func (r *PostRepository) Count(condition string, params []interface{}) (count int, err error)
- func (r *PostRepository) Create(post *entity.Post) error
- func (r *PostRepository) Delete(id string) error
- func (r *PostRepository) FindAll(offset, pageSize int, condition string, params []interface{}, ...) (posts []*entity.Post, err error)
- func (r *PostRepository) FindByID(id string) (*entity.Post, error)
- func (r *PostRepository) FindByPermalink(permalink string) (*entity.Post, error)
- func (r *PostRepository) Update(post *entity.Post) error
- type PostsTagsRepository
- type TagRepository
- func (r *TagRepository) Count() (count int, err error)
- func (r *TagRepository) Delete(id string) error
- func (r *TagRepository) FindAll(offset, pageSize int, condition string, params []interface{}) (tags []*entity.Tag, err error)
- func (r *TagRepository) FindByID(id string) (*entity.Tag, error)
- func (r *TagRepository) FindByName(name string) (*entity.Tag, error)
- func (r *TagRepository) Store(tag *entity.Tag) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
func NewAuthRepository ¶
func NewAuthRepository(client *auth.Client) *AuthRepository
func (*AuthRepository) CreateCookie ¶
func (*AuthRepository) IsValidCookie ¶
func (r *AuthRepository) IsValidCookie(cookie string) (bool, error)
type OGPRepository ¶
type OGPRepository struct {
// contains filtered or unexported fields
}
func NewOGPRepository ¶
func NewOGPRepository() *OGPRepository
func (*OGPRepository) FindByURL ¶
func (r *OGPRepository) FindByURL(url string) (*opengraph.OpenGraph, error)
func (*OGPRepository) Set ¶
func (r *OGPRepository) Set(ogp *opengraph.OpenGraph)
type PostRepository ¶
type PostRepository struct {
// contains filtered or unexported fields
}
func NewPostRepository ¶
func NewPostRepository(db *gorm.DB) *PostRepository
func (*PostRepository) Count ¶
func (r *PostRepository) Count(condition string, params []interface{}) (count int, err error)
func (*PostRepository) Delete ¶
func (r *PostRepository) Delete(id string) error
func (*PostRepository) FindByID ¶
func (r *PostRepository) FindByID(id string) (*entity.Post, error)
func (*PostRepository) FindByPermalink ¶
func (r *PostRepository) FindByPermalink(permalink string) (*entity.Post, error)
type PostsTagsRepository ¶
type PostsTagsRepository struct {
// contains filtered or unexported fields
}
func NewPostsTagsRepository ¶
func NewPostsTagsRepository(db *gorm.DB) *PostsTagsRepository
func (*PostsTagsRepository) Delete ¶
func (r *PostsTagsRepository) Delete(id string) error
func (*PostsTagsRepository) DeleteByPostID ¶
func (r *PostsTagsRepository) DeleteByPostID(postID string) error
func (*PostsTagsRepository) FindByPostIDAndTagName ¶
func (r *PostsTagsRepository) FindByPostIDAndTagName(postID, tagName string) (*entity.PostsTags, error)
type TagRepository ¶
type TagRepository struct {
// contains filtered or unexported fields
}
func NewTagRepository ¶
func NewTagRepository(db *gorm.DB) *TagRepository
func (*TagRepository) Count ¶
func (r *TagRepository) Count() (count int, err error)
func (*TagRepository) Delete ¶
func (r *TagRepository) Delete(id string) error
func (*TagRepository) FindByName ¶
func (r *TagRepository) FindByName(name string) (*entity.Tag, error)
Click to show internal directories.
Click to hide internal directories.