usermock

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a user cannot be found
	ErrNotFound = errors.New("user not found")
	// ErrNoValue is returned when no value is available
	ErrNoValue = errors.New("no value returned")
)

Functions

This section is empty.

Types

type UserStore

type UserStore struct {
	mock.Mock
	// contains filtered or unexported fields
}

UserStore is a mock implementation of user.Store interface

func NewUserStore

func NewUserStore() *UserStore

NewUserStore creates a new mock user store

func (*UserStore) Create

func (m *UserStore) Create(ctx context.Context, u *user.User) error

Create implements Store.Create

func (*UserStore) Delete

func (m *UserStore) Delete(ctx context.Context, id uint) error

Delete implements Store.Delete

func (*UserStore) GetByEmail

func (m *UserStore) GetByEmail(ctx context.Context, email string) (*user.User, error)

GetByEmail implements Store.GetByEmail

func (*UserStore) GetByID

func (m *UserStore) GetByID(ctx context.Context, id uint) (*user.User, error)

GetByID implements Store.GetByID

func (*UserStore) List

func (m *UserStore) List(ctx context.Context) ([]user.User, error)

List implements Store.List

func (*UserStore) SetError

func (m *UserStore) SetError(op string, err error)

SetError sets the error to be returned by the specified operation

func (*UserStore) Update

func (m *UserStore) Update(ctx context.Context, u *user.User) error

Update implements Store.Update

Jump to

Keyboard shortcuts

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