mockdb

package
v0.0.0-...-8cb3723 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ActivateFn                    func(*model.User) error
	CreateFn                      func(*model.User) (*model.User, error)
	CreateAndVerifyFn             func(*model.User) (*model.Verification, error)
	CreateWithMobileFn            func(*model.User) error
	CreateForgotTokenFn           func(*model.User) (*model.Verification, error)
	CreateNewOTPFn                func(*model.User) (*model.Verification, error)
	CreateWithMagicFn             func(*model.User) (int, error)
	ChangePasswordFn              func(*model.User) error
	ResetPasswordFn               func(*model.User) error
	UpdateAvatarFn                func(*model.User) error
	FindVerificationTokenFn       func(string) (*model.Verification, error)
	FindVerificationTokenByUserFn func(*model.User) (*model.Verification, error)
	DeleteVerificationTokenFn     func(*model.Verification) error
}

Account database mock

func (*Account) Activate

func (a *Account) Activate(usr *model.User) error

func (*Account) ChangePassword

func (a *Account) ChangePassword(usr *model.User) error

ChangePassword mock

func (*Account) Create

func (a *Account) Create(usr *model.User) (*model.User, error)

Create mock

func (*Account) CreateAndVerify

func (a *Account) CreateAndVerify(usr *model.User) (*model.Verification, error)

CreateAndVerify mock

func (*Account) CreateForgotToken

func (a *Account) CreateForgotToken(usr *model.User) (*model.Verification, error)

func (*Account) CreateNewOTP

func (a *Account) CreateNewOTP(usr *model.User) (*model.Verification, error)

func (*Account) CreateWithMagic

func (a *Account) CreateWithMagic(usr *model.User) (int, error)

func (*Account) CreateWithMobile

func (a *Account) CreateWithMobile(usr *model.User) error

CreateWithMobile mock

func (*Account) DeleteVerificationToken

func (a *Account) DeleteVerificationToken(v *model.Verification) error

DeleteVerificationToken mock

func (*Account) FindVerificationToken

func (a *Account) FindVerificationToken(token string) (*model.Verification, error)

FindVerificationToken mock

func (*Account) FindVerificationTokenByUser

func (a *Account) FindVerificationTokenByUser(usr *model.User) (*model.Verification, error)

func (*Account) ResetPassword

func (a *Account) ResetPassword(usr *model.User) error

func (*Account) UpdateAvatar

func (a *Account) UpdateAvatar(usr *model.User) error

type User

type User struct {
	ViewFn               func(int) (*model.User, error)
	FindByReferralCodeFn func(string) (*model.ReferralCodeVerifyResponse, error)
	FindByUsernameFn     func(string) (*model.User, error)
	FindByEmailFn        func(string) (*model.User, error)
	FindByMobileFn       func(string, string) (*model.User, error)
	FindByTokenFn        func(string) (*model.User, error)
	UpdateLoginFn        func(*model.User) error
	ListFn               func(*model.ListQuery, *model.Pagination) ([]model.User, error)
	DeleteFn             func(*model.User) error
	UpdateFn             func(*model.User) (*model.User, error)
}

User database mock

func (*User) Delete

func (u *User) Delete(usr *model.User) error

Delete mock

func (*User) FindByEmail

func (u *User) FindByEmail(email string) (*model.User, error)

FindByEmail mock

func (*User) FindByMobile

func (u *User) FindByMobile(countryCode, mobile string) (*model.User, error)

FindByMobile mock

func (*User) FindByReferralCode

func (u *User) FindByReferralCode(username string) (*model.ReferralCodeVerifyResponse, error)

FindByReferralCode mock

func (*User) FindByToken

func (u *User) FindByToken(token string) (*model.User, error)

FindByToken mock

func (*User) FindByUsername

func (u *User) FindByUsername(username string) (*model.User, error)

FindByUsername mock

func (*User) List

func (u *User) List(lq *model.ListQuery, p *model.Pagination) ([]model.User, error)

List mock

func (*User) Update

func (u *User) Update(usr *model.User) (*model.User, error)

Update mock

func (*User) UpdateLogin

func (u *User) UpdateLogin(usr *model.User) error

UpdateLogin mock

func (*User) View

func (u *User) View(id int) (*model.User, error)

View mock

Jump to

Keyboard shortcuts

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