Skip to content

Instantly share code, notes, and snippets.

@agusrichard
Created June 6, 2021 21:59
Show Gist options
  • Select an option

  • Save agusrichard/30aab7e9b70fcb832915d3ecc82103c6 to your computer and use it in GitHub Desktop.

Select an option

Save agusrichard/30aab7e9b70fcb832915d3ecc82103c6 to your computer and use it in GitHub Desktop.
type tweetUsecase struct {
tweetRepository repositories.TweetRepository
}
type TweetUsecase interface {
CreateTweet(tweet *entities.Tweet) error
// ... other methods
}
func InitializeTweetUsecase(repository repositories.TweetRepository) TweetUsecase {
return &tweetUsecase{repository}
}
func (usecase *tweetUsecase) CreateTweet(tweet *entities.Tweet) error {
// ... detail process here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment