mockdb

package
v0.0.0-...-2fc7590 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 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 Account

type Account struct {
	CreateFn         func(context.Context, *model.User) error
	ChangePasswordFn func(context.Context, *model.User) error
}

Account database mock

func (*Account) ChangePassword

func (a *Account) ChangePassword(c context.Context, usr *model.User) error

ChangePassword mock

func (*Account) Create

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

Create mock

type User

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

User database mock

func (*User) Delete

func (u *User) Delete(c context.Context, usr *model.User) error

Delete mock

func (*User) FindByToken

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

FindByToken mock

func (*User) FindByUsername

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

FindByUsername mock

func (*User) List

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

List mock

func (*User) Update

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

Update mock

func (*User) UpdateLogin

func (u *User) UpdateLogin(c context.Context, usr *model.User) error

UpdateLogin mock

func (*User) View

func (u *User) View(c context.Context, 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