positionssvc

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

package positionssvc is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPositionsService added in v0.17.0

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

MockPositionsService is a mock of PositionsService interface.

func NewMockPositionsService added in v0.17.0

func NewMockPositionsService(ctrl *gomock.Controller) *MockPositionsService

NewMockPositionsService creates a new mock instance.

func (*MockPositionsService) CloseAll added in v0.17.0

func (m *MockPositionsService) CloseAll(accountID int64, closed time.Time, commission, swap, profit float64) error

CloseAll mocks base method.

func (*MockPositionsService) CloseIfNotIn added in v0.17.0

func (m *MockPositionsService) CloseIfNotIn(accountID int64, tickets []int64, closed, maxDate time.Time) error

CloseIfNotIn mocks base method.

func (*MockPositionsService) CloseOne added in v0.17.0

func (m *MockPositionsService) CloseOne(accountID, ticket int64, closed time.Time, commission, swap, profit float64) error

CloseOne mocks base method.

func (*MockPositionsService) ConfirmByExternalID added in v0.17.0

func (m *MockPositionsService) ConfirmByExternalID(destinationAccountID, externalID int64, beatTime time.Time) error

ConfirmByExternalID mocks base method.

func (*MockPositionsService) EXPECT added in v0.17.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPositionsService) GetActivePositions added in v0.17.0

func (m *MockPositionsService) GetActivePositions(accountID int64) ([]*position.Position, error)

GetActivePositions mocks base method.

func (*MockPositionsService) GetByID added in v0.17.0

func (m *MockPositionsService) GetByID(accountID, ticket int64) (*position.Position, error)

GetByID mocks base method.

func (*MockPositionsService) GetTickerBeats added in v0.17.0

func (m *MockPositionsService) GetTickerBeats(sourceAccountID, destinationAccountID int64, from time.Time) ([]*position.Position, error)

GetTickerBeats mocks base method.

func (*MockPositionsService) Insert added in v0.17.0

func (m *MockPositionsService) Insert(ac *position.Position) (int64, error)

Insert mocks base method.

func (*MockPositionsService) InsertMulti added in v0.17.0

func (m *MockPositionsService) InsertMulti(accountId int64, ac []*position.Position) (bool, error)

InsertMulti mocks base method.

func (*MockPositionsService) Update added in v0.17.0

Update mocks base method.

type MockPositionsServiceMockRecorder added in v0.17.0

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

MockPositionsServiceMockRecorder is the mock recorder for MockPositionsService.

func (*MockPositionsServiceMockRecorder) CloseAll added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) CloseAll(accountID, closed, commission, swap, profit interface{}) *gomock.Call

CloseAll indicates an expected call of CloseAll.

func (*MockPositionsServiceMockRecorder) CloseIfNotIn added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) CloseIfNotIn(accountID, tickets, closed, maxDate interface{}) *gomock.Call

CloseIfNotIn indicates an expected call of CloseIfNotIn.

func (*MockPositionsServiceMockRecorder) CloseOne added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) CloseOne(accountID, ticket, closed, commission, swap, profit interface{}) *gomock.Call

CloseOne indicates an expected call of CloseOne.

func (*MockPositionsServiceMockRecorder) ConfirmByExternalID added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) ConfirmByExternalID(destinationAccountID, externalID, beatTime interface{}) *gomock.Call

ConfirmByExternalID indicates an expected call of ConfirmByExternalID.

func (*MockPositionsServiceMockRecorder) GetActivePositions added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) GetActivePositions(accountID interface{}) *gomock.Call

GetActivePositions indicates an expected call of GetActivePositions.

func (*MockPositionsServiceMockRecorder) GetByID added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) GetByID(accountID, ticket interface{}) *gomock.Call

GetByID indicates an expected call of GetByID.

func (*MockPositionsServiceMockRecorder) GetTickerBeats added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) GetTickerBeats(sourceAccountID, destinationAccountID, from interface{}) *gomock.Call

GetTickerBeats indicates an expected call of GetTickerBeats.

func (*MockPositionsServiceMockRecorder) Insert added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) Insert(ac interface{}) *gomock.Call

Insert indicates an expected call of Insert.

func (*MockPositionsServiceMockRecorder) InsertMulti added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) InsertMulti(accountId, ac interface{}) *gomock.Call

InsertMulti indicates an expected call of InsertMulti.

func (*MockPositionsServiceMockRecorder) Update added in v0.17.0

func (mr *MockPositionsServiceMockRecorder) Update(ac interface{}) *gomock.Call

Update indicates an expected call of Update.

type PositionsService

type PositionsService interface {
	Insert(ac *model.Position) (int64, error)
	InsertMulti(accountId int64, ac []*model.Position) (bool, 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)
}

PositionsService is a CRUD to the database

func NewPositionsService

func NewPositionsService(ctx context.Context, repo repo.PositionsRepository, beats bb.TickerBeatsService) PositionsService

NewPositionsService creates a service to interact with PostgreSQL

Jump to

Keyboard shortcuts

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