Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBufferTooSmall = codec.ErrBufferTooSmall
ErrBufferTooSmall is returned when the provided buffer is too small for encoding or decoding. It is the same error value as codec.ErrBufferTooSmall so identity comparisons work across packages.
Functions ¶
func AppendCommandJSON ¶
func AppendCommandJSON(dst []byte, cmdType CommandType, buf []byte) []byte
AppendCommandJSON decodes buf for cmdType and appends the typed JSON object.
Types ¶
type CancelAll ¶
func NewCancelAllFromBytes ¶
func (CancelAll) AppendJSON ¶
func (CancelAll) CommandType ¶
func (c CancelAll) CommandType() CommandType
func (CancelAll) GetBufferLength ¶
type CancelOrder ¶
func NewCancelOrderFromBytes ¶
func NewCancelOrderFromBytes(buf []byte) (CancelOrder, error)
func (CancelOrder) AppendJSON ¶
func (c CancelOrder) AppendJSON(dst []byte) []byte
func (CancelOrder) CommandType ¶
func (c CancelOrder) CommandType() CommandType
func (CancelOrder) Encode ¶
func (c CancelOrder) Encode(buf []byte) error
func (CancelOrder) GetBufferLength ¶
func (c CancelOrder) GetBufferLength() int
type CommandType ¶
type CommandType int
const ( // Order Commands CommandTypeUnknown CommandType = iota CommandTypeOrderRiskCheck CommandTypeOrderSubmit CommandTypeOrderCancel CommandTypeCancelAll // Account Commands CommandTypeQryBalanceSnapshot // Data Commands CommandTypeReqDepthSnapshot CommandTypeReqHistoricalKline )
func (CommandType) String ¶
func (t CommandType) String() string
type QryBalanceSnapshot ¶
type QryBalanceSnapshot struct {
AccountID int
}
func NewQryBalanceSnapshotFromBytes ¶
func NewQryBalanceSnapshotFromBytes(buf []byte) (QryBalanceSnapshot, error)
func (QryBalanceSnapshot) AppendJSON ¶
func (q QryBalanceSnapshot) AppendJSON(dst []byte) []byte
func (QryBalanceSnapshot) CommandType ¶
func (q QryBalanceSnapshot) CommandType() CommandType
func (QryBalanceSnapshot) Encode ¶
func (q QryBalanceSnapshot) Encode(buf []byte) error
func (QryBalanceSnapshot) GetBufferLength ¶
func (q QryBalanceSnapshot) GetBufferLength() int
type ReqDepthSnapshot ¶
type ReqDepthSnapshot struct {
SymbolID int
}
func NewReqDepthSnapshotFromBytes ¶
func NewReqDepthSnapshotFromBytes(buf []byte) (ReqDepthSnapshot, error)
func (ReqDepthSnapshot) AppendJSON ¶
func (r ReqDepthSnapshot) AppendJSON(dst []byte) []byte
func (ReqDepthSnapshot) CommandType ¶
func (r ReqDepthSnapshot) CommandType() CommandType
func (ReqDepthSnapshot) Encode ¶
func (r ReqDepthSnapshot) Encode(buf []byte) error
func (ReqDepthSnapshot) GetBufferLength ¶
func (r ReqDepthSnapshot) GetBufferLength() int
type ReqHistoricalKline ¶
type ReqHistoricalKline struct {
SymbolID int
Interval common.Interval
StartTime uint64
EndTime uint64
Limit int
}
ReqHistoricalKline requests historical candlesticks via the data engine. StartTime/EndTime are nanoseconds; 0 means omit that bound. Limit is the max number of bars (venue-capped); 0 uses the venue default.
func NewReqHistoricalKlineFromBytes ¶
func NewReqHistoricalKlineFromBytes(buf []byte) (ReqHistoricalKline, error)
func (ReqHistoricalKline) AppendJSON ¶
func (r ReqHistoricalKline) AppendJSON(dst []byte) []byte
func (ReqHistoricalKline) CommandType ¶
func (r ReqHistoricalKline) CommandType() CommandType
func (ReqHistoricalKline) Encode ¶
func (r ReqHistoricalKline) Encode(buf []byte) error
func (ReqHistoricalKline) GetBufferLength ¶
func (r ReqHistoricalKline) GetBufferLength() int
type RiskCheck ¶
type RiskCheck struct {
ClientOrderID int
AccountID int
SymbolID int
Side common.Side
OrderType common.OrderType
TimeInForce common.TimeInForce
Price float64
Quantity float64
Timestamp uint64 // unix nanoseconds, set by the submitter
}
func NewRiskCheckFromBytes ¶
func (RiskCheck) AppendJSON ¶
func (RiskCheck) CommandType ¶
func (r RiskCheck) CommandType() CommandType
func (RiskCheck) GetBufferLength ¶
type SubmitOrder ¶
type SubmitOrder struct {
ClientOrderID int
AccountID int
SymbolID int
Side common.Side
OrderType common.OrderType
TimeInForce common.TimeInForce
Price float64
Quantity float64
}
func NewSubmitOrderFromBytes ¶
func NewSubmitOrderFromBytes(buf []byte) (SubmitOrder, error)
func (SubmitOrder) AppendJSON ¶
func (s SubmitOrder) AppendJSON(dst []byte) []byte
func (SubmitOrder) CommandType ¶
func (s SubmitOrder) CommandType() CommandType
func (SubmitOrder) Encode ¶
func (s SubmitOrder) Encode(buf []byte) error
func (SubmitOrder) GetBufferLength ¶
func (s SubmitOrder) GetBufferLength() int
Click to show internal directories.
Click to hide internal directories.