clients

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// ListenToTicks listens to ticks from the given exchange and pair.
	ListenToTicks(
		ctx context.Context,
		listener ListenerParams,
		exchange, pair string,
	) error
	// StopListeningToTicks unregisters a callback workflow from ticks for a given exchange and pair.
	StopListeningToTicks(
		ctx context.Context,
		listener uuid.UUID,
		exchange string,
		pair string,
	) error
	// Info calls the service info.
	Info(ctx context.Context) (api.ServiceInfoResults, error)
	// TemporalClient returns the underlying temporal client.
	TemporalClient() temporalclient.Client
}

Client is a client for the cryptellation ticks service.

func New

func New(cl temporalclient.Client, opts ...ClientOptions) Client

New creates a new client to execute temporal workflows.

type ClientOptions added in v1.0.4

type ClientOptions struct {
	UserAgent string
}

ClientOptions holds configuration options for creating a new client.

type ListenerParams added in v1.0.4

type ListenerParams struct {
	RequesterID uuid.UUID

	CallbackNamePrefix string
	Callback           func(ctx workflow.Context, params api.ListenToTicksCallbackWorkflowParams) error

	Worker    worker.Worker
	TaskQueue string
}

ListenerParams holds information for registering a callback workflow.

type WfClient

type WfClient interface {
	// ListenToTicks listens to ticks from the given exchange and pair.
	ListenToTicks(
		ctx workflow.Context,
		params api.RegisterForTicksListeningWorkflowParams,
	) (api.RegisterForTicksListeningWorkflowResults, error)

	// StopListeningToTicks unregisters a callback workflow from ticks for a given exchange and pair.
	StopListeningToTicks(
		ctx workflow.Context,
		params api.UnregisterFromTicksListeningWorkflowParams,
	) (api.UnregisterFromTicksListeningWorkflowResults, error)
}

WfClient is a client for the cryptellation ticks 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.

Jump to

Keyboard shortcuts

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