Documentation ¶
Index ¶
- Variables
- type BlogRepository
- func (r *BlogRepository) BeginTransaction() (*sql.Tx, error)
- func (r *BlogRepository) CountBlogs(userId int) (*int, error)
- func (r *BlogRepository) Create(now time.Time, input model.CreateBlogInput, userId int) (*model.Blog, error)
- func (r *BlogRepository) DeleteById(tx *sql.Tx, blogId string, userId int) error
- func (r *BlogRepository) DeleteByUserId(tx *sql.Tx, userId int) error
- func (r *BlogRepository) FindByBlogKey(blogKey string, opts *model.BlogByKeyOpts, passwordInputTime *time.Time) (*model.Blog, error)
- func (r *BlogRepository) FindById(blogId string, userId int) (*model.Blog, error)
- func (r *BlogRepository) FindByUserId(userId int) ([]*model.Blog, error)
- func (r *BlogRepository) IsAuthor(blogKey string, userId int) (bool, error)
- func (r *BlogRepository) Update(now time.Time, input model.UpdateBlogInput, userId int) (*model.Blog, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var PublishOptionField = "CASE publish_option WHEN 1 THEN \"" + model.PublishOptionPublic.String() + "\" WHEN 2 THEN \"" + model.PublishOptionPassword.String() + "\" ELSE \"" + model.PublishOptionPrivate.String() + "\" END AS publsh_option"
Functions ¶
This section is empty.
Types ¶
type BlogRepository ¶
type BlogRepository struct {
// contains filtered or unexported fields
}
func NewBlogRepository ¶
func NewBlogRepository(db *sql.DB) *BlogRepository
func (*BlogRepository) BeginTransaction ¶
func (r *BlogRepository) BeginTransaction() (*sql.Tx, error)
func (*BlogRepository) CountBlogs ¶
func (r *BlogRepository) CountBlogs(userId int) (*int, error)
func (*BlogRepository) Create ¶
func (r *BlogRepository) Create(now time.Time, input model.CreateBlogInput, userId int) (*model.Blog, error)
func (*BlogRepository) DeleteById ¶
func (*BlogRepository) DeleteByUserId ¶
func (r *BlogRepository) DeleteByUserId(tx *sql.Tx, userId int) error
func (*BlogRepository) FindByBlogKey ¶
func (r *BlogRepository) FindByBlogKey(blogKey string, opts *model.BlogByKeyOpts, passwordInputTime *time.Time) (*model.Blog, error)
func (*BlogRepository) FindByUserId ¶
func (r *BlogRepository) FindByUserId(userId int) ([]*model.Blog, error)
Click to show internal directories.
Click to hide internal directories.