db

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package db is a generated GoMock package.

Index

Constants

View Source
const ReadSMAActivityName = "ReadSMAActivity"

ReadSMAActivityName is the name of the GetSMA activity.

View Source
const UpsertSMAActivityName = "UpsertSMAActivity"

UpsertSMAActivityName is the name of the UpsertSMA activity.

Variables

View Source
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

type IndicatorsSuite struct {
	suite.Suite
	DB DB
}

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) Register

func (m *MockDB) Register(w worker.Worker)

Register 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

type ReadSMAActivityResults struct {
	Data *timeserie.TimeSerie[float64]
}

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.

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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