mock

package
v0.0.0-...-d8b21ba Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 8 Imported by: 0

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