pkg

package
v0.0.0-...-ce66ebf Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TgBotApiToken string
	ChatId        int64
	Bot           *tgbotapi.BotAPI
)

Functions

func Binance1

func Binance1(data map[string]interface{}) bool

func Binance2

func Binance2(data map[string]interface{}) bool

func Coinbase1

func Coinbase1(data map[string]interface{}) bool

func InitBot

func InitBot()

func NewTwitterClient

func NewTwitterClient() *twitterClient

func SendMsg

func SendMsg(title, createTime, url, body, source, coins string)

func Upbit1

func Upbit1(data map[string]interface{}) bool

Types

type Config

type Config struct {
	TgBotApiToken string
	TgChatid      int64
	WeiboUid      []int
	MergeMessage  bool
	Interval      int
	SavePicLocal  bool
	SendLivePics  bool
}

type RuelEngine

type RuelEngine struct {
	Keys []string
	RuleEngine
	CanOrder      chan *config.CanOrder
	Hashmap       *hashmap.HashMap
	TwitterClient *twitterClient
}

func NewRuelEngine

func NewRuelEngine(co chan *config.CanOrder) RuelEngine

func (RuelEngine) OrdreNews

func (e RuelEngine) OrdreNews(json []byte)

func (RuelEngine) ParseNews

func (e RuelEngine) ParseNews(json []byte)

func (RuelEngine) TeleNews

func (e RuelEngine) TeleNews(json []byte)

type RuleEngine

type RuleEngine struct {
	Rules  map[string]func(data map[string]interface{}) bool
	Rows   [][]interface{}
	Data   dataframe.DataFrame
	Titles []string
	Time   []string
	Source []string
	Url    []string
}

func NewRule

func NewRule() RuleEngine

func (*RuleEngine) AddRule

func (e *RuleEngine) AddRule(name string, fn func(data map[string]interface{}) bool)

func (*RuleEngine) RunRules

func (e *RuleEngine) RunRules(data map[string]interface{}) (bool, string)

func (*RuleEngine) SaveToCSV

func (e *RuleEngine) SaveToCSV()

type TradeBot

type TradeBot struct {
	NewsStream    *news.Stream
	RuelEngine    *RuelEngine
	BinanceFuture *exchange.BinanceFuture
	CanOrder      chan *config.CanOrder
	Cache         *cache2go.CacheTable
	Twid          *cache2go.CacheTable
	Ctx           context.Context
	Wsserver      *server.WebSocketServer
	TwitterClient *twitterClient
}

func NewTradeBot

func NewTradeBot() TradeBot

func (*TradeBot) ListenCreateOrder

func (tb *TradeBot) ListenCreateOrder()

func (*TradeBot) ListenNews

func (tb *TradeBot) ListenNews()

func (*TradeBot) ProcessOrder

func (tb *TradeBot) ProcessOrder(t *config.CanOrder)

func (*TradeBot) Run

func (tb *TradeBot) Run()

func (*TradeBot) SocketServer

func (tb *TradeBot) SocketServer()

func (*TradeBot) TeleBot

func (tb *TradeBot) TeleBot()

启动电报

func (*TradeBot) TwitterFilter

func (tb *TradeBot) TwitterFilter() error

启动电报

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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