Documentation
¶
Index ¶
- func FromAccountModels(accounts map[string]account.Account) map[string]Account
- func ToAccountModels(accounts map[string]Account) map[string]account.Account
- func ToOrderModels(orders []Order) ([]order.Order, error)
- type Account
- type CallbackWorkflow
- type Callbacks
- type Forwardtest
- type ForwardtestData
- type Order
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromAccountModels ¶
FromAccountModels converts a map of account.Account to a map of Account.
func ToAccountModels ¶
ToAccountModels converts a map of Account to a map of account.Account.
Types ¶
type CallbackWorkflow ¶ added in v1.1.0
type CallbackWorkflow struct {
Name string `json:"name"`
TaskQueueName string `json:"task_queue_name"`
ExecutionTimeout time.Duration `json:"execution_timeout"`
}
CallbackWorkflow is the entity for a callback workflow.
func FromCallbackWorkflowModel ¶ added in v1.1.0
func FromCallbackWorkflowModel(cw runtime.CallbackWorkflow) CallbackWorkflow
FromCallbackWorkflowModel converts a runtime.CallbackWorkflow model to a CallbackWorkflow entity.
func (CallbackWorkflow) ToCallbackWorkflowModel ¶ added in v1.1.0
func (cw CallbackWorkflow) ToCallbackWorkflowModel() runtime.CallbackWorkflow
ToCallbackWorkflowModel converts a CallbackWorkflow entity to a runtime.CallbackWorkflow model.
type Callbacks ¶ added in v1.1.0
type Callbacks struct {
OnInitCallback CallbackWorkflow `json:"on_init_callback"`
OnNewPricesCallback CallbackWorkflow `json:"on_new_prices_callback"`
OnExitCallback CallbackWorkflow `json:"on_exit_callback"`
}
Callbacks is the entity for callbacks.
func FromCallbacksModel ¶ added in v1.1.0
FromCallbacksModel converts a runtime.Callbacks model to a Callbacks entity.
func (Callbacks) ToCallbacksModel ¶ added in v1.1.0
ToCallbacksModel converts a Callbacks entity to a runtime.Callbacks model.
type Forwardtest ¶
type Forwardtest struct {
ID string `db:"id"`
UpdatedAt time.Time `db:"updated_at"`
Data []byte `db:"data"`
}
Forwardtest is the entity for a forwardtest.
func FromForwardtestModel ¶
func FromForwardtestModel(ft forwardtest.Forwardtest) (Forwardtest, error)
FromForwardtestModel converts a Forwardtest model to a Forwardtest entity.
func (Forwardtest) ToModel ¶
func (ft Forwardtest) ToModel() (forwardtest.Forwardtest, error)
ToModel converts a Forwardtest entity to a Forwardtest model.
type ForwardtestData ¶
type ForwardtestData struct {
Accounts map[string]Account `json:"accounts"`
Orders []Order `json:"orders"`
Callbacks Callbacks `json:"callbacks"`
Status string `json:"status"`
}
ForwardtestData is the data for a forwardtest.
type Order ¶
type Order struct {
ID string `json:"id"`
ExecutionTime *time.Time `json:"execution_time"`
Type string `json:"type"`
Exchange string `json:"exchange"`
Pair string `json:"pair"`
Side string `json:"side"`
Quantity float64 `json:"quantity"`
Price float64 `json:"price"`
}
Order is the entity for an order.
func FromOrderModel ¶
FromOrderModel converts an Order model to an entity.
func FromOrderModels ¶
FromOrderModels converts a list of order.Order to a list of Order.