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: 11 Imported by: 0

Documentation

Overview

Package db is a generated GoMock package.

Index

Constants

View Source
const CreateCandlesticksActivityName = "CreateCandlesticksActivity"

CreateCandlesticksActivityName is the name of the CreateCandlesticks activity.

View Source
const DeleteCandlesticksActivityName = "DeleteCandlesticksActivity"

DeleteCandlesticksActivityName is the name of the DeleteCandlesticks activity.

View Source
const ReadCandlesticksActivityName = "ReadCandlesticksActivity"

ReadCandlesticksActivityName is the name of the ReadCandlesticks activity.

View Source
const UpdateCandlesticksActivityName = "UpdateCandlesticksActivity"

UpdateCandlesticksActivityName is the name of the UpdateCandlesticks activity.

Variables

View Source
var (
	// ErrNotFound is returned when the requested data is not found.
	ErrNotFound = errors.New("not-found")
)

Functions

func DefaultActivityOptions

func DefaultActivityOptions() workflow.ActivityOptions

DefaultActivityOptions returns the default database activities options.

Types

type CandlesticksSuite

type CandlesticksSuite struct {
	suite.Suite
	DB DB
}

CandlesticksSuite is the test suite for the candlesticks database.

func (*CandlesticksSuite) TestCreate

func (suite *CandlesticksSuite) TestCreate()

TestCreate tests the case where the candlesticks are created.

func (*CandlesticksSuite) TestCreateTwice

func (suite *CandlesticksSuite) TestCreateTwice()

TestCreateTwice tests the case where the candlesticks are created twice.

func (*CandlesticksSuite) TestCreateWithNoTime

func (suite *CandlesticksSuite) TestCreateWithNoTime()

TestCreateWithNoTime tests the case where the candlestick to create does not have a time set.

func (*CandlesticksSuite) TestDelete

func (suite *CandlesticksSuite) TestDelete()

TestDelete tests the case where the candlesticks are deleted.

func (*CandlesticksSuite) TestRead

func (suite *CandlesticksSuite) TestRead()

TestRead tests the case where the candlesticks are read. TODO(#4): Refactor this function to make it shorter

func (*CandlesticksSuite) TestReadEmpty

func (suite *CandlesticksSuite) TestReadEmpty()

TestReadEmpty tests the case where there is no candlestick to read.

func (*CandlesticksSuite) TestReadLimit

func (suite *CandlesticksSuite) TestReadLimit()

TestReadLimit tests the case where the limit is set. TODO(#5): Refactor this function to make it shorter

func (*CandlesticksSuite) TestUpdate

func (suite *CandlesticksSuite) TestUpdate()

TestUpdate tests the case where the candlestick to update exists.

func (*CandlesticksSuite) TestUpdateInexistantTwice

func (suite *CandlesticksSuite) TestUpdateInexistantTwice()

TestUpdateInexistantTwice tests the case where the candlestick to update does not exist twice.

func (*CandlesticksSuite) TestUpdateWithNoTime

func (suite *CandlesticksSuite) TestUpdateWithNoTime()

TestUpdateWithNoTime tests the case where the candlestick to update does not have a time set.

type CreateCandlesticksActivityParams

type CreateCandlesticksActivityParams struct {
	List *candlestick.List
}

CreateCandlesticksActivityParams is the parameters for the CreateCandlesticks activity.

type CreateCandlesticksActivityResults

type CreateCandlesticksActivityResults struct{}

CreateCandlesticksActivityResults is the result for the CreateCandlesticks activity.

type DB

type DB interface {
	Register(w worker.Worker)

	CreateCandlesticksActivity(
		ctx context.Context,
		params CreateCandlesticksActivityParams,
	) (CreateCandlesticksActivityResults, error)

	ReadCandlesticksActivity(
		ctx context.Context,
		params ReadCandlesticksActivityParams,
	) (ReadCandlesticksActivityResults, error)

	UpdateCandlesticksActivity(
		ctx context.Context,
		params UpdateCandlesticksActivityParams,
	) (UpdateCandlesticksActivityResults, error)

	DeleteCandlesticksActivity(
		ctx context.Context,
		params DeleteCandlesticksActivityParams,
	) (DeleteCandlesticksActivityResults, error)
}

DB is the interface that defines the candlesticks activities.

type DeleteCandlesticksActivityParams

type DeleteCandlesticksActivityParams struct {
	List *candlestick.List
}

DeleteCandlesticksActivityParams is the parameters for the DeleteCandlesticks activity.

type DeleteCandlesticksActivityResults

type DeleteCandlesticksActivityResults struct{}

DeleteCandlesticksActivityResults is the result for the DeleteCandlesticks activity.

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

func (m *MockDB) CreateCandlesticksActivity(ctx context.Context, params CreateCandlesticksActivityParams) (CreateCandlesticksActivityResults, error)

CreateCandlesticksActivity mocks base method.

func (*MockDB) DeleteCandlesticksActivity

func (m *MockDB) DeleteCandlesticksActivity(ctx context.Context, params DeleteCandlesticksActivityParams) (DeleteCandlesticksActivityResults, error)

DeleteCandlesticksActivity mocks base method.

func (*MockDB) EXPECT

func (m *MockDB) EXPECT() *MockDBMockRecorder

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

func (*MockDB) ReadCandlesticksActivity

func (m *MockDB) ReadCandlesticksActivity(ctx context.Context, params ReadCandlesticksActivityParams) (ReadCandlesticksActivityResults, error)

ReadCandlesticksActivity mocks base method.

func (*MockDB) Register

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

Register mocks base method.

func (*MockDB) UpdateCandlesticksActivity

func (m *MockDB) UpdateCandlesticksActivity(ctx context.Context, params UpdateCandlesticksActivityParams) (UpdateCandlesticksActivityResults, error)

UpdateCandlesticksActivity mocks base method.

type MockDBMockRecorder

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

MockDBMockRecorder is the mock recorder for MockDB.

func (*MockDBMockRecorder) CreateCandlesticksActivity

func (mr *MockDBMockRecorder) CreateCandlesticksActivity(ctx, params interface{}) *gomock.Call

CreateCandlesticksActivity indicates an expected call of CreateCandlesticksActivity.

func (*MockDBMockRecorder) DeleteCandlesticksActivity

func (mr *MockDBMockRecorder) DeleteCandlesticksActivity(ctx, params interface{}) *gomock.Call

DeleteCandlesticksActivity indicates an expected call of DeleteCandlesticksActivity.

func (*MockDBMockRecorder) ReadCandlesticksActivity

func (mr *MockDBMockRecorder) ReadCandlesticksActivity(ctx, params interface{}) *gomock.Call

ReadCandlesticksActivity indicates an expected call of ReadCandlesticksActivity.

func (*MockDBMockRecorder) Register

func (mr *MockDBMockRecorder) Register(w interface{}) *gomock.Call

Register indicates an expected call of Register.

func (*MockDBMockRecorder) UpdateCandlesticksActivity

func (mr *MockDBMockRecorder) UpdateCandlesticksActivity(ctx, params interface{}) *gomock.Call

UpdateCandlesticksActivity indicates an expected call of UpdateCandlesticksActivity.

type ReadCandlesticksActivityParams

type ReadCandlesticksActivityParams struct {
	Exchange string
	Pair     string
	Period   period.Symbol
	Start    time.Time
	End      time.Time
	Limit    uint
}

ReadCandlesticksActivityParams is the parameters for the ReadCandlesticks activity.

type ReadCandlesticksActivityResults

type ReadCandlesticksActivityResults struct {
	List *candlestick.List
}

ReadCandlesticksActivityResults is the result for the ReadCandlesticks activity.

type UpdateCandlesticksActivityParams

type UpdateCandlesticksActivityParams struct {
	List *candlestick.List
}

UpdateCandlesticksActivityParams is the parameters for the UpdateCandlesticks activity.

type UpdateCandlesticksActivityResults

type UpdateCandlesticksActivityResults struct{}

UpdateCandlesticksActivityResults is the result for the UpdateCandlesticks activity.

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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