mock

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockBroker

type MockBroker struct {
	mock.Mock
}

MockBroker is an autogenerated mock type for the Broker type

func NewMockBroker

func NewMockBroker(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockBroker

NewMockBroker creates a new instance of MockBroker. 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 (*MockBroker) Authenticate

func (_mock *MockBroker) Authenticate(ctx context.Context, creds broker.Credentials) (*broker.Token, error)

Authenticate provides a mock function for the type MockBroker

func (*MockBroker) CancelOrder

func (_mock *MockBroker) CancelOrder(ctx context.Context, orderID string) error

CancelOrder provides a mock function for the type MockBroker

func (*MockBroker) EXPECT

func (_m *MockBroker) EXPECT() *MockBroker_Expecter

func (*MockBroker) GetBalance

func (_mock *MockBroker) GetBalance(ctx context.Context, accountID string) (*broker.Balance, error)

GetBalance provides a mock function for the type MockBroker

func (*MockBroker) GetOHLCV

func (_mock *MockBroker) GetOHLCV(ctx context.Context, market string, symbol string, opts broker.OHLCVOpts) ([]broker.OHLCV, error)

GetOHLCV provides a mock function for the type MockBroker

func (*MockBroker) GetPositions

func (_mock *MockBroker) GetPositions(ctx context.Context, accountID string) ([]broker.Position, error)

GetPositions provides a mock function for the type MockBroker

func (*MockBroker) GetQuote

func (_mock *MockBroker) GetQuote(ctx context.Context, market string, symbol string) (*broker.Quote, error)

GetQuote provides a mock function for the type MockBroker

func (*MockBroker) ModifyOrder

func (_mock *MockBroker) ModifyOrder(ctx context.Context, orderID string, req broker.ModifyOrderRequest) (*broker.OrderResult, error)

ModifyOrder provides a mock function for the type MockBroker

func (*MockBroker) Name

func (_mock *MockBroker) Name() string

Name provides a mock function for the type MockBroker

func (*MockBroker) PlaceOrder

func (_mock *MockBroker) PlaceOrder(ctx context.Context, req broker.OrderRequest) (*broker.OrderResult, error)

PlaceOrder provides a mock function for the type MockBroker

type MockBroker_Authenticate_Call

type MockBroker_Authenticate_Call struct {
	*mock.Call
}

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

func (*MockBroker_Authenticate_Call) Return

func (*MockBroker_Authenticate_Call) Run

func (*MockBroker_Authenticate_Call) RunAndReturn

type MockBroker_CancelOrder_Call

type MockBroker_CancelOrder_Call struct {
	*mock.Call
}

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

func (*MockBroker_CancelOrder_Call) Return

func (*MockBroker_CancelOrder_Call) Run

func (*MockBroker_CancelOrder_Call) RunAndReturn

func (_c *MockBroker_CancelOrder_Call) RunAndReturn(run func(ctx context.Context, orderID string) error) *MockBroker_CancelOrder_Call

type MockBroker_Expecter

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

func (*MockBroker_Expecter) Authenticate

func (_e *MockBroker_Expecter) Authenticate(ctx interface{}, creds interface{}) *MockBroker_Authenticate_Call

Authenticate is a helper method to define mock.On call

  • ctx context.Context
  • creds broker.Credentials

func (*MockBroker_Expecter) CancelOrder

func (_e *MockBroker_Expecter) CancelOrder(ctx interface{}, orderID interface{}) *MockBroker_CancelOrder_Call

CancelOrder is a helper method to define mock.On call

  • ctx context.Context
  • orderID string

func (*MockBroker_Expecter) GetBalance

func (_e *MockBroker_Expecter) GetBalance(ctx interface{}, accountID interface{}) *MockBroker_GetBalance_Call

GetBalance is a helper method to define mock.On call

  • ctx context.Context
  • accountID string

func (*MockBroker_Expecter) GetOHLCV

func (_e *MockBroker_Expecter) GetOHLCV(ctx interface{}, market interface{}, symbol interface{}, opts interface{}) *MockBroker_GetOHLCV_Call

GetOHLCV is a helper method to define mock.On call

  • ctx context.Context
  • market string
  • symbol string
  • opts broker.OHLCVOpts

func (*MockBroker_Expecter) GetPositions

func (_e *MockBroker_Expecter) GetPositions(ctx interface{}, accountID interface{}) *MockBroker_GetPositions_Call

GetPositions is a helper method to define mock.On call

  • ctx context.Context
  • accountID string

func (*MockBroker_Expecter) GetQuote

func (_e *MockBroker_Expecter) GetQuote(ctx interface{}, market interface{}, symbol interface{}) *MockBroker_GetQuote_Call

GetQuote is a helper method to define mock.On call

  • ctx context.Context
  • market string
  • symbol string

func (*MockBroker_Expecter) ModifyOrder

func (_e *MockBroker_Expecter) ModifyOrder(ctx interface{}, orderID interface{}, req interface{}) *MockBroker_ModifyOrder_Call

ModifyOrder is a helper method to define mock.On call

  • ctx context.Context
  • orderID string
  • req broker.ModifyOrderRequest

func (*MockBroker_Expecter) Name

Name is a helper method to define mock.On call

func (*MockBroker_Expecter) PlaceOrder

func (_e *MockBroker_Expecter) PlaceOrder(ctx interface{}, req interface{}) *MockBroker_PlaceOrder_Call

PlaceOrder is a helper method to define mock.On call

  • ctx context.Context
  • req broker.OrderRequest

type MockBroker_GetBalance_Call

type MockBroker_GetBalance_Call struct {
	*mock.Call
}

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

func (*MockBroker_GetBalance_Call) Return

func (*MockBroker_GetBalance_Call) Run

func (_c *MockBroker_GetBalance_Call) Run(run func(ctx context.Context, accountID string)) *MockBroker_GetBalance_Call

func (*MockBroker_GetBalance_Call) RunAndReturn

func (_c *MockBroker_GetBalance_Call) RunAndReturn(run func(ctx context.Context, accountID string) (*broker.Balance, error)) *MockBroker_GetBalance_Call

type MockBroker_GetOHLCV_Call

type MockBroker_GetOHLCV_Call struct {
	*mock.Call
}

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

func (*MockBroker_GetOHLCV_Call) Return

func (*MockBroker_GetOHLCV_Call) Run

func (_c *MockBroker_GetOHLCV_Call) Run(run func(ctx context.Context, market string, symbol string, opts broker.OHLCVOpts)) *MockBroker_GetOHLCV_Call

func (*MockBroker_GetOHLCV_Call) RunAndReturn

func (_c *MockBroker_GetOHLCV_Call) RunAndReturn(run func(ctx context.Context, market string, symbol string, opts broker.OHLCVOpts) ([]broker.OHLCV, error)) *MockBroker_GetOHLCV_Call

type MockBroker_GetPositions_Call

type MockBroker_GetPositions_Call struct {
	*mock.Call
}

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

func (*MockBroker_GetPositions_Call) Return

func (*MockBroker_GetPositions_Call) Run

func (*MockBroker_GetPositions_Call) RunAndReturn

func (_c *MockBroker_GetPositions_Call) RunAndReturn(run func(ctx context.Context, accountID string) ([]broker.Position, error)) *MockBroker_GetPositions_Call

type MockBroker_GetQuote_Call

type MockBroker_GetQuote_Call struct {
	*mock.Call
}

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

func (*MockBroker_GetQuote_Call) Return

func (*MockBroker_GetQuote_Call) Run

func (_c *MockBroker_GetQuote_Call) Run(run func(ctx context.Context, market string, symbol string)) *MockBroker_GetQuote_Call

func (*MockBroker_GetQuote_Call) RunAndReturn

func (_c *MockBroker_GetQuote_Call) RunAndReturn(run func(ctx context.Context, market string, symbol string) (*broker.Quote, error)) *MockBroker_GetQuote_Call

type MockBroker_ModifyOrder_Call

type MockBroker_ModifyOrder_Call struct {
	*mock.Call
}

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

func (*MockBroker_ModifyOrder_Call) Return

func (*MockBroker_ModifyOrder_Call) Run

func (*MockBroker_ModifyOrder_Call) RunAndReturn

type MockBroker_Name_Call

type MockBroker_Name_Call struct {
	*mock.Call
}

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

func (*MockBroker_Name_Call) Return

func (*MockBroker_Name_Call) Run

func (_c *MockBroker_Name_Call) Run(run func()) *MockBroker_Name_Call

func (*MockBroker_Name_Call) RunAndReturn

func (_c *MockBroker_Name_Call) RunAndReturn(run func() string) *MockBroker_Name_Call

type MockBroker_PlaceOrder_Call

type MockBroker_PlaceOrder_Call struct {
	*mock.Call
}

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

func (*MockBroker_PlaceOrder_Call) Return

func (*MockBroker_PlaceOrder_Call) Run

func (*MockBroker_PlaceOrder_Call) RunAndReturn

Jump to

Keyboard shortcuts

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