Documentation ¶
Index ¶
- type Repo
- type Repository
- func (r *Repository) Count(filter models.Account) (count int64, err error)
- func (r *Repository) Filter(filter models.Account, limit, offset uint) (accounts []models.Account, err error)
- func (r *Repository) Find(filter models.Account) (found bool, acc models.Account, err error)
- func (r *Repository) List(limit, offset uint, filter models.AccountFilter) (count int64, accounts []models.Account, err error)
- func (r *Repository) TotalBalance() (b int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { List(limit uint, offset uint, filter models.AccountFilter) (int64, []models.Account, error) Filter(filter models.Account, limit, offset uint) (accounts []models.Account, err error) Count(filter models.Account) (int64, error) Find(filter models.Account) (found bool, acc models.Account, err error) TotalBalance() (int64, error) }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the account repo implementation.
func New ¶
func New(db *gorm.DB) *Repository
New creates an instance of repository using the provided db.
func (*Repository) Count ¶
func (r *Repository) Count(filter models.Account) (count int64, err error)
Count counts a number of accounts sutisfying the filter.
func (*Repository) Filter ¶
func (r *Repository) Filter(filter models.Account, limit, offset uint) (accounts []models.Account, err error)
Filter returns a list of accounts that sutisfies the filter.
func (*Repository) List ¶
func (r *Repository) List(limit, offset uint, filter models.AccountFilter) (count int64, accounts []models.Account, err error)
List returns a list of accounts from the newest to oldest. limit defines the limit for the maximum number of accounts returned. before is used to paginate results based on the level. As the result is ordered descendingly the accounts with level < before will be returned.
func (*Repository) TotalBalance ¶
func (r *Repository) TotalBalance() (b int64, err error)
TotalBalance gets the total available balance of all accounts.
Directories ¶
Path | Synopsis |
---|---|
Package mock_account is a generated GoMock package.
|
Package mock_account is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.