user_profile

package
v0.0.0-...-80b2b3e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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 (r *Repository) FindUserByAccount(accountID string) (user models.User, found bool, err error)

func (*Repository) FindUserNote

func (r *Repository) FindUserNote(accountID string, address string) (note models.UserNote, found bool, err error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL