engine

package
v0.0.0-...-089aa6e Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	IEngine
	ExchangeType exchange.Type
	Exchange     exchange.IExchange
	Strategies   []strategy.IStrategy
	// contains filtered or unexported fields
}

func (*Base) GetLogger

func (e *Base) GetLogger() *log.Entry

func (*Base) RegisterStrategy

func (e *Base) RegisterStrategy(s strategy.IStrategy)

func (*Base) SetDb

func (e *Base) SetDb(client *gorm.DB)

type Engine

type Engine struct {
	Base
}

func (*Engine) Start

func (e *Engine) Start(block bool)

func (*Engine) SubscribeAccount

func (e *Engine) SubscribeAccount()

func (*Engine) SubscribeMarketData

func (e *Engine) SubscribeMarketData(strategy strategy.IStrategy) error

type IEngine

type IEngine interface {
	Start(block bool)
	SetDb(client *gorm.DB)
	RegisterStrategy(strategy strategy.IStrategy)
	SubscribeMarketData(strategy strategy.IStrategy) error
	SubscribeAccount()
	GetLogger() *log.Entry
}

func GetEngine

func GetEngine(exchangeType exchange.Type, apiKey string, apiSecret string) *IEngine

type Mock

type Mock struct {
	Base
}

func (*Mock) Start

func (e *Mock) Start(block bool)

func (*Mock) SubscribeMarketData

func (e *Mock) SubscribeMarketData(strategy strategy.IStrategy) error

Jump to

Keyboard shortcuts

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