Documentation
¶
Index ¶
- type Client
- type Forwardtest
- func (ft Forwardtest) CreateOrder(ctx context.Context, order order.Order) (api.CreateForwardtestOrderWorkflowResults, error)
- func (ft Forwardtest) Get(ctx context.Context) (forwardtest.Forwardtest, error)
- func (ft Forwardtest) GetBalance(ctx context.Context) (float64, error)
- func (ft Forwardtest) ListAccounts(ctx context.Context) (map[string]account.Account, error)
- func (ft *Forwardtest) Run(ctx context.Context) error
- func (ft Forwardtest) Stop(ctx context.Context) error
- type RawClient
- type WfClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// NewForwardtest creates a new forwardtest.
NewForwardtest(
ctx context.Context,
params api.CreateForwardtestWorkflowParams,
) (Forwardtest, error)
// ListForwardtests lists the forwardtests.
ListForwardtests(
ctx context.Context,
params api.ListForwardtestsWorkflowParams,
) ([]Forwardtest, error)
// Info calls the service info.
Info(ctx context.Context) (api.ServiceInfoResults, error)
// RawClient returns the raw client.
RawClient() RawClient
}
Client is a client for the cryptellation forwardtests service.
func New ¶
func New(cl temporalclient.Client) Client
New creates a new client to execute temporal workflows.
type Forwardtest ¶
Forwardtest is a local representation of a forwardtest running on the Cryptellation API.
func (Forwardtest) CreateOrder ¶
func (ft Forwardtest) CreateOrder( ctx context.Context, order order.Order, ) (api.CreateForwardtestOrderWorkflowResults, error)
CreateOrder creates an order on the forwardtest.
func (Forwardtest) Get ¶ added in v1.1.1
func (ft Forwardtest) Get(ctx context.Context) (forwardtest.Forwardtest, error)
Get retrieves the forwardtest data from the database.
func (Forwardtest) GetBalance ¶ added in v1.1.1
func (ft Forwardtest) GetBalance( ctx context.Context, ) (float64, error)
GetBalance gets the balance of the forwardtest.
func (Forwardtest) ListAccounts ¶
ListAccounts lists the accounts of the forwardtest.
type RawClient ¶
type RawClient interface {
CreateForwardtest(
ctx context.Context,
params api.CreateForwardtestWorkflowParams,
) (api.CreateForwardtestWorkflowResults, error)
GetForwardtest(
ctx context.Context,
params api.GetForwardtestWorkflowParams,
) (api.GetForwardtestWorkflowResults, error)
GetForwardtestBalance(
ctx context.Context,
params api.GetForwardtestBalanceWorkflowParams,
) (api.GetForwardtestBalanceWorkflowResults, error)
ListForwardtests(
ctx context.Context,
params api.ListForwardtestsWorkflowParams,
) (api.ListForwardtestsWorkflowResults, error)
CreateForwardtestOrder(
ctx context.Context,
params api.CreateForwardtestOrderWorkflowParams,
) (api.CreateForwardtestOrderWorkflowResults, error)
ListForwardtestAccounts(
ctx context.Context,
params api.ListForwardtestAccountsWorkflowParams,
) (api.ListForwardtestAccountsWorkflowResults, error)
RunForwardtest(
ctx context.Context,
params api.RunForwardtestWorkflowParams,
) (api.RunForwardtestWorkflowResults, error)
StopForwardtest(
ctx context.Context,
params api.StopForwardtestWorkflowParams,
) (api.StopForwardtestWorkflowResults, error)
}
RawClient is a client for the cryptellation backtests service with just the calls to the temporal workflows.
func NewRaw ¶
func NewRaw(cl temporalclient.Client) RawClient
NewRaw creates a new raw client to execute temporal workflows.
type WfClient ¶
type WfClient interface {
// CreateForwardtestOrder creates a new order for a forwardtest.
CreateForwardtestOrder(
ctx workflow.Context,
params api.CreateForwardtestOrderWorkflowParams,
) (api.CreateForwardtestOrderWorkflowResults, error)
// GetForwardtest retrieves a forwardtest from the database by its ID.
GetForwardtest(
ctx workflow.Context,
params api.GetForwardtestWorkflowParams,
) (api.GetForwardtestWorkflowResults, error)
// SubscribeToPrice subscribes to specific price updates for a forwardtest.
SubscribeToPrice(
ctx workflow.Context,
params api.SubscribeToPriceWorkflowParams,
) (api.SubscribeToPriceWorkflowResults, error)
}
WfClient is a client for the cryptellation forwardtests service from a workflow perspective.
func NewWfClient ¶
func NewWfClient() WfClient
NewWfClient creates a new workflow client. This client is used to call workflows from within other workflows. It is not used to call workflows from outside the workflow environment.