mocks

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 4 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCartSource

type MockCartSource struct {
	mock.Mock
}

MockCartSource is an autogenerated mock type for the CartSource type

func NewMockCartSource

func NewMockCartSource(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCartSource

NewMockCartSource creates a new instance of MockCartSource. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockCartSource) Consume

func (_mock *MockCartSource) Consume(ctx context.Context, token string) error

Consume provides a mock function for the type MockCartSource

func (*MockCartSource) EXPECT

func (*MockCartSource) Snapshot

func (_mock *MockCartSource) Snapshot(ctx context.Context, token string) (orders.CartSnapshot, error)

Snapshot provides a mock function for the type MockCartSource

type MockCartSource_Consume_Call

type MockCartSource_Consume_Call struct {
	*mock.Call
}

MockCartSource_Consume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Consume'

func (*MockCartSource_Consume_Call) Return

func (*MockCartSource_Consume_Call) Run

func (*MockCartSource_Consume_Call) RunAndReturn

func (_c *MockCartSource_Consume_Call) RunAndReturn(run func(ctx context.Context, token string) error) *MockCartSource_Consume_Call

type MockCartSource_Expecter

type MockCartSource_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockCartSource_Expecter) Consume

Consume is a helper method to define mock.On call

  • ctx context.Context
  • token string

func (*MockCartSource_Expecter) Snapshot

func (_e *MockCartSource_Expecter) Snapshot(ctx any, token any) *MockCartSource_Snapshot_Call

Snapshot is a helper method to define mock.On call

  • ctx context.Context
  • token string

type MockCartSource_Snapshot_Call

type MockCartSource_Snapshot_Call struct {
	*mock.Call
}

MockCartSource_Snapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Snapshot'

func (*MockCartSource_Snapshot_Call) Return

func (_c *MockCartSource_Snapshot_Call) Return(cartSnapshot orders.CartSnapshot, err error) *MockCartSource_Snapshot_Call

func (*MockCartSource_Snapshot_Call) Run

func (*MockCartSource_Snapshot_Call) RunAndReturn

func (_c *MockCartSource_Snapshot_Call) RunAndReturn(run func(ctx context.Context, token string) (orders.CartSnapshot, error)) *MockCartSource_Snapshot_Call

type MockContentSource

type MockContentSource struct {
	mock.Mock
}

MockContentSource is an autogenerated mock type for the ContentSource type

func NewMockContentSource

func NewMockContentSource(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockContentSource

NewMockContentSource creates a new instance of MockContentSource. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockContentSource) EXPECT

func (*MockContentSource) ProductTitle

func (_mock *MockContentSource) ProductTitle(ctx context.Context, contentID int) (string, bool)

ProductTitle provides a mock function for the type MockContentSource

type MockContentSource_Expecter

type MockContentSource_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockContentSource_Expecter) ProductTitle

func (_e *MockContentSource_Expecter) ProductTitle(ctx any, contentID any) *MockContentSource_ProductTitle_Call

ProductTitle is a helper method to define mock.On call

  • ctx context.Context
  • contentID int

type MockContentSource_ProductTitle_Call

type MockContentSource_ProductTitle_Call struct {
	*mock.Call
}

MockContentSource_ProductTitle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProductTitle'

func (*MockContentSource_ProductTitle_Call) Return

func (*MockContentSource_ProductTitle_Call) Run

func (*MockContentSource_ProductTitle_Call) RunAndReturn

type MockInventory

type MockInventory struct {
	mock.Mock
}

MockInventory is an autogenerated mock type for the Inventory type

func NewMockInventory

func NewMockInventory(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockInventory

NewMockInventory creates a new instance of MockInventory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockInventory) EXPECT

func (_m *MockInventory) EXPECT() *MockInventory_Expecter

func (*MockInventory) Release

func (_mock *MockInventory) Release(ctx context.Context, items []orders.OrderItem) error

Release provides a mock function for the type MockInventory

func (*MockInventory) Reserve

func (_mock *MockInventory) Reserve(ctx context.Context, items []orders.OrderItem) error

Reserve provides a mock function for the type MockInventory

type MockInventory_Expecter

type MockInventory_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockInventory_Expecter) Release

func (_e *MockInventory_Expecter) Release(ctx any, items any) *MockInventory_Release_Call

Release is a helper method to define mock.On call

  • ctx context.Context
  • items []orders.OrderItem

func (*MockInventory_Expecter) Reserve

func (_e *MockInventory_Expecter) Reserve(ctx any, items any) *MockInventory_Reserve_Call

Reserve is a helper method to define mock.On call

  • ctx context.Context
  • items []orders.OrderItem

type MockInventory_Release_Call

type MockInventory_Release_Call struct {
	*mock.Call
}

MockInventory_Release_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Release'

func (*MockInventory_Release_Call) Return

func (*MockInventory_Release_Call) Run

func (_c *MockInventory_Release_Call) Run(run func(ctx context.Context, items []orders.OrderItem)) *MockInventory_Release_Call

func (*MockInventory_Release_Call) RunAndReturn

func (_c *MockInventory_Release_Call) RunAndReturn(run func(ctx context.Context, items []orders.OrderItem) error) *MockInventory_Release_Call

type MockInventory_Reserve_Call

type MockInventory_Reserve_Call struct {
	*mock.Call
}

MockInventory_Reserve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reserve'

func (*MockInventory_Reserve_Call) Return

func (*MockInventory_Reserve_Call) Run

func (_c *MockInventory_Reserve_Call) Run(run func(ctx context.Context, items []orders.OrderItem)) *MockInventory_Reserve_Call

func (*MockInventory_Reserve_Call) RunAndReturn

func (_c *MockInventory_Reserve_Call) RunAndReturn(run func(ctx context.Context, items []orders.OrderItem) error) *MockInventory_Reserve_Call

type MockInvoiceRenderer

type MockInvoiceRenderer struct {
	mock.Mock
}

MockInvoiceRenderer is an autogenerated mock type for the InvoiceRenderer type

func NewMockInvoiceRenderer

func NewMockInvoiceRenderer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockInvoiceRenderer

NewMockInvoiceRenderer creates a new instance of MockInvoiceRenderer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockInvoiceRenderer) EXPECT

func (*MockInvoiceRenderer) Render

func (_mock *MockInvoiceRenderer) Render(ctx context.Context, doc *orders.InvoiceDocument) ([]byte, error)

Render provides a mock function for the type MockInvoiceRenderer

type MockInvoiceRenderer_Expecter

type MockInvoiceRenderer_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockInvoiceRenderer_Expecter) Render

Render is a helper method to define mock.On call

  • ctx context.Context
  • doc *orders.InvoiceDocument

type MockInvoiceRenderer_Render_Call

type MockInvoiceRenderer_Render_Call struct {
	*mock.Call
}

MockInvoiceRenderer_Render_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Render'

func (*MockInvoiceRenderer_Render_Call) Return

func (*MockInvoiceRenderer_Render_Call) Run

func (_c *MockInvoiceRenderer_Render_Call) Run(run func(ctx context.Context, doc *orders.InvoiceDocument)) *MockInvoiceRenderer_Render_Call

func (*MockInvoiceRenderer_Render_Call) RunAndReturn

func (_c *MockInvoiceRenderer_Render_Call) RunAndReturn(run func(ctx context.Context, doc *orders.InvoiceDocument) ([]byte, error)) *MockInvoiceRenderer_Render_Call

type MockMailer

type MockMailer struct {
	mock.Mock
}

MockMailer is an autogenerated mock type for the Mailer type

func NewMockMailer

func NewMockMailer(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockMailer

NewMockMailer creates a new instance of MockMailer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockMailer) EXPECT

func (_m *MockMailer) EXPECT() *MockMailer_Expecter

func (*MockMailer) SendOrderConfirmationEmail

