mock

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Anything = mock.Anything
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryService

type CategoryService struct {
	mock.Mock
}

func (*CategoryService) Add

func (m *CategoryService) Add(ctx context.Context, category *api.Category) error

func (*CategoryService) All

func (m *CategoryService) All(ctx context.Context) ([]api.Category, error)

func (*CategoryService) Find

func (m *CategoryService) Find(ctx context.Context, id string) (*api.Category, error)

func (*CategoryService) Update

func (m *CategoryService) Update(ctx context.Context, category *api.Category) error

type Collection

type Collection struct {
	mock.Mock
}

func NewCollection

func NewCollection() *Collection

func (*Collection) Distinct

func (m *Collection) Distinct(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)

func (*Collection) Find

func (m *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (datastore.Cursor, error)

func (*Collection) FindOne

func (m *Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) datastore.Decodable

func (*Collection) FindOneAndUpdate

func (m *Collection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) datastore.Decodable

func (*Collection) InsertOne

func (m *Collection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

type Cursor

type Cursor struct {
	mock.Mock
}

func NewCursor

func NewCursor() *Cursor

func (*Cursor) Close

func (c *Cursor) Close(ctx context.Context) error

func (*Cursor) Decode

func (c *Cursor) Decode(data interface{}) error

func (*Cursor) Err

func (c *Cursor) Err() error

func (*Cursor) Next

func (c *Cursor) Next(ctx context.Context) bool

type Decodable

type Decodable struct {
	mock.Mock
}

func NewDecodable

func NewDecodable() *Decodable

func (*Decodable) Close

func (d *Decodable) Close(ctx context.Context) error

func (*Decodable) Decode

func (d *Decodable) Decode(data interface{}) error

func (*Decodable) Err

func (d *Decodable) Err() error

type Mock

type Mock = mock.Mock

type RecordService

type RecordService struct {
	mock.Mock
}

func NewRecordService

func NewRecordService() *RecordService

func (*RecordService) All

func (mock *RecordService) All(ctx context.Context) ([]api.Record, error)

func (*RecordService) Create

func (mock *RecordService) Create(ctx context.Context, data api.CreateRecord, images []storage.Image, pdfData io.Reader) (*api.Record, error)

func (*RecordService) Delete

func (mock *RecordService) Delete(ctx context.Context, id string) error

func (*RecordService) Find

func (mock *RecordService) Find(ctx context.Context, id string) (*api.Record, error)

func (*RecordService) Query

func (mock *RecordService) Query(ctx context.Context, query datastore.RecordQuery, options ...*datastore.QueryOptions) ([]api.Record, error)

func (*RecordService) Update

func (mock *RecordService) Update(ctx context.Context, id string, record api.Record, updateOptions ...datastore.UpdateOption) (*api.Record, error)

func (*RecordService) UpdatePages

func (mock *RecordService) UpdatePages(ctx context.Context, id string, updates []api.PageUpdate) (*api.Record, error)

Jump to

Keyboard shortcuts

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