Created
June 6, 2021 21:40
-
-
Save agusrichard/a3cd2a4eadd81125a2beccf288113825 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type tweetRepository struct { | |
| db *sqlx.DB | |
| } | |
| type TweetRepository interface { | |
| CreateTweet(tweet *entities.Tweet) error | |
| // ... another methods for tweet repository | |
| } | |
| func InitializeTweetRepository(db *sqlx.DB) TweetRepository { | |
| return &tweetRepository{db} | |
| } | |
| func (repository *tweetRepository) CreateTweet(tweet *entities.Tweet) error { | |
| // ... some insert operation detail here | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment