mockdb

package
v0.0.0-...-82cb9bc Latest Latest
Warning

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

Go to latest
Published: Sep 20, 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 User

type User struct {
	CreateFn         func(orm.DB, rest.User) (*rest.User, error)
	ViewFn           func(orm.DB, int) (*rest.User, error)
	FindByUsernameFn func(orm.DB, string) (*rest.User, error)
	FindByTokenFn    func(orm.DB, string) (*rest.User, error)
	ListFn           func(orm.DB, *rest.ListQuery, *rest.Pagination) ([]rest.User, error)
	DeleteFn         func(orm.DB, *rest.User) error
	UpdateFn         func(orm.DB, *rest.User) error
}

User database mock

func (*User) Create

func (u *User) Create(db orm.DB, usr rest.User) (*rest.User, error)

Create mock

func (*User) Delete

func (u *User) Delete(db orm.DB, usr *rest.User) error

Delete mock

func (*User) FindByToken

func (u *User) FindByToken(db orm.DB, token string) (*rest.User, error)

FindByToken mock

func (*User) FindByUsername

func (u *User) FindByUsername(db orm.DB, uname string) (*rest.User, error)

FindByUsername mock

func (*User) List

func (u *User) List(db orm.DB, lq *rest.ListQuery, p *rest.Pagination) ([]rest.User, error)

List mock

func (*User) Update

func (u *User) Update(db orm.DB, usr *rest.User) error

Update mock

func (*User) View

func (u *User) View(db orm.DB, id int) (*rest.User, error)

View mock

Jump to

Keyboard shortcuts

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