Documentation
¶
Index ¶
- Constants
- func CleanUp()
- func SendMsg(msg map[string]interface{})
- func SetOrderManager(mgr OrderManagerInterface)
- func SetWalletInfoProvider(p WalletInfoProvider)
- func TrySendExc(cacheKey string, content string)
- type BotSecret
- type Email
- type ExcEncoder
- type ExcNotify
- type IWebHook
- type OrderInfo
- type OrderManagerInterface
- type Telegram
- type WalletInfoProvider
- type WeCred
- type WeWork
- type WeWorkATRes
- type WeWorkRes
- type WeWorkSendRes
- type WebHook
Constants ¶
View Source
const ( MsgTypeStatus = "status" MsgTypeException = "exception" MsgTypeStartUp = "startup" MsgTypeEntry = "entry" MsgTypeExit = "exit" MsgTypeMarket = "market" )
Variables ¶
This section is empty.
Functions ¶
func SetOrderManager ¶ added in v0.2.23
func SetOrderManager(mgr OrderManagerInterface)
SetOrderManager 设置订单管理器(由外部调用)
func SetWalletInfoProvider ¶ added in v0.2.23
func SetWalletInfoProvider(p WalletInfoProvider)
SetWalletInfoProvider 设置钱包信息提供者(由外部调用)
func TrySendExc ¶
Types ¶
type Email ¶ added in v0.2.18
type Email struct {
*WebHook
// contains filtered or unexported fields
}
type ExcEncoder ¶
type ExcEncoder struct {
*log.TextEncoder
}
func (*ExcEncoder) Clone ¶
func (e *ExcEncoder) Clone() *ExcEncoder
func (*ExcEncoder) EncodeEntry ¶
type ExcNotify ¶
type ExcNotify struct {
zapcore.LevelEnabler
// contains filtered or unexported fields
}
func NewExcNotify ¶
func NewExcNotify() *ExcNotify
func (*ExcNotify) Check ¶
func (h *ExcNotify) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
type OrderInfo ¶ added in v0.2.23
type OrderInfo struct {
ID int64 `json:"id"`
Symbol string `json:"symbol"`
Short bool `json:"short"`
Price float64 `json:"price"`
Amount float64 `json:"amount"`
EnterTag string `json:"enter_tag"`
Account string `json:"account"`
}
OrderInfo 订单信息结构
type OrderManagerInterface ¶ added in v0.2.23
type OrderManagerInterface interface {
GetActiveOrders(account string) ([]*OrderInfo, error)
CloseOrder(account string, orderID int64) error
CloseAllOrders(account string) (int, int, error) // success count, failed count, error
GetOrderStats(account string) (longCount, shortCount int, err error)
}
OrderManagerInterface 订单管理接口,避免循环依赖
type Telegram ¶ added in v0.2.23
type Telegram struct {
*WebHook
// contains filtered or unexported fields
}
func NewTelegram ¶ added in v0.2.23
NewTelegram 构造函数,基于通用 WebHook 创建 Telegram 发送实例
func (*Telegram) IsTradingDisabled ¶ added in v0.2.23
IsTradingDisabled 检查指定账户是否被禁用交易(供外部调用)
type WalletInfoProvider ¶ added in v0.2.23
type WalletInfoProvider interface {
// 返回 单账户: 总额(法币), 可用(法币), 未实现盈亏(法币)
GetSummary(account string) (totalLegal float64, availableLegal float64, unrealizedPOLLegal float64)
}
WalletInfoProvider 钱包信息提供者接口
type WeWorkATRes ¶
type WeWorkSendRes ¶
type WebHook ¶
type WebHook struct {
Config map[string]interface{}
MsgTypes map[string]bool
Accounts map[string]bool
Queue chan map[string]string
// contains filtered or unexported fields
}
func NewWebHook ¶
func (*WebHook) ConsumeForever ¶
func (h *WebHook) ConsumeForever()
func (*WebHook) SetDisable ¶
Click to show internal directories.
Click to hide internal directories.