Documentation
¶
Overview ¶
Package db is a generated GoMock package.
Index ¶
- Constants
- Variables
- func DefaultActivityOptions() workflow.ActivityOptions
- type DB
- type IndicatorsSuite
- type MockDB
- func (m *MockDB) EXPECT() *MockDBMockRecorder
- func (m *MockDB) ReadSMAActivity(ctx context.Context, params ReadSMAActivityParams) (ReadSMAActivityResults, error)
- func (m *MockDB) Register(w worker.Worker)
- func (m *MockDB) UpsertSMAActivity(ctx context.Context, params UpsertSMAActivityParams) (UpsertSMAActivityResults, error)
- type MockDBMockRecorder
- type ReadSMAActivityParams
- type ReadSMAActivityResults
- type UpsertSMAActivityParams
- type UpsertSMAActivityResults
Constants ¶
const ReadSMAActivityName = "ReadSMAActivity"
ReadSMAActivityName is the name of the GetSMA activity.
const UpsertSMAActivityName = "UpsertSMAActivity"
UpsertSMAActivityName is the name of the UpsertSMA activity.
Variables ¶
var ( // ErrNilID is returned when the ID is nil. ErrNilID = fmt.Errorf("ID is nil") // ErrNoDocument is returned when no document is found. ErrNoDocument = fmt.Errorf("no document found") )
Functions ¶
func DefaultActivityOptions ¶
func DefaultActivityOptions() workflow.ActivityOptions
DefaultActivityOptions returns the default database activities options.
Types ¶
type DB ¶
type DB interface {
Register(w worker.Worker)
ReadSMAActivity(
ctx context.Context,
params ReadSMAActivityParams,
) (ReadSMAActivityResults, error)
UpsertSMAActivity(
ctx context.Context,
params UpsertSMAActivityParams,
) (UpsertSMAActivityResults, error)
}
DB is the interface for the database activities.
type IndicatorsSuite ¶
IndicatorsSuite is the test suite for the indicators database.
func (*IndicatorsSuite) TestGetSMAActivity ¶
func (suite *IndicatorsSuite) TestGetSMAActivity()
TestGetSMAActivity tests the GetSMAActivity activity. TODO(#1): Refactor this function to make it shorter.
func (*IndicatorsSuite) TestUpsertSMAActivity ¶
func (suite *IndicatorsSuite) TestUpsertSMAActivity()
TestUpsertSMAActivity tests the UpsertSMAActivity activity. TODO(#2): Refactor this function to make it shorter.
type MockDB ¶
type MockDB struct {
// contains filtered or unexported fields
}
MockDB is a mock of DB interface.
func NewMockDB ¶
func NewMockDB(ctrl *gomock.Controller) *MockDB
NewMockDB creates a new mock instance.
func (*MockDB) EXPECT ¶
func (m *MockDB) EXPECT() *MockDBMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDB) ReadSMAActivity ¶
func (m *MockDB) ReadSMAActivity(ctx context.Context, params ReadSMAActivityParams) (ReadSMAActivityResults, error)
ReadSMAActivity mocks base method.
func (*MockDB) UpsertSMAActivity ¶
func (m *MockDB) UpsertSMAActivity(ctx context.Context, params UpsertSMAActivityParams) (UpsertSMAActivityResults, error)
UpsertSMAActivity mocks base method.
type MockDBMockRecorder ¶
type MockDBMockRecorder struct {
// contains filtered or unexported fields
}
MockDBMockRecorder is the mock recorder for MockDB.
func (*MockDBMockRecorder) ReadSMAActivity ¶
func (mr *MockDBMockRecorder) ReadSMAActivity(ctx, params interface{}) *gomock.Call
ReadSMAActivity indicates an expected call of ReadSMAActivity.
func (*MockDBMockRecorder) Register ¶
func (mr *MockDBMockRecorder) Register(w interface{}) *gomock.Call
Register indicates an expected call of Register.
func (*MockDBMockRecorder) UpsertSMAActivity ¶
func (mr *MockDBMockRecorder) UpsertSMAActivity(ctx, params interface{}) *gomock.Call
UpsertSMAActivity indicates an expected call of UpsertSMAActivity.
type ReadSMAActivityParams ¶
type ReadSMAActivityParams struct {
Exchange string
Pair string
Period period.Symbol
PeriodNumber int
PriceType candlestick.PriceType
Start time.Time
End time.Time
}
ReadSMAActivityParams is the parameters for the GetSMA activity.
type ReadSMAActivityResults ¶
ReadSMAActivityResults is the result for the GetSMA activity.
type UpsertSMAActivityParams ¶
type UpsertSMAActivityParams struct {
Exchange string
Pair string
Period period.Symbol
PeriodNumber int
PriceType candlestick.PriceType
TimeSerie *timeserie.TimeSerie[float64]
}
UpsertSMAActivityParams is the parameters for the UpsertSMA activity.
type UpsertSMAActivityResults ¶
type UpsertSMAActivityResults struct{}
UpsertSMAActivityResults is the result for the UpsertSMA activity.