Documentation ¶
Index ¶
- type RecordNotFoundError
- type StoryRepo
- func (r *StoryRepo) Create(newStory *entity.Story) error
- func (r *StoryRepo) Delete(existingStory *entity.Story) error
- func (r *StoryRepo) Get(storyID int) (*entity.Story, error)
- func (r *StoryRepo) Get10LatestStories() ([]*entity.Story, error)
- func (r *StoryRepo) GetByAuthorID(writerID int) ([]*entity.Story, error)
- func (r *StoryRepo) Update(updatedStory *entity.Story) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RecordNotFoundError ¶
type RecordNotFoundError struct { Entity interface{} ID int }
RecordNotFoundError is used when repository search failed to find an entity
func (*RecordNotFoundError) Error ¶
func (e *RecordNotFoundError) Error() string
type StoryRepo ¶
type StoryRepo struct {
// contains filtered or unexported fields
}
func NewStoryRepo ¶
func NewStoryRepo() *StoryRepo
NewStoryRepo initializes a new StoryRepo instance
func (*StoryRepo) Get10LatestStories ¶
Get10LatestStories retrieve 10 newest stories ordered by latest update
func (*StoryRepo) GetByAuthorID ¶
GetByAuthorID retrieves all stories that the writerID involved
Click to show internal directories.
Click to hide internal directories.