Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOrderNotFound = errors.New("Order not found") ErrOrderBookIsEmpty = errors.New("Order Book is empty") )
View Source
var Orders = cmap.New()
Orders represent Orders
Functions ¶
This section is empty.
Types ¶
type MarketSnapshot ¶
type MarketSnapshot struct {
Asks []MarketSnapshotItem `json:"asks,omitempty"`
Bids []MarketSnapshotItem `json:"bids,omitempty"`
Spread float64 `json:"spread"`
}
MarketSnapshot represents Market Data snapshot
type MarketSnapshotItem ¶
MarketSnapshotItem represents item for Market Data snapshot
type Order ¶
type Order struct {
ID string `json:"id,omitempty"`
UUID string `json:"uuid,omitempty"`
Side string `json:"side"`
Price float64 `json:"price"`
Quantity int `json:"quantity"`
Status string `json:"status,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
}
Order represents an order
type OrderService ¶
type OrderService interface {
Create(ctx context.Context, order Order) (string, error)
GetByID(ctx context.Context, id string) (Order, error)
RemoveByID(ctx context.Context, id string) error
GetMarketSnapshot(ctx context.Context) (MarketSnapshot, error)
}
OrderService describes the Order service.
func NewService ¶
func NewService(logger log.Logger) OrderService
NewService creates and returns a new Order service instance
Click to show internal directories.
Click to hide internal directories.