func (_mock *MockMailer) SendOrderConfirmationEmail(ctx context.Context, order *orders.Order) error

SendOrderConfirmationEmail provides a mock function for the type MockMailer

func (*MockMailer) SendOrderStatusEmail

func (_mock *MockMailer) SendOrderStatusEmail(ctx context.Context, order *orders.Order, from orders.Status) error

SendOrderStatusEmail provides a mock function for the type MockMailer

type MockMailer_Expecter

type MockMailer_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockMailer_Expecter) SendOrderConfirmationEmail

func (_e *MockMailer_Expecter) SendOrderConfirmationEmail(ctx any, order any) *MockMailer_SendOrderConfirmationEmail_Call

SendOrderConfirmationEmail is a helper method to define mock.On call

  • ctx context.Context
  • order *orders.Order

func (*MockMailer_Expecter) SendOrderStatusEmail

func (_e *MockMailer_Expecter) SendOrderStatusEmail(ctx any, order any, from any) *MockMailer_SendOrderStatusEmail_Call

SendOrderStatusEmail is a helper method to define mock.On call

  • ctx context.Context
  • order *orders.Order
  • from orders.Status

type MockMailer_SendOrderConfirmationEmail_Call

type MockMailer_SendOrderConfirmationEmail_Call struct {
	*mock.Call
}

MockMailer_SendOrderConfirmationEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendOrderConfirmationEmail'

func (*MockMailer_SendOrderConfirmationEmail_Call) Return

func (*MockMailer_SendOrderConfirmationEmail_Call) Run

func (*MockMailer_SendOrderConfirmationEmail_Call) RunAndReturn

type MockMailer_SendOrderStatusEmail_Call

type MockMailer_SendOrderStatusEmail_Call struct {
	*mock.Call
}

MockMailer_SendOrderStatusEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendOrderStatusEmail'

func (*MockMailer_SendOrderStatusEmail_Call) Return

func (*MockMailer_SendOrderStatusEmail_Call) Run

func (_c *MockMailer_SendOrderStatusEmail_Call) Run(run func(ctx context.Context, order *orders.Order, from orders.Status)) *MockMailer_SendOrderStatusEmail_Call

func (*MockMailer_SendOrderStatusEmail_Call) RunAndReturn

func (_c *MockMailer_SendOrderStatusEmail_Call) RunAndReturn(run func(ctx context.Context, order *orders.Order, from orders.Status) error) *MockMailer_SendOrderStatusEmail_Call

type MockOrderStore

type MockOrderStore struct {
	mock.Mock
}

MockOrderStore is an autogenerated mock type for the OrderStore type

func NewMockOrderStore

func NewMockOrderStore(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockOrderStore

NewMockOrderStore creates a new instance of MockOrderStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockOrderStore) CreateOrder

func (_mock *MockOrderStore) CreateOrder(ctx context.Context, order *orders.Order) (int64, error)

CreateOrder provides a mock function for the type MockOrderStore

func (*MockOrderStore) EXPECT

func (*MockOrderStore) ExpirePending

func (_mock *MockOrderStore) ExpirePending(ctx context.Context, before time.Time, limit int) ([]int64, error)

ExpirePending provides a mock function for the type MockOrderStore

func (*MockOrderStore) FindByID

func (_mock *MockOrderStore) FindByID(ctx context.Context, id int64) (*orders.Order, error)

FindByID provides a mock function for the type MockOrderStore

func (*MockOrderStore) FindByNumberAndEmailAndToken

func (_mock *MockOrderStore) FindByNumberAndEmailAndToken(ctx context.Context, id int64, email string, tokenHash string) (*orders.Order, error)

FindByNumberAndEmailAndToken provides a mock function for the type MockOrderStore

func (*MockOrderStore) List

func (_mock *MockOrderStore) List(ctx context.Context, status *orders.Status, beforeID int64, limit int) ([]orders.Order, error)

List provides a mock function for the type MockOrderStore

func (*MockOrderStore) MarkPaid

func (_mock *MockOrderStore) MarkPaid(ctx context.Context, id int64) (bool, error)

MarkPaid provides a mock function for the type MockOrderStore

func (*MockOrderStore) SetShipping

func (_mock *MockOrderStore) SetShipping(ctx context.Context, id int64, amount int64) (bool, error)

SetShipping provides a mock function for the type MockOrderStore

func (*MockOrderStore) SetStatus

func (_mock *MockOrderStore) SetStatus(ctx context.Context, id int64, status orders.Status) error

SetStatus provides a mock function for the type MockOrderStore

type MockOrderStore_CreateOrder_Call

type MockOrderStore_CreateOrder_Call struct {
	*mock.Call
}

MockOrderStore_CreateOrder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrder'

func (*MockOrderStore_CreateOrder_Call) Return

func (*MockOrderStore_CreateOrder_Call) Run

func (_c *MockOrderStore_CreateOrder_Call) Run(run func(ctx context.Context, order *orders.Order)) *MockOrderStore_CreateOrder_Call

func (*MockOrderStore_CreateOrder_Call) RunAndReturn

func (_c *MockOrderStore_CreateOrder_Call) RunAndReturn(run func(ctx context.Context, order *orders.Order) (int64, error)) *MockOrderStore_CreateOrder_Call

type MockOrderStore_Expecter

type MockOrderStore_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockOrderStore_Expecter) CreateOrder

func (_e *MockOrderStore_Expecter) CreateOrder(ctx any, order any) *MockOrderStore_CreateOrder_Call

CreateOrder is a helper method to define mock.On call

  • ctx context.Context
  • order *orders.Order

func (*MockOrderStore_Expecter) ExpirePending

func (_e *MockOrderStore_Expecter) ExpirePending(ctx any, before any, limit any) *MockOrderStore_ExpirePending_Call

ExpirePending is a helper method to define mock.On call

  • ctx context.Context
  • before time.Time
  • limit int

func (*MockOrderStore_Expecter) FindByID

FindByID is a helper method to define mock.On call

  • ctx context.Context
  • id int64

func (*MockOrderStore_Expecter) FindByNumberAndEmailAndToken

func (_e *MockOrderStore_Expecter) FindByNumberAndEmailAndToken(ctx any, id any, email any, tokenHash any) *MockOrderStore_FindByNumberAndEmailAndToken_Call

FindByNumberAndEmailAndToken is a helper method to define mock.On call

  • ctx context.Context
  • id int64
  • email string
  • tokenHash string

func (*MockOrderStore_Expecter) List

func (_e *MockOrderStore_Expecter) List(ctx any, status any, beforeID any, limit any) *MockOrderStore_List_Call

List is a helper method to define mock.On call

  • ctx context.Context
  • status *orders.Status
  • beforeID int64
  • limit int

func (*MockOrderStore_Expecter) MarkPaid

MarkPaid is a helper method to define mock.On call

  • ctx context.Context
  • id int64

func (*MockOrderStore_Expecter) SetShipping

func (_e *MockOrderStore_Expecter) SetShipping(ctx any, id any, amount any) *MockOrderStore_SetShipping_Call

SetShipping is a helper method to define mock.On call

  • ctx context.Context
  • id int64
  • amount int64

func (*MockOrderStore_Expecter) SetStatus

func (_e *MockOrderStore_Expecter) SetStatus(ctx any, id any, status any) *MockOrderStore_SetStatus_Call

SetStatus is a helper method to define mock.On call

  • ctx context.Context
  • id int64
  • status orders.Status

type MockOrderStore_ExpirePending_Call

type MockOrderStore_ExpirePending_Call struct {
	*mock.Call
}

MockOrderStore_ExpirePending_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpirePending'

func (*MockOrderStore_ExpirePending_Call) Return

func (*MockOrderStore_ExpirePending_Call) Run

func (*MockOrderStore_ExpirePending_Call) RunAndReturn

func (_c *MockOrderStore_ExpirePending_Call) RunAndReturn(run func(ctx context.Context, before time.Time, limit int) ([]int64, error)) *MockOrderStore_ExpirePending_Call

type MockOrderStore_FindByID_Call

type MockOrderStore_FindByID_Call struct {
	*mock.Call
}

MockOrderStore_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID'

func (*MockOrderStore_FindByID_Call) Return

func (_c *MockOrderStore_FindByID_Call) Return(order *orders.Order, err error) *MockOrderStore_FindByID_Call

func (*MockOrderStore_FindByID_Call) Run

func (*MockOrderStore_FindByID_Call) RunAndReturn

func (_c *MockOrderStore_FindByID_Call) RunAndReturn(run func(ctx context.Context, id int64) (*orders.Order, error)) *MockOrderStore_FindByID_Call

type MockOrderStore_FindByNumberAndEmailAndToken_Call

type MockOrderStore_FindByNumberAndEmailAndToken_Call struct {
	*mock.Call
}

MockOrderStore_FindByNumberAndEmailAndToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByNumberAndEmailAndToken'

func (*MockOrderStore_FindByNumberAndEmailAndToken_Call) Return

func (*MockOrderStore_FindByNumberAndEmailAndToken_Call) Run

func (*MockOrderStore_FindByNumberAndEmailAndToken_Call) RunAndReturn

func (_c *MockOrderStore_FindByNumberAndEmailAndToken_Call) RunAndReturn(run func(ctx context.Context, id int64, email string, tokenHash string) (*orders.Order, error)) *MockOrderStore_FindByNumberAndEmailAndToken_Call

type MockOrderStore_List_Call

type MockOrderStore_List_Call struct {
	*mock.Call
}

MockOrderStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'

func (*MockOrderStore_List_Call) Return

func (_c *MockOrderStore_List_Call) Return(orders1 []orders.Order, err error) *MockOrderStore_List_Call

func (*MockOrderStore_List_Call) Run

func (_c *MockOrderStore_List_Call) Run(run func(ctx context.Context, status *orders.Status, beforeID int64, limit int)) *MockOrderStore_List_Call

func (*MockOrderStore_List_Call) RunAndReturn

func (_c *MockOrderStore_List_Call) RunAndReturn(run func(ctx context.Context, status *orders.Status, beforeID int64, limit int) ([]orders.Order, error)) *MockOrderStore_List_Call

type MockOrderStore_MarkPaid_Call

type MockOrderStore_MarkPaid_Call struct {
	*mock.Call
}

MockOrderStore_MarkPaid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkPaid'

func (*MockOrderStore_MarkPaid_Call) Return

func (*MockOrderStore_MarkPaid_Call) Run

func (*MockOrderStore_MarkPaid_Call) RunAndReturn

type MockOrderStore_SetShipping_Call

type MockOrderStore_SetShipping_Call struct {
	*mock.Call
}

MockOrderStore_SetShipping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetShipping'

func (*MockOrderStore_SetShipping_Call) Return

func (*MockOrderStore_SetShipping_Call) Run

func (*MockOrderStore_SetShipping_Call) RunAndReturn

func (_c *MockOrderStore_SetShipping_Call) RunAndReturn(run func(ctx context.Context, id int64, amount int64) (bool, error)) *MockOrderStore_SetShipping_Call

type MockOrderStore_SetStatus_Call

type MockOrderStore_SetStatus_Call struct {
	*mock.Call
}

MockOrderStore_SetStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStatus'

func (*MockOrderStore_SetStatus_Call) Return

func (*MockOrderStore_SetStatus_Call) Run

func (_c *MockOrderStore_SetStatus_Call) Run(run func(ctx context.Context, id int64, status orders.Status)) *MockOrderStore_SetStatus_Call

func (*MockOrderStore_SetStatus_Call) RunAndReturn

func (_c *MockOrderStore_SetStatus_Call) RunAndReturn(run func(ctx context.Context, id int64, status orders.Status) error) *MockOrderStore_SetStatus_Call

Jump to

Keyboard shortcuts

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