entities

package
v0.0.0-...-f05cc18 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAccountModels

func FromAccountModels(accounts map[string]account.Account) map[string]Account

func ToAccountModels

func ToAccountModels(accounts map[string]Account) map[string]account.Account

func ToOrderModels

func ToOrderModels(orders []Order) ([]order.Order, error)

Types

type Account

type Account struct {
	Balances map[string]float64 `bson:"balances"`
}

type ForwardTest

type ForwardTest struct {
	ID        string    `bson:"_id"`
	UpdatedAt time.Time `bson:"updated_at"`

	Accounts map[string]Account `bson:"accounts"`
	Orders   []Order            `bson:"orders"`
}

func FromForwardTestModel

func FromForwardTestModel(ft forwardtest.ForwardTest) ForwardTest

func (ForwardTest) ToModel

func (ft ForwardTest) ToModel() (forwardtest.ForwardTest, error)

type Order

type Order struct {
	ID            string     `bson:"id"`
	ExecutionTime *time.Time `bson:"execution_time"`
	Type          string     `bson:"type"`
	Exchange      string     `bson:"exchange"`
	Pair          string     `bson:"pair"`
	Side          string     `bson:"side"`
	Quantity      float64    `bson:"quantity"`
	Price         float64    `bson:"price"`
}

func FromOrderModel

func FromOrderModel(m order.Order) Order

func FromOrderModels

func FromOrderModels(models []order.Order) []Order

func (Order) ToModel

func (o Order) ToModel() (order.Order, error)

Jump to

Keyboard shortcuts

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