Documentation ¶
Index ¶
- Constants
- Variables
- type Argument
- type Options
- func (o *Options) GetBoolean(key string) (bool, error)
- func (o *Options) GetDecimal(key string) (decimal.Decimal, error)
- func (o *Options) GetInteger(key string) (int64, error)
- func (o *Options) GetNumericDecimal(key string) (decimal.Decimal, error)
- func (o *Options) GetString(key string) (string, error)
- type SetArgument
- type SetStackFunc
- type SetStackItem
- type Stack
- type StackFunc
- type StackFuncRepository
- func (s *StackFuncRepository) Get(name string) StackFuncRun
- func (s *StackFuncRepository) GetAll() []StackFuncRun
- func (s *StackFuncRepository) GetAllDeclaration() []*StackFunc
- func (s *StackFuncRepository) GetDeclaration(name string) *StackFunc
- func (s *StackFuncRepository) Register(sf StackFuncRun)
- type StackFuncRun
- type StackItem
- type StackManager
- func (s *StackManager) Create(name string) *Stack
- func (s *StackManager) Delete(id string)
- func (s *StackManager) FuncArgumentVarList(stackId, itemVariable, argumentId string) []string
- func (s *StackManager) Get(id string) *Stack
- func (s *StackManager) GetAll() []*Stack
- func (s *StackManager) Update(id, name string, setItems []*SetStackItem) (*Stack, error)
- type StrategyContext
- type StrategyEngine
- func (s *StrategyEngine) Create() *domain.Strategy
- func (s *StrategyEngine) Delete(id string)
- func (s *StrategyEngine) Get(id string) *domain.Strategy
- func (s *StrategyEngine) GetAll() []*domain.Strategy
- func (s *StrategyEngine) GetLogs(id string) []*domain.StrategyLog
- func (s *StrategyEngine) Run()
- func (s *StrategyEngine) Update(strategy *domain.Strategy) error
- type TestItemResult
- type TestStack
Constants ¶
View Source
const ( BaseTypeString = "string" BaseTypeInteger = "integer" BaseTypeBoolean = "boolean" BaseTypeDecimal = "decimal" BaseTypeTime = "time" BaseTypeNumeric = "numeric" )
Variables ¶
View Source
var ErrOptionArgNotExist = errors.New("argument is not exist")
View Source
var ErrOptionBadType = errors.New("value is bad type")
View Source
var ErrOptionVarNotExist = errors.New("variable is not exist")
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument struct { Id string Name string Desc string BaseType string ExtendedType string Required bool Value interface{} }
func (*Argument) CheckInputBaseType ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func NewOptions ¶
func (*Options) GetNumericDecimal ¶
type SetArgument ¶
type SetArgument struct { Id string Value interface{} }
type SetStackFunc ¶
type SetStackFunc struct { Name string Arguments []*SetArgument }
type SetStackItem ¶
type SetStackItem struct { Variable string StackFunc *SetStackFunc }
type StackFuncRepository ¶
type StackFuncRepository struct {
// contains filtered or unexported fields
}
func NewStackFuncRepository ¶
func NewStackFuncRepository() *StackFuncRepository
func (*StackFuncRepository) Get ¶
func (s *StackFuncRepository) Get(name string) StackFuncRun
func (*StackFuncRepository) GetAll ¶
func (s *StackFuncRepository) GetAll() []StackFuncRun
func (*StackFuncRepository) GetAllDeclaration ¶
func (s *StackFuncRepository) GetAllDeclaration() []*StackFunc
func (*StackFuncRepository) GetDeclaration ¶
func (s *StackFuncRepository) GetDeclaration(name string) *StackFunc
func (*StackFuncRepository) Register ¶
func (s *StackFuncRepository) Register(sf StackFuncRun)
type StackFuncRun ¶
type StackFuncRun interface { Name() string BaseType() string Run(options *Options, now time.Time, accountId string, isTest bool) (interface{}, error) Arguments() []*Argument }
StackFuncRun Функция элемента стека для выполнения.
type StackManager ¶
type StackManager struct {
// contains filtered or unexported fields
}
StackManager Менеджер управления стеками.
func NewStackManager ¶
func NewStackManager(sfr *StackFuncRepository) *StackManager
func (*StackManager) Create ¶
func (s *StackManager) Create(name string) *Stack
func (*StackManager) Delete ¶
func (s *StackManager) Delete(id string)
func (*StackManager) FuncArgumentVarList ¶
func (s *StackManager) FuncArgumentVarList(stackId, itemVariable, argumentId string) []string
func (*StackManager) Get ¶
func (s *StackManager) Get(id string) *Stack
func (*StackManager) GetAll ¶
func (s *StackManager) GetAll() []*Stack
func (*StackManager) Update ¶
func (s *StackManager) Update(id, name string, setItems []*SetStackItem) (*Stack, error)
type StrategyContext ¶
type StrategyContext struct { Strategy *domain.Strategy LastRun time.Time Logs []*domain.StrategyLog IsRunning bool }
func (*StrategyContext) WriteErrorLog ¶
func (s *StrategyContext) WriteErrorLog(text string)
func (*StrategyContext) WriteStartLog ¶
func (s *StrategyContext) WriteStartLog()
type StrategyEngine ¶
type StrategyEngine struct {
// contains filtered or unexported fields
}
StrategyEngine Движок исполнения стратегий.
func NewStrategyEngine ¶
func NewStrategyEngine(sm *StackManager, sfr *StackFuncRepository, logger *zap.Logger) *StrategyEngine
func (*StrategyEngine) Create ¶
func (s *StrategyEngine) Create() *domain.Strategy
func (*StrategyEngine) Delete ¶
func (s *StrategyEngine) Delete(id string)
func (*StrategyEngine) GetAll ¶
func (s *StrategyEngine) GetAll() []*domain.Strategy
func (*StrategyEngine) GetLogs ¶
func (s *StrategyEngine) GetLogs(id string) []*domain.StrategyLog
func (*StrategyEngine) Run ¶
func (s *StrategyEngine) Run()
type TestItemResult ¶
type TestStack ¶
type TestStack struct {
// contains filtered or unexported fields
}
TestStack Движок тестирования стека.
func NewTestStack ¶
func NewTestStack(sm *StackManager, sfr *StackFuncRepository) *TestStack
Source Files ¶
Click to show internal directories.
Click to hide internal directories.