Documentation ¶
Index ¶
- type Repository
- func (r *Repository) DeleteSentence(ctx context.Context, sentenceID int64) (int64, error)
- func (r *Repository) InsertNewSentence(ctx context.Context, sentence *entity.Sentence) (int64, error)
- func (r *Repository) SelectSentenceById(ctx context.Context, sentenceID int64) (entity.Sentence, error)
- func (r *Repository) SelectSentenceList(ctx context.Context) ([]entity.Sentence, error)
- func (r *Repository) UpdateSentence(ctx context.Context, sentenceID int64, body string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
func ConnectToDatabase ¶
To be able to close *sql.DB before finishing application process, this function needs to return a function which executes *sql.DB.Close()
func (*Repository) DeleteSentence ¶
func (*Repository) InsertNewSentence ¶
func (r *Repository) InsertNewSentence(ctx context.Context, sentence *entity.Sentence) (int64, error)
Insert a new sentence into db
func (*Repository) SelectSentenceById ¶
func (*Repository) SelectSentenceList ¶
func (*Repository) UpdateSentence ¶
Click to show internal directories.
Click to hide internal directories.