Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAccountExist = errors.New("account exist")
)
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { io.Closer InsertAccount(account *models.Account) error FindAccountByUsername(username string) (models.Account, error) FindAll() ([]models.Account, error) DeleteAccountByUsername(username string) (models.Account, error) UpdateAccountByUsername(username string, account map[string]interface{}) (models.Account, error) }
Repository handles the basic operations of a account entity/model. It's an interface in order to be testable, i.e a memory account repository or a connected to an sql database.
func NewAccountRepository ¶
func NewAccountRepository() Repository
NewAccountRepository returns a new account memory-based repository, the one and only repository type in our example.
Click to show internal directories.
Click to hide internal directories.