Documentation ¶
Index ¶
- type BlogPost
- type CreateRq
- type Repository
- func (r Repository) Create(bp BlogPost) error
- func (r Repository) GetAllPublished() ([]BlogPost, error)
- func (r Repository) GetByCreatedBy(userID string) ([]BlogPost, error)
- func (r Repository) GetByIDAndAuthor(id, authorID string) (BlogPost, error)
- func (r Repository) GetBySlug(slug string) (BlogPost, error)
- func (r Repository) Publish(bp BlogPost) error
- func (r Repository) Unpublish(bp BlogPost) error
- func (r Repository) Update(bp BlogPost) error
- type UpdateRq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *sql.DB) *Repository
func (Repository) Create ¶
func (r Repository) Create(bp BlogPost) error
func (Repository) GetAllPublished ¶
func (r Repository) GetAllPublished() ([]BlogPost, error)
func (Repository) GetByCreatedBy ¶
func (r Repository) GetByCreatedBy(userID string) ([]BlogPost, error)
func (Repository) GetByIDAndAuthor ¶
func (r Repository) GetByIDAndAuthor(id, authorID string) (BlogPost, error)
func (Repository) Publish ¶
func (r Repository) Publish(bp BlogPost) error
func (Repository) Unpublish ¶
func (r Repository) Unpublish(bp BlogPost) error
func (Repository) Update ¶
func (r Repository) Update(bp BlogPost) error
Click to show internal directories.
Click to hide internal directories.