db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package db is a generated GoMock package.

Index

Constants

View Source
const (
	Expiration = 3 * time.Second
	RetryDelay = 100 * time.Millisecond
	Tries      = 20
)

Variables

View Source
var (
	ErrRecordNotFound = errors.New("record not found")
	ErrNotImplemented = errors.New("not implemented")
)

Functions

This section is empty.

Types

type BacktestSuite

type BacktestSuite struct {
	suite.Suite
	DB Port
}

func (*BacktestSuite) TestCreateRead

func (suite *BacktestSuite) TestCreateRead()

func (*BacktestSuite) TestDelete

func (suite *BacktestSuite) TestDelete()

func (*BacktestSuite) TestDeleteInexistant

func (suite *BacktestSuite) TestDeleteInexistant()

func (*BacktestSuite) TestLock

func (suite *BacktestSuite) TestLock()

func (*BacktestSuite) TestUpdate

func (suite *BacktestSuite) TestUpdate()

type LockedBacktestCallback

type LockedBacktestCallback func(bt *backtest.Backtest) error

type MockPort

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

MockPort is a mock of Port interface.

func NewMockPort

func NewMockPort(ctrl *gomock.Controller) *MockPort

NewMockPort creates a new mock instance.

func (*MockPort) CreateBacktest

func (m *MockPort) CreateBacktest(ctx context.Context, bt *backtest.Backtest) error

CreateBacktest mocks base method.

func (*MockPort) DeleteBacktest

func (m *MockPort) DeleteBacktest(ctx context.Context, bt backtest.Backtest) error

DeleteBacktest mocks base method.

func (*MockPort) EXPECT

func (m *MockPort) EXPECT() *MockPortMockRecorder

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

func (*MockPort) LockedBacktest

func (m *MockPort) LockedBacktest(ctx context.Context, id uint, fn LockedBacktestCallback) error

LockedBacktest mocks base method.

func (*MockPort) ReadBacktest

func (m *MockPort) ReadBacktest(ctx context.Context, id uint) (backtest.Backtest, error)

ReadBacktest mocks base method.

func (*MockPort) UpdateBacktest

func (m *MockPort) UpdateBacktest(ctx context.Context, bt backtest.Backtest) error

UpdateBacktest mocks base method.

type MockPortMockRecorder

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

MockPortMockRecorder is the mock recorder for MockPort.

func (*MockPortMockRecorder) CreateBacktest

func (mr *MockPortMockRecorder) CreateBacktest(ctx, bt interface{}) *gomock.Call

CreateBacktest indicates an expected call of CreateBacktest.

func (*MockPortMockRecorder) DeleteBacktest

func (mr *MockPortMockRecorder) DeleteBacktest(ctx, bt interface{}) *gomock.Call

DeleteBacktest indicates an expected call of DeleteBacktest.

func (*MockPortMockRecorder) LockedBacktest

func (mr *MockPortMockRecorder) LockedBacktest(ctx, id, fn interface{}) *gomock.Call

LockedBacktest indicates an expected call of LockedBacktest.

func (*MockPortMockRecorder) ReadBacktest

func (mr *MockPortMockRecorder) ReadBacktest(ctx, id interface{}) *gomock.Call

ReadBacktest indicates an expected call of ReadBacktest.

func (*MockPortMockRecorder) UpdateBacktest

func (mr *MockPortMockRecorder) UpdateBacktest(ctx, bt interface{}) *gomock.Call

UpdateBacktest indicates an expected call of UpdateBacktest.

type Port

type Port interface {
	CreateBacktest(ctx context.Context, bt *backtest.Backtest) error
	ReadBacktest(ctx context.Context, id uint) (backtest.Backtest, error)
	UpdateBacktest(ctx context.Context, bt backtest.Backtest) error
	DeleteBacktest(ctx context.Context, bt backtest.Backtest) error

	LockedBacktest(ctx context.Context, id uint, fn LockedBacktestCallback) error
}

Jump to

Keyboard shortcuts

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