Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created June 4, 2019 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eminetto/fa75539785fd909a840c496129e985e6 to your computer and use it in GitHub Desktop.
Save eminetto/fa75539785fd909a840c496129e985e6 to your computer and use it in GitHub Desktop.
type Reader interface {
Find(id entity.ID) (*entity.User, error)
FindByEmail(email string) (*entity.User, error)
FindByChangePasswordHash(hash string) (*entity.User, error)
FindByValidationHash(hash string) (*entity.User, error)
FindByChallengeSubmissionHash(hash string) (*entity.User, error)
FindByNickname(nickname string) (*entity.User, error)
FindAll() ([]*entity.User, error)
}
type Writer interface {
Update(user *entity.User) error
Store(user *entity.User) (entity.ID, error)
Remove(id entity.ID) error
}
type Repository interface {
Reader
Writer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment