postgre

package
v0.0.0-...-12c9185 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2018 License: MIT Imports: 9 Imported by: 1

Documentation

Index

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

func (StoryRepository) Insert

func (s StoryRepository) Insert(story chronicle.Story) (createdStory chronicle.Story, err error)

Insert insert story to datastore

func (StoryRepository) Update

func (s StoryRepository) Update(story chronicle.Story) (createdStory chronicle.Story, err error)

Update update story

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

func (TopicRepository) Insert

func (s TopicRepository) Insert(topic chronicle.Topic) (createdTopic chronicle.Topic, err error)

Insert insert topic to datastore

func (TopicRepository) Update

func (s TopicRepository) Update(topic chronicle.Topic) (updatedTopic chronicle.Topic, err error)

Update update topic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL