Documentation ¶
Overview ¶
package positionsrepo is a generated GoMock package.
Index ¶
- type MockPositionsRepository
- func (m *MockPositionsRepository) CloseAll(accountID int64, closed time.Time, commission, swap, profit float64) error
- func (m *MockPositionsRepository) CloseIfNotIn(accountID int64, tickets []int64, closed, maxDate time.Time) error
- func (m *MockPositionsRepository) CloseOne(accountID, ticket int64, closed time.Time, commission, swap, profit float64) error
- func (m *MockPositionsRepository) ConfirmByExternalID(destinationAccountID, externalID int64, beatTime time.Time) error
- func (m *MockPositionsRepository) EXPECT() *MockPositionsRepositoryMockRecorder
- func (m *MockPositionsRepository) GetActivePositions(accountID int64) ([]*position.Position, error)
- func (m *MockPositionsRepository) GetByID(accountID, ticket int64) (*position.Position, error)
- func (m *MockPositionsRepository) GetTickerBeats(sourceAccountID, destinationAccountID int64, from time.Time) ([]*position.Position, error)
- func (m *MockPositionsRepository) Insert(ac *position.Position) (int64, error)
- func (m *MockPositionsRepository) Update(ac *position.Position) error
- type MockPositionsRepositoryMockRecorder
- func (mr *MockPositionsRepositoryMockRecorder) CloseAll(accountID, closed, commission, swap, profit interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) CloseIfNotIn(accountID, tickets, closed, maxDate interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) CloseOne(accountID, ticket, closed, commission, swap, profit interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) ConfirmByExternalID(destinationAccountID, externalID, beatTime interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) GetActivePositions(accountID interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) GetByID(accountID, ticket interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) GetTickerBeats(sourceAccountID, destinationAccountID, from interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) Insert(ac interface{}) *gomock.Call
- func (mr *MockPositionsRepositoryMockRecorder) Update(ac interface{}) *gomock.Call
- type PositionsRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPositionsRepository ¶ added in v0.17.0
type MockPositionsRepository struct {
// contains filtered or unexported fields
}
MockPositionsRepository is a mock of PositionsRepository interface.
func NewMockPositionsRepository ¶ added in v0.17.0
func NewMockPositionsRepository(ctrl *gomock.Controller) *MockPositionsRepository
NewMockPositionsRepository creates a new mock instance.
func (*MockPositionsRepository) CloseAll ¶ added in v0.17.0
func (m *MockPositionsRepository) CloseAll(accountID int64, closed time.Time, commission, swap, profit float64) error
CloseAll mocks base method.
func (*MockPositionsRepository) CloseIfNotIn ¶ added in v0.17.0
func (m *MockPositionsRepository) CloseIfNotIn(accountID int64, tickets []int64, closed, maxDate time.Time) error
CloseIfNotIn mocks base method.
func (*MockPositionsRepository) CloseOne ¶ added in v0.17.0
func (m *MockPositionsRepository) CloseOne(accountID, ticket int64, closed time.Time, commission, swap, profit float64) error
CloseOne mocks base method.
func (*MockPositionsRepository) ConfirmByExternalID ¶ added in v0.17.0
func (m *MockPositionsRepository) ConfirmByExternalID(destinationAccountID, externalID int64, beatTime time.Time) error
ConfirmByExternalID mocks base method.
func (*MockPositionsRepository) EXPECT ¶ added in v0.17.0
func (m *MockPositionsRepository) EXPECT() *MockPositionsRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPositionsRepository) GetActivePositions ¶ added in v0.17.0
func (m *MockPositionsRepository) GetActivePositions(accountID int64) ([]*position.Position, error)
GetActivePositions mocks base method.
func (*MockPositionsRepository) GetByID ¶ added in v0.17.0
func (m *MockPositionsRepository) GetByID(accountID, ticket int64) (*position.Position, error)
GetByID mocks base method.
func (*MockPositionsRepository) GetTickerBeats ¶ added in v0.17.0
func (m *MockPositionsRepository) GetTickerBeats(sourceAccountID, destinationAccountID int64, from time.Time) ([]*position.Position, error)
GetTickerBeats mocks base method.
type MockPositionsRepositoryMockRecorder ¶ added in v0.17.0
type MockPositionsRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockPositionsRepositoryMockRecorder is the mock recorder for MockPositionsRepository.
func (*MockPositionsRepositoryMockRecorder) CloseAll ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) CloseAll(accountID, closed, commission, swap, profit interface{}) *gomock.Call
CloseAll indicates an expected call of CloseAll.
func (*MockPositionsRepositoryMockRecorder) CloseIfNotIn ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) CloseIfNotIn(accountID, tickets, closed, maxDate interface{}) *gomock.Call
CloseIfNotIn indicates an expected call of CloseIfNotIn.
func (*MockPositionsRepositoryMockRecorder) CloseOne ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) CloseOne(accountID, ticket, closed, commission, swap, profit interface{}) *gomock.Call
CloseOne indicates an expected call of CloseOne.
func (*MockPositionsRepositoryMockRecorder) ConfirmByExternalID ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) ConfirmByExternalID(destinationAccountID, externalID, beatTime interface{}) *gomock.Call
ConfirmByExternalID indicates an expected call of ConfirmByExternalID.
func (*MockPositionsRepositoryMockRecorder) GetActivePositions ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) GetActivePositions(accountID interface{}) *gomock.Call
GetActivePositions indicates an expected call of GetActivePositions.
func (*MockPositionsRepositoryMockRecorder) GetByID ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) GetByID(accountID, ticket interface{}) *gomock.Call
GetByID indicates an expected call of GetByID.
func (*MockPositionsRepositoryMockRecorder) GetTickerBeats ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) GetTickerBeats(sourceAccountID, destinationAccountID, from interface{}) *gomock.Call
GetTickerBeats indicates an expected call of GetTickerBeats.
func (*MockPositionsRepositoryMockRecorder) Insert ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) Insert(ac interface{}) *gomock.Call
Insert indicates an expected call of Insert.
func (*MockPositionsRepositoryMockRecorder) Update ¶ added in v0.17.0
func (mr *MockPositionsRepositoryMockRecorder) Update(ac interface{}) *gomock.Call
Update indicates an expected call of Update.
type PositionsRepository ¶
type PositionsRepository interface { Insert(ac *model.Position) (int64, error) GetByID(accountID, ticket int64) (*model.Position, error) Update(ac *model.Position) error CloseIfNotIn(accountID int64, tickets []int64, closed, maxDate time.Time) error CloseOne(accountID, ticket int64, closed time.Time, commission, swap, profit float64) error CloseAll(accountID int64, closed time.Time, commission, swap, profit float64) error GetTickerBeats(sourceAccountID, destinationAccountID int64, from time.Time) ([]*model.Position, error) ConfirmByExternalID(destinationAccountID, externalID int64, beatTime time.Time) error GetActivePositions(accountID int64) ([]*model.Position, error) }
PositionsRepository is a CRUD to the database
func NewPositionsRepo ¶
func NewPositionsRepo(ctx context.Context, dbCon *sqlx.DB) PositionsRepository
NewPositionsRepo creates a service to interact with PostgreSQL