worker

package
v0.0.0-...-b185666 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockNamespace

type MockNamespace struct {
	mock.Mock
}

MockNamespace is an autogenerated mock type for the Namespace type

func NewMockNamespace

func NewMockNamespace(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockNamespace

NewMockNamespace creates a new instance of MockNamespace. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockNamespace) Flush

func (_m *MockNamespace) Flush()

Flush provides a mock function with given fields:

func (*MockNamespace) Get

func (_m *MockNamespace) Get(key string) *structpb.Struct

Get provides a mock function with given fields: key

func (*MockNamespace) Set

func (_m *MockNamespace) Set(key string, value *structpb.Struct) error

Set provides a mock function with given fields: key, value

type MockPool

type MockPool struct {
	mock.Mock
}

MockPool is an autogenerated mock type for the Pool type

func NewMockPool

func NewMockPool(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPool

NewMockPool creates a new instance of MockPool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPool) Close

func (_m *MockPool) Close() error

Close provides a mock function with given fields:

func (*MockPool) Configure

func (_m *MockPool) Configure() *pb.ExecutionConfiguration

Configure provides a mock function with given fields:

func (*MockPool) Process

func (_m *MockPool) Process(ctx context.Context, timestamp time.Time, symbols []string, portfolio *financepb.Portfolio) ([]*financepb.Order, error)

Process provides a mock function with given fields: ctx, timestamp, symbols, portfolio

type Namespace

type Namespace interface {
	Get(key string) *structpb.Struct
	Set(key string, value *structpb.Struct) error
	Flush()
}

func CreateNamespace

func CreateNamespace(namespaces []string) Namespace

type Pool

type Pool interface {
	Configure() *worker_pb.ExecutionConfiguration
	Process(ctx context.Context,
		timestamp time.Time, symbols []string, portfolio *finance_pb.Portfolio) ([]*finance_pb.Order, error)
	Close() error
}

func NewPool

func NewPool(ctx context.Context, algo *worker_pb.Algorithm) (Pool, error)

Jump to

Keyboard shortcuts

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