strategy

package
v0.0.0-...-51300c0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgFactory

type AlgFactory interface {
	//NewProd returns new production algorithm based on provided properties
	NewProd(alg *entity.Algorithm) (stmodel.Algorithm, error)
	//NewSandbox returns new sandbox algorithm based on provided properties
	NewSandbox(alg *entity.Algorithm) (stmodel.Algorithm, error)
	//NewHist returns algorithm for simulation on historical data
	NewHist(alg *entity.Algorithm) (stmodel.Algorithm, error)
	//NewRange returns slice of algorithms from provided range for simulation on historical data
	NewRange(alg *entity.Algorithm) ([]stmodel.Algorithm, error)
	//GetProdAlgs returns active algorithms running production environment
	GetProdAlgs() ([]stmodel.Algorithm, error)
	//GetSdbxAlgs returns active algorithms running sandbox environment
	GetSdbxAlgs() ([]stmodel.Algorithm, error)
	//GetAlgorithmById returns active algorithm by id, searches sandbox and prod environment
	GetAlgorithmById(algoId uint) (stmodel.Algorithm, bool)
}

AlgFactory provides methods to create new algorithms for different environments Also factory caches created algorithms and provide methods with active one

func NewAlgFactory

func NewAlgFactory(infoSdxSrv service.InfoSrv, infoProdSrv service.InfoSrv, rep repository.HistoryRepository,
	logger *zap.SugaredLogger) AlgFactory

type DefaultAlgFactory

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

func (*DefaultAlgFactory) GetAlgorithmById

func (a *DefaultAlgFactory) GetAlgorithmById(algoId uint) (stmodel.Algorithm, bool)

func (*DefaultAlgFactory) GetProdAlgs

func (a *DefaultAlgFactory) GetProdAlgs() ([]stmodel.Algorithm, error)

func (*DefaultAlgFactory) GetSdbxAlgs

func (a *DefaultAlgFactory) GetSdbxAlgs() ([]stmodel.Algorithm, error)

func (*DefaultAlgFactory) NewHist

func (*DefaultAlgFactory) NewProd

func (*DefaultAlgFactory) NewRange

func (a *DefaultAlgFactory) NewRange(alg *entity.Algorithm) ([]stmodel.Algorithm, error)

NewRange Generates range of algorithms working on history data

func (*DefaultAlgFactory) NewSandbox

func (a *DefaultAlgFactory) NewSandbox(alg *entity.Algorithm) (stmodel.Algorithm, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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