Documentation ¶
Overview ¶
Package order provides middleware utilities around orders. It wraps calls to the database and to the binance endpoints.
Index ¶
- Variables
- type Core
- func (c Core) Create(ctx context.Context, nOdr NewOrder, now time.Time) (Order, error)
- func (c Core) Query(ctx context.Context, pageNumber int, rowsPerPage int) ([]Order, error)
- func (c Core) QueryByID(ctx context.Context, odrID string) (Order, error)
- func (c Core) QueryByUser(ctx context.Context, pageNumber int, rowsPerPage int, usrID string) ([]Order, error)
- type NewOrder
- type Order
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("order not found") ErrAuthenticationFailure = errors.New("authentication failed") ErrInvalidID = errors.New("ID is not in its proper form") )
Set of error variables for CRUD operations.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core manages the set of API's for candle access.
type NewOrder ¶
type NewOrder struct { PositionID string `json:"position_id" validate:"required"` SymbolID string `json:"-"` Symbol string `json:"-"` Quantity float64 `json:"quantity" validate:"required"` Side string `json:"side" validate:"required"` }
NewOrder contains information needed to create a new Order.
type Order ¶
type Order struct { ID string `json:"order_id"` SymbolID string `json:"symbol_id"` PositionID string `json:"position_id"` CreationTime time.Time `json:"creation_time"` Price float64 `json:"price"` Quantity float64 `json:"quantity"` Status string `json:"status"` Type string `json:"type"` Side string `json:"side"` }
Order represents an individual order
Click to show internal directories.
Click to hide internal directories.