Documentation ¶
Index ¶
- func GetConnString() string
- type StoryRepository
- func (s StoryRepository) All(option chronicle.PagingOptions) (stories chronicle.Stories, storiesCount int, err error)
- func (s StoryRepository) Delete(id int) (err error)
- func (s StoryRepository) Find(id int) (story chronicle.Story, err error)
- func (s StoryRepository) FindBySlug(slug string) (story chronicle.Story, err error)
- func (s StoryRepository) FindByStatus(status string, option chronicle.PagingOptions) (stories chronicle.Stories, storiesCount int, err error)
- func (s StoryRepository) FindByTopicAndStatus(topic int, status string, option chronicle.PagingOptions) (stories chronicle.Stories, storiesCount int, err error)
- func (s StoryRepository) Insert(story chronicle.Story) (createdStory chronicle.Story, err error)
- func (s StoryRepository) Update(story chronicle.Story) (createdStory chronicle.Story, err error)
- type TopicRepository
- func (s TopicRepository) All(option chronicle.PagingOptions) (topics chronicle.Topics, topicsCount int, err error)
- func (s TopicRepository) Delete(id int) (err error)
- func (s TopicRepository) Find(id int) (topic chronicle.Topic, err error)
- func (s TopicRepository) FindBySlug(slug string) (topic chronicle.Topic, err error)
- func (s TopicRepository) Insert(topic chronicle.Topic) (createdTopic chronicle.Topic, err error)
- func (s TopicRepository) Update(topic chronicle.Topic) (updatedTopic chronicle.Topic, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConnString ¶
func GetConnString() string
Types ¶
type StoryRepository ¶
type StoryRepository struct {
// contains filtered or unexported fields
}
StoryRepository is implementation of StoryRepository interface of chronicle domain using postgre
func NewStoryRepository ¶
func NewStoryRepository(conn *sqlx.DB, tableName string) *StoryRepository
NewStoryRepository is constructor to create story repository
func (StoryRepository) All ¶
func (s StoryRepository) All(option chronicle.PagingOptions) (stories chronicle.Stories, storiesCount int, err error)
All get all stories
func (StoryRepository) Delete ¶
func (s StoryRepository) Delete(id int) (err error)
Delete delete story by id
func (StoryRepository) Find ¶
func (s StoryRepository) Find(id int) (story chronicle.Story, err error)
Find find story by id
func (StoryRepository) FindBySlug ¶
func (s StoryRepository) FindBySlug(slug string) (story chronicle.Story, err error)
FindBySlug find story by slug
func (StoryRepository) FindByStatus ¶
func (s StoryRepository) FindByStatus(status string, option chronicle.PagingOptions) (stories chronicle.Stories, storiesCount int, err error)
FindByStatus find all story with status x
func (StoryRepository) FindByTopicAndStatus ¶
func (s StoryRepository) FindByTopicAndStatus(topic int, status string, option chronicle.PagingOptions) (stories chronicle.Stories, storiesCount int, err error)
FindByTopicAndStatus find all story with topic x and status y
type TopicRepository ¶
type TopicRepository struct {
// contains filtered or unexported fields
}
TopicRepository is implementation of TopicRepository interface of chronicle domain using postgre
func NewTopicRepository ¶
func NewTopicRepository(conn *sqlx.DB, tableName string) *TopicRepository
NewTopicRepository is constructor to create topic repository
func (TopicRepository) All ¶
func (s TopicRepository) All(option chronicle.PagingOptions) (topics chronicle.Topics, topicsCount int, err error)
All get all topic
func (TopicRepository) Delete ¶
func (s TopicRepository) Delete(id int) (err error)
Delete delete topic by id
func (TopicRepository) Find ¶
func (s TopicRepository) Find(id int) (topic chronicle.Topic, err error)
Find find topic by id
func (TopicRepository) FindBySlug ¶
func (s TopicRepository) FindBySlug(slug string) (topic chronicle.Topic, err error)
FindBySlug find topic by slug
Click to show internal directories.
Click to hide internal directories.