Documentation ¶
Index ¶
- type Repo
- type Repository
- func (r *Repository) CreateEmailToken(verification models.EmailVerification) error
- func (r *Repository) CreateUser(user models.User) error
- func (r *Repository) CreateUserAddress(address models.UserAddress) error
- func (r *Repository) CreateUserNote(note models.UserNote) error
- func (r *Repository) DeleteUserAddress(accountID string, address string) error
- func (r *Repository) DeleteUserNote(accountID string, address string) error
- func (r *Repository) FindUserByAccount(accountID string) (user models.User, found bool, err error)
- func (r *Repository) FindUserNote(accountID string, address string) (note models.UserNote, found bool, err error)
- func (r *Repository) GetEmailVerification(accountID string, email string) (verification models.EmailVerification, found bool, err error)
- func (r *Repository) GetEmailVerifications(sent bool, tokens []string) (verifications []models.EmailVerification, err error)
- func (r *Repository) GetUserAddress(accountID string, address string) (model models.UserAddress, found bool, err error)
- func (r *Repository) GetUserAddresses(accountID string) (addresses []models.UserAddressWithBalance, err error)
- func (r *Repository) GetUserAddressesCount(accountID string) (count uint64, err error)
- func (r *Repository) GetUserNotesCount(accountID string) (count uint64, err error)
- func (r *Repository) GetVerifiedUsersAndAddresses(addresses []string) (items []models.UserAddressWithEmail, err error)
- func (r *Repository) UpdateEmailVerification(verification models.EmailVerification) error
- func (r *Repository) UpdateUser(user models.User) error
- func (r *Repository) UpdateUserAddress(address models.UserAddress) error
- func (r *Repository) UpdateUserNote(note models.UserNote) error
- func (r *Repository) UserNotesList(accountID string) (notes []models.UserNoteWithBalance, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { FindUserByAccount(accountID string) (user models.User, found bool, err error) CreateUser(user models.User) error UpdateUser(user models.User) error GetVerifiedUsersAndAddresses(addresses []string) (users []models.UserAddressWithEmail, err error) GetUserAddresses(accountID string) (addresses []models.UserAddressWithBalance, err error) GetUserAddress(accountID string, address string) (model models.UserAddress, found bool, err error) CreateUserAddress(address models.UserAddress) error DeleteUserAddress(accountID string, address string) error UpdateUserAddress(address models.UserAddress) error GetUserAddressesCount(accountID string) (count uint64, err error) UserNotesList(accountID string) (notes []models.UserNoteWithBalance, err error) FindUserNote(accountID string, address string) (note models.UserNote, found bool, err error) CreateUserNote(models.UserNote) error DeleteUserNote(accountID string, address string) error UpdateUserNote(models.UserNote) error GetUserNotesCount(accountID string) (count uint64, err error) GetEmailVerification(accountID string, email string) (verification models.EmailVerification, found bool, err error) CreateEmailToken(verification models.EmailVerification) error GetEmailVerifications(sent bool, tokens []string) (verifications []models.EmailVerification, err error) UpdateEmailVerification(verification models.EmailVerification) error }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the user profile repo implementation.
func New ¶
func New(db *gorm.DB) *Repository
New creates an instance of repository using the provided db.
func (*Repository) CreateEmailToken ¶
func (r *Repository) CreateEmailToken(verification models.EmailVerification) error
func (*Repository) CreateUser ¶
func (r *Repository) CreateUser(user models.User) error
func (*Repository) CreateUserAddress ¶
func (r *Repository) CreateUserAddress(address models.UserAddress) error
func (*Repository) CreateUserNote ¶
func (r *Repository) CreateUserNote(note models.UserNote) error
func (*Repository) DeleteUserAddress ¶
func (r *Repository) DeleteUserAddress(accountID string, address string) error
func (*Repository) DeleteUserNote ¶
func (r *Repository) DeleteUserNote(accountID string, address string) error
func (*Repository) FindUserByAccount ¶
func (*Repository) FindUserNote ¶
func (*Repository) GetEmailVerification ¶
func (r *Repository) GetEmailVerification(accountID string, email string) (verification models.EmailVerification, found bool, err error)
func (*Repository) GetEmailVerifications ¶
func (r *Repository) GetEmailVerifications(sent bool, tokens []string) (verifications []models.EmailVerification, err error)
func (*Repository) GetUserAddress ¶
func (r *Repository) GetUserAddress(accountID string, address string) (model models.UserAddress, found bool, err error)
func (*Repository) GetUserAddresses ¶
func (r *Repository) GetUserAddresses(accountID string) (addresses []models.UserAddressWithBalance, err error)
func (*Repository) GetUserAddressesCount ¶
func (r *Repository) GetUserAddressesCount(accountID string) (count uint64, err error)
func (*Repository) GetUserNotesCount ¶
func (r *Repository) GetUserNotesCount(accountID string) (count uint64, err error)
func (*Repository) GetVerifiedUsersAndAddresses ¶
func (r *Repository) GetVerifiedUsersAndAddresses(addresses []string) (items []models.UserAddressWithEmail, err error)
func (*Repository) UpdateEmailVerification ¶
func (r *Repository) UpdateEmailVerification(verification models.EmailVerification) error
func (*Repository) UpdateUser ¶
func (r *Repository) UpdateUser(user models.User) error
func (*Repository) UpdateUserAddress ¶
func (r *Repository) UpdateUserAddress(address models.UserAddress) error
func (*Repository) UpdateUserNote ¶
func (r *Repository) UpdateUserNote(note models.UserNote) error
func (*Repository) UserNotesList ¶
func (r *Repository) UserNotesList(accountID string) (notes []models.UserNoteWithBalance, err error)
Click to show internal directories.
Click to hide internal directories.