From 3d5507a053ad2a3b5830fb50eebd047b9dca73d2 Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 11 Oct 2020 16:46:15 +0800 Subject: [PATCH] move files into pkg --- cmd/pnl.go | 12 ++++++------ examples/max-eqmaker/main.go | 10 +++++----- examples/max-orders/main.go | 2 +- {accounting => pkg/accounting}/pnl.go | 2 +- {accounting => pkg/accounting}/report.go | 4 ++-- {bbgo => pkg/bbgo}/account.go | 6 +++--- {bbgo => pkg/bbgo}/accounting.go | 0 {bbgo => pkg/bbgo}/config/config.go | 0 {bbgo => pkg/bbgo}/context.go | 4 ++-- {bbgo => pkg/bbgo}/indicator.go | 2 +- {bbgo => pkg/bbgo}/indicator_test.go | 2 +- {bbgo => pkg/bbgo}/kline_regression.go | 6 +++--- {bbgo => pkg/bbgo}/market.go | 0 {bbgo => pkg/bbgo}/marketdatastore_callbacks.go | 2 +- {bbgo => pkg/bbgo}/order.go | 0 {bbgo => pkg/bbgo}/order_processor.go | 4 ++-- {bbgo => pkg/bbgo}/order_processor_test.go | 0 {bbgo => pkg/bbgo}/pnl.go | 0 {bbgo => pkg/bbgo}/slack.go | 4 ++-- {bbgo => pkg/bbgo}/stock.go | 2 +- {bbgo => pkg/bbgo}/stock_test.go | 2 +- {bbgo => pkg/bbgo}/store.go | 2 +- {bbgo => pkg/bbgo}/testdata/btcusdt-trades.json | 0 {bbgo => pkg/bbgo}/trader.go | 10 +++++----- .../exchange}/binance/depthframe_callbacks.go | 0 {exchange => pkg/exchange}/binance/exchange.go | 4 ++-- {exchange => pkg/exchange}/binance/parse.go | 6 +++--- {exchange => pkg/exchange}/binance/stream.go | 4 ++-- .../exchange}/binance/stream_callbacks.go | 0 {exchange => pkg/exchange}/binance/trade.go | 0 {exchange => pkg/exchange}/max/exchange.go | 6 +++--- {exchange => pkg/exchange}/max/maxapi/account.go | 0 {exchange => pkg/exchange}/max/maxapi/auth.go | 0 {exchange => pkg/exchange}/max/maxapi/order.go | 0 {exchange => pkg/exchange}/max/maxapi/public.go | 2 +- .../exchange}/max/maxapi/public_parser.go | 4 ++-- {exchange => pkg/exchange}/max/maxapi/restapi.go | 0 {exchange => pkg/exchange}/max/maxapi/trade.go | 0 {exchange => pkg/exchange}/max/maxapi/userdata.go | 4 ++-- {exchange => pkg/exchange}/max/maxapi/websocket.go | 0 .../max/maxapi/websocketservice_callbacks.go | 0 {exchange => pkg/exchange}/max/stream.go | 4 ++-- {fixedpoint => pkg/fixedpoint}/convert.go | 0 {notifier => pkg/notifier}/slacknotifier/slack.go | 6 +++--- {service => pkg/service}/trade.go | 2 +- {sigchan => pkg/sigchan}/sigchan.go | 0 {slack => pkg/slack}/slacklog/logrus_look.go | 0 {slack => pkg/slack}/slackstyle/style.go.go | 0 {types => pkg/types}/account.go | 0 {types => pkg/types}/color.go | 0 {types => pkg/types}/currencies.go | 0 {types => pkg/types}/exchange.go | 0 {types => pkg/types}/kline.go | 2 +- {types => pkg/types}/kline_test.go | 0 {types => pkg/types}/market.go | 0 {types => pkg/types}/order.go | 0 {types => pkg/types}/orderbook.go | 4 ++-- {types => pkg/types}/orderbook_callbacks.go | 0 {types => pkg/types}/side.go | 0 {types => pkg/types}/standardstream_callbacks.go | 0 {types => pkg/types}/stream.go | 0 {types => pkg/types}/trade.go | 2 +- {types => pkg/types}/trader.go | 0 {util => pkg/util}/math.go | 0 {util => pkg/util}/math_test.go | 0 {util => pkg/util}/rate_limit.go | 0 {util => pkg/util}/rate_limit_test.go | 0 {util => pkg/util}/render.go | 0 {util => pkg/util}/retry.go | 0 {util => pkg/util}/retry_test.go | 0 {util => pkg/util}/volatile_memory.go | 0 71 files changed, 63 insertions(+), 63 deletions(-) rename {accounting => pkg/accounting}/pnl.go (98%) rename {accounting => pkg/accounting}/report.go (96%) rename {bbgo => pkg/bbgo}/account.go (87%) rename {bbgo => pkg/bbgo}/accounting.go (100%) rename {bbgo => pkg/bbgo}/config/config.go (100%) rename {bbgo => pkg/bbgo}/context.go (86%) rename {bbgo => pkg/bbgo}/indicator.go (96%) rename {bbgo => pkg/bbgo}/indicator_test.go (80%) rename {bbgo => pkg/bbgo}/kline_regression.go (97%) rename {bbgo => pkg/bbgo}/market.go (100%) rename {bbgo => pkg/bbgo}/marketdatastore_callbacks.go (91%) rename {bbgo => pkg/bbgo}/order.go (100%) rename {bbgo => pkg/bbgo}/order_processor.go (98%) rename {bbgo => pkg/bbgo}/order_processor_test.go (100%) rename {bbgo => pkg/bbgo}/pnl.go (100%) rename {bbgo => pkg/bbgo}/slack.go (79%) rename {bbgo => pkg/bbgo}/stock.go (99%) rename {bbgo => pkg/bbgo}/stock_test.go (99%) rename {bbgo => pkg/bbgo}/store.go (96%) rename {bbgo => pkg/bbgo}/testdata/btcusdt-trades.json (100%) rename {bbgo => pkg/bbgo}/trader.go (98%) rename {exchange => pkg/exchange}/binance/depthframe_callbacks.go (100%) rename {exchange => pkg/exchange}/binance/exchange.go (99%) rename {exchange => pkg/exchange}/binance/parse.go (99%) rename {exchange => pkg/exchange}/binance/stream.go (99%) rename {exchange => pkg/exchange}/binance/stream_callbacks.go (100%) rename {exchange => pkg/exchange}/binance/trade.go (100%) rename {exchange => pkg/exchange}/max/exchange.go (98%) rename {exchange => pkg/exchange}/max/maxapi/account.go (100%) rename {exchange => pkg/exchange}/max/maxapi/auth.go (100%) rename {exchange => pkg/exchange}/max/maxapi/order.go (100%) rename {exchange => pkg/exchange}/max/maxapi/public.go (99%) rename {exchange => pkg/exchange}/max/maxapi/public_parser.go (98%) rename {exchange => pkg/exchange}/max/maxapi/restapi.go (100%) rename {exchange => pkg/exchange}/max/maxapi/trade.go (100%) rename {exchange => pkg/exchange}/max/maxapi/userdata.go (98%) rename {exchange => pkg/exchange}/max/maxapi/websocket.go (100%) rename {exchange => pkg/exchange}/max/maxapi/websocketservice_callbacks.go (100%) rename {exchange => pkg/exchange}/max/stream.go (95%) rename {fixedpoint => pkg/fixedpoint}/convert.go (100%) rename {notifier => pkg/notifier}/slacknotifier/slack.go (96%) rename {service => pkg/service}/trade.go (98%) rename {sigchan => pkg/sigchan}/sigchan.go (100%) rename {slack => pkg/slack}/slacklog/logrus_look.go (100%) rename {slack => pkg/slack}/slackstyle/style.go.go (100%) rename {types => pkg/types}/account.go (100%) rename {types => pkg/types}/color.go (100%) rename {types => pkg/types}/currencies.go (100%) rename {types => pkg/types}/exchange.go (100%) rename {types => pkg/types}/kline.go (99%) rename {types => pkg/types}/kline_test.go (100%) rename {types => pkg/types}/market.go (100%) rename {types => pkg/types}/order.go (100%) rename {types => pkg/types}/orderbook.go (98%) rename {types => pkg/types}/orderbook_callbacks.go (100%) rename {types => pkg/types}/side.go (100%) rename {types => pkg/types}/standardstream_callbacks.go (100%) rename {types => pkg/types}/stream.go (100%) rename {types => pkg/types}/trade.go (98%) rename {types => pkg/types}/trader.go (100%) rename {util => pkg/util}/math.go (100%) rename {util => pkg/util}/math_test.go (100%) rename {util => pkg/util}/rate_limit.go (100%) rename {util => pkg/util}/rate_limit_test.go (100%) rename {util => pkg/util}/render.go (100%) rename {util => pkg/util}/retry.go (100%) rename {util => pkg/util}/retry_test.go (100%) rename {util => pkg/util}/volatile_memory.go (100%) diff --git a/cmd/pnl.go b/cmd/pnl.go index 5e530f147..082695354 100644 --- a/cmd/pnl.go +++ b/cmd/pnl.go @@ -11,12 +11,12 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/c9s/bbgo/accounting" - "github.com/c9s/bbgo/bbgo" - "github.com/c9s/bbgo/exchange/binance" - "github.com/c9s/bbgo/exchange/max" - "github.com/c9s/bbgo/service" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/accounting" + "github.com/c9s/bbgo/pkg/bbgo" + "github.com/c9s/bbgo/pkg/exchange/binance" + "github.com/c9s/bbgo/pkg/exchange/max" + "github.com/c9s/bbgo/pkg/service" + "github.com/c9s/bbgo/pkg/types" ) func init() { diff --git a/examples/max-eqmaker/main.go b/examples/max-eqmaker/main.go index 0ac762b5c..bb2fd6fab 100644 --- a/examples/max-eqmaker/main.go +++ b/examples/max-eqmaker/main.go @@ -13,11 +13,11 @@ import ( "github.com/spf13/viper" "github.com/c9s/bbgo/cmd/cmdutil" - "github.com/c9s/bbgo/exchange/max" - maxapi "github.com/c9s/bbgo/exchange/max/maxapi" - "github.com/c9s/bbgo/fixedpoint" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/exchange/max" + maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi" + "github.com/c9s/bbgo/pkg/fixedpoint" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) func init() { diff --git a/examples/max-orders/main.go b/examples/max-orders/main.go index f2da6cd45..7b97ede8c 100644 --- a/examples/max-orders/main.go +++ b/examples/max-orders/main.go @@ -4,7 +4,7 @@ import ( "log" "os" - maxapi "github.com/c9s/bbgo/exchange/max/maxapi" + maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi" ) func main() { diff --git a/accounting/pnl.go b/pkg/accounting/pnl.go similarity index 98% rename from accounting/pnl.go rename to pkg/accounting/pnl.go index a7f9f0292..16b714b18 100644 --- a/accounting/pnl.go +++ b/pkg/accounting/pnl.go @@ -6,7 +6,7 @@ import ( "github.com/sirupsen/logrus" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) type ProfitAndLossCalculator struct { diff --git a/accounting/report.go b/pkg/accounting/report.go similarity index 96% rename from accounting/report.go rename to pkg/accounting/report.go index b02db51d1..a5d4d7424 100644 --- a/accounting/report.go +++ b/pkg/accounting/report.go @@ -7,8 +7,8 @@ import ( "github.com/sirupsen/logrus" "github.com/slack-go/slack" - "github.com/c9s/bbgo/slack/slackstyle" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/slack/slackstyle" + "github.com/c9s/bbgo/pkg/types" ) type ProfitAndLossReport struct { diff --git a/bbgo/account.go b/pkg/bbgo/account.go similarity index 87% rename from bbgo/account.go rename to pkg/bbgo/account.go index c5dbaa2a7..149e82bf3 100644 --- a/bbgo/account.go +++ b/pkg/bbgo/account.go @@ -4,9 +4,9 @@ import ( "context" "sync" - "github.com/c9s/bbgo/exchange/binance" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/exchange/binance" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" log "github.com/sirupsen/logrus" ) diff --git a/bbgo/accounting.go b/pkg/bbgo/accounting.go similarity index 100% rename from bbgo/accounting.go rename to pkg/bbgo/accounting.go diff --git a/bbgo/config/config.go b/pkg/bbgo/config/config.go similarity index 100% rename from bbgo/config/config.go rename to pkg/bbgo/config/config.go diff --git a/bbgo/context.go b/pkg/bbgo/context.go similarity index 86% rename from bbgo/context.go rename to pkg/bbgo/context.go index 56234d743..ffd03c18a 100644 --- a/bbgo/context.go +++ b/pkg/bbgo/context.go @@ -3,8 +3,8 @@ package bbgo import ( "sync" - "github.com/c9s/bbgo/accounting" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/accounting" + "github.com/c9s/bbgo/pkg/types" ) type Context struct { diff --git a/bbgo/indicator.go b/pkg/bbgo/indicator.go similarity index 96% rename from bbgo/indicator.go rename to pkg/bbgo/indicator.go index 6b703b48d..e3e1a1a47 100644 --- a/bbgo/indicator.go +++ b/pkg/bbgo/indicator.go @@ -4,7 +4,7 @@ import ( "math" "time" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) type MovingAverageIndicator struct { diff --git a/bbgo/indicator_test.go b/pkg/bbgo/indicator_test.go similarity index 80% rename from bbgo/indicator_test.go rename to pkg/bbgo/indicator_test.go index d33e2752c..e814d466c 100644 --- a/bbgo/indicator_test.go +++ b/pkg/bbgo/indicator_test.go @@ -3,7 +3,7 @@ package bbgo import ( "testing" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) func TestCalculateMovingAverage(t *testing.T) { diff --git a/bbgo/kline_regression.go b/pkg/bbgo/kline_regression.go similarity index 97% rename from bbgo/kline_regression.go rename to pkg/bbgo/kline_regression.go index feef6a8b7..5dc556a6e 100644 --- a/bbgo/kline_regression.go +++ b/pkg/bbgo/kline_regression.go @@ -6,9 +6,9 @@ import ( "github.com/sirupsen/logrus" - "github.com/c9s/bbgo/accounting" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/accounting" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) type BackTestStream struct { diff --git a/bbgo/market.go b/pkg/bbgo/market.go similarity index 100% rename from bbgo/market.go rename to pkg/bbgo/market.go diff --git a/bbgo/marketdatastore_callbacks.go b/pkg/bbgo/marketdatastore_callbacks.go similarity index 91% rename from bbgo/marketdatastore_callbacks.go rename to pkg/bbgo/marketdatastore_callbacks.go index 6992934b4..bf24b4a90 100644 --- a/bbgo/marketdatastore_callbacks.go +++ b/pkg/bbgo/marketdatastore_callbacks.go @@ -3,7 +3,7 @@ package bbgo import ( - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) func (store *MarketDataStore) OnUpdate(cb KLineCallback) { diff --git a/bbgo/order.go b/pkg/bbgo/order.go similarity index 100% rename from bbgo/order.go rename to pkg/bbgo/order.go diff --git a/bbgo/order_processor.go b/pkg/bbgo/order_processor.go similarity index 98% rename from bbgo/order_processor.go rename to pkg/bbgo/order_processor.go index eedf14b73..e44b34ac6 100644 --- a/bbgo/order_processor.go +++ b/pkg/bbgo/order_processor.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) var ( diff --git a/bbgo/order_processor_test.go b/pkg/bbgo/order_processor_test.go similarity index 100% rename from bbgo/order_processor_test.go rename to pkg/bbgo/order_processor_test.go diff --git a/bbgo/pnl.go b/pkg/bbgo/pnl.go similarity index 100% rename from bbgo/pnl.go rename to pkg/bbgo/pnl.go diff --git a/bbgo/slack.go b/pkg/bbgo/slack.go similarity index 79% rename from bbgo/slack.go rename to pkg/bbgo/slack.go index b399c1cfa..4bf8f829d 100644 --- a/bbgo/slack.go +++ b/pkg/bbgo/slack.go @@ -1,8 +1,8 @@ package bbgo import ( - "github.com/c9s/bbgo/accounting" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/accounting" + "github.com/c9s/bbgo/pkg/types" ) type Notifier interface { diff --git a/bbgo/stock.go b/pkg/bbgo/stock.go similarity index 99% rename from bbgo/stock.go rename to pkg/bbgo/stock.go index 7584d7e41..e9f0cf980 100644 --- a/bbgo/stock.go +++ b/pkg/bbgo/stock.go @@ -8,7 +8,7 @@ import ( "strings" "sync" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) func zero(a float64) bool { diff --git a/bbgo/stock_test.go b/pkg/bbgo/stock_test.go similarity index 99% rename from bbgo/stock_test.go rename to pkg/bbgo/stock_test.go index 0c25a21b2..e15b5ccd9 100644 --- a/bbgo/stock_test.go +++ b/pkg/bbgo/stock_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) func TestStockManager(t *testing.T) { diff --git a/bbgo/store.go b/pkg/bbgo/store.go similarity index 96% rename from bbgo/store.go rename to pkg/bbgo/store.go index dffd4a4fb..9f79c8ca5 100644 --- a/bbgo/store.go +++ b/pkg/bbgo/store.go @@ -1,7 +1,7 @@ package bbgo import ( - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) type Interval string diff --git a/bbgo/testdata/btcusdt-trades.json b/pkg/bbgo/testdata/btcusdt-trades.json similarity index 100% rename from bbgo/testdata/btcusdt-trades.json rename to pkg/bbgo/testdata/btcusdt-trades.json diff --git a/bbgo/trader.go b/pkg/bbgo/trader.go similarity index 98% rename from bbgo/trader.go rename to pkg/bbgo/trader.go index ac67faae6..6536ab2ec 100644 --- a/bbgo/trader.go +++ b/pkg/bbgo/trader.go @@ -10,11 +10,11 @@ import ( "github.com/jmoiron/sqlx" log "github.com/sirupsen/logrus" - "github.com/c9s/bbgo/accounting" - "github.com/c9s/bbgo/bbgo/config" - "github.com/c9s/bbgo/exchange/binance" - "github.com/c9s/bbgo/service" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/accounting" + "github.com/c9s/bbgo/pkg/bbgo/config" + "github.com/c9s/bbgo/pkg/exchange/binance" + "github.com/c9s/bbgo/pkg/service" + "github.com/c9s/bbgo/pkg/types" ) // MarketStrategy represents the single Exchange strategy diff --git a/exchange/binance/depthframe_callbacks.go b/pkg/exchange/binance/depthframe_callbacks.go similarity index 100% rename from exchange/binance/depthframe_callbacks.go rename to pkg/exchange/binance/depthframe_callbacks.go diff --git a/exchange/binance/exchange.go b/pkg/exchange/binance/exchange.go similarity index 99% rename from exchange/binance/exchange.go rename to pkg/exchange/binance/exchange.go index dbb43a1f8..d615dc216 100644 --- a/exchange/binance/exchange.go +++ b/pkg/exchange/binance/exchange.go @@ -10,8 +10,8 @@ import ( "github.com/sirupsen/logrus" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) var log = logrus.WithFields(logrus.Fields{ diff --git a/exchange/binance/parse.go b/pkg/exchange/binance/parse.go similarity index 99% rename from exchange/binance/parse.go rename to pkg/exchange/binance/parse.go index a0c46ec9a..97857cac5 100644 --- a/exchange/binance/parse.go +++ b/pkg/exchange/binance/parse.go @@ -9,9 +9,9 @@ import ( "github.com/adshao/go-binance" "github.com/valyala/fastjson" - "github.com/c9s/bbgo/fixedpoint" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/fixedpoint" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) /* diff --git a/exchange/binance/stream.go b/pkg/exchange/binance/stream.go similarity index 99% rename from exchange/binance/stream.go rename to pkg/exchange/binance/stream.go index ddf693548..23934aefd 100644 --- a/exchange/binance/stream.go +++ b/pkg/exchange/binance/stream.go @@ -7,12 +7,12 @@ import ( "sync" "time" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/util" "github.com/adshao/go-binance" "github.com/gorilla/websocket" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) type StreamRequest struct { diff --git a/exchange/binance/stream_callbacks.go b/pkg/exchange/binance/stream_callbacks.go similarity index 100% rename from exchange/binance/stream_callbacks.go rename to pkg/exchange/binance/stream_callbacks.go diff --git a/exchange/binance/trade.go b/pkg/exchange/binance/trade.go similarity index 100% rename from exchange/binance/trade.go rename to pkg/exchange/binance/trade.go diff --git a/exchange/max/exchange.go b/pkg/exchange/max/exchange.go similarity index 98% rename from exchange/max/exchange.go rename to pkg/exchange/max/exchange.go index 9669805f4..a92fc26c0 100644 --- a/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -10,9 +10,9 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" - maxapi "github.com/c9s/bbgo/exchange/max/maxapi" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) type Exchange struct { diff --git a/exchange/max/maxapi/account.go b/pkg/exchange/max/maxapi/account.go similarity index 100% rename from exchange/max/maxapi/account.go rename to pkg/exchange/max/maxapi/account.go diff --git a/exchange/max/maxapi/auth.go b/pkg/exchange/max/maxapi/auth.go similarity index 100% rename from exchange/max/maxapi/auth.go rename to pkg/exchange/max/maxapi/auth.go diff --git a/exchange/max/maxapi/order.go b/pkg/exchange/max/maxapi/order.go similarity index 100% rename from exchange/max/maxapi/order.go rename to pkg/exchange/max/maxapi/order.go diff --git a/exchange/max/maxapi/public.go b/pkg/exchange/max/maxapi/public.go similarity index 99% rename from exchange/max/maxapi/public.go rename to pkg/exchange/max/maxapi/public.go index 509535ef3..aee5fa6ba 100644 --- a/exchange/max/maxapi/public.go +++ b/pkg/exchange/max/maxapi/public.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "github.com/valyala/fastjson" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) type PublicService struct { diff --git a/exchange/max/maxapi/public_parser.go b/pkg/exchange/max/maxapi/public_parser.go similarity index 98% rename from exchange/max/maxapi/public_parser.go rename to pkg/exchange/max/maxapi/public_parser.go index 6c41bbae0..0eaab22d2 100644 --- a/exchange/max/maxapi/public_parser.go +++ b/pkg/exchange/max/maxapi/public_parser.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" "github.com/valyala/fastjson" - "github.com/c9s/bbgo/fixedpoint" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/fixedpoint" + "github.com/c9s/bbgo/pkg/types" ) var ErrIncorrectBookEntryElementLength = errors.New("incorrect book entry element length") diff --git a/exchange/max/maxapi/restapi.go b/pkg/exchange/max/maxapi/restapi.go similarity index 100% rename from exchange/max/maxapi/restapi.go rename to pkg/exchange/max/maxapi/restapi.go diff --git a/exchange/max/maxapi/trade.go b/pkg/exchange/max/maxapi/trade.go similarity index 100% rename from exchange/max/maxapi/trade.go rename to pkg/exchange/max/maxapi/trade.go diff --git a/exchange/max/maxapi/userdata.go b/pkg/exchange/max/maxapi/userdata.go similarity index 98% rename from exchange/max/maxapi/userdata.go rename to pkg/exchange/max/maxapi/userdata.go index ae055e884..f34ba9287 100644 --- a/exchange/max/maxapi/userdata.go +++ b/pkg/exchange/max/maxapi/userdata.go @@ -4,8 +4,8 @@ import ( "github.com/pkg/errors" "github.com/valyala/fastjson" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) type BaseEvent struct { diff --git a/exchange/max/maxapi/websocket.go b/pkg/exchange/max/maxapi/websocket.go similarity index 100% rename from exchange/max/maxapi/websocket.go rename to pkg/exchange/max/maxapi/websocket.go diff --git a/exchange/max/maxapi/websocketservice_callbacks.go b/pkg/exchange/max/maxapi/websocketservice_callbacks.go similarity index 100% rename from exchange/max/maxapi/websocketservice_callbacks.go rename to pkg/exchange/max/maxapi/websocketservice_callbacks.go diff --git a/exchange/max/stream.go b/pkg/exchange/max/stream.go similarity index 95% rename from exchange/max/stream.go rename to pkg/exchange/max/stream.go index 3cb913d42..9f037fff1 100644 --- a/exchange/max/stream.go +++ b/pkg/exchange/max/stream.go @@ -5,8 +5,8 @@ import ( log "github.com/sirupsen/logrus" - max "github.com/c9s/bbgo/exchange/max/maxapi" - "github.com/c9s/bbgo/types" + max "github.com/c9s/bbgo/pkg/exchange/max/maxapi" + "github.com/c9s/bbgo/pkg/types" ) var logger = log.WithField("exchange", "max") diff --git a/fixedpoint/convert.go b/pkg/fixedpoint/convert.go similarity index 100% rename from fixedpoint/convert.go rename to pkg/fixedpoint/convert.go diff --git a/notifier/slacknotifier/slack.go b/pkg/notifier/slacknotifier/slack.go similarity index 96% rename from notifier/slacknotifier/slack.go rename to pkg/notifier/slacknotifier/slack.go index 0d3853a41..99653faec 100644 --- a/notifier/slacknotifier/slack.go +++ b/pkg/notifier/slacknotifier/slack.go @@ -8,9 +8,9 @@ import ( "github.com/sirupsen/logrus" "github.com/slack-go/slack" - "github.com/c9s/bbgo/accounting" - "github.com/c9s/bbgo/types" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/accounting" + "github.com/c9s/bbgo/pkg/types" + "github.com/c9s/bbgo/pkg/util" ) type SlackAttachmentCreator interface { diff --git a/service/trade.go b/pkg/service/trade.go similarity index 98% rename from service/trade.go rename to pkg/service/trade.go index bb727add8..ff61adab1 100644 --- a/service/trade.go +++ b/pkg/service/trade.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" - "github.com/c9s/bbgo/types" + "github.com/c9s/bbgo/pkg/types" ) type TradeSync struct { diff --git a/sigchan/sigchan.go b/pkg/sigchan/sigchan.go similarity index 100% rename from sigchan/sigchan.go rename to pkg/sigchan/sigchan.go diff --git a/slack/slacklog/logrus_look.go b/pkg/slack/slacklog/logrus_look.go similarity index 100% rename from slack/slacklog/logrus_look.go rename to pkg/slack/slacklog/logrus_look.go diff --git a/slack/slackstyle/style.go.go b/pkg/slack/slackstyle/style.go.go similarity index 100% rename from slack/slackstyle/style.go.go rename to pkg/slack/slackstyle/style.go.go diff --git a/types/account.go b/pkg/types/account.go similarity index 100% rename from types/account.go rename to pkg/types/account.go diff --git a/types/color.go b/pkg/types/color.go similarity index 100% rename from types/color.go rename to pkg/types/color.go diff --git a/types/currencies.go b/pkg/types/currencies.go similarity index 100% rename from types/currencies.go rename to pkg/types/currencies.go diff --git a/types/exchange.go b/pkg/types/exchange.go similarity index 100% rename from types/exchange.go rename to pkg/types/exchange.go diff --git a/types/kline.go b/pkg/types/kline.go similarity index 99% rename from types/kline.go rename to pkg/types/kline.go index 6268aeaf0..cf7f5b982 100644 --- a/types/kline.go +++ b/pkg/types/kline.go @@ -7,7 +7,7 @@ import ( "github.com/slack-go/slack" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/util" ) type KLineOrWindow interface { diff --git a/types/kline_test.go b/pkg/types/kline_test.go similarity index 100% rename from types/kline_test.go rename to pkg/types/kline_test.go diff --git a/types/market.go b/pkg/types/market.go similarity index 100% rename from types/market.go rename to pkg/types/market.go diff --git a/types/order.go b/pkg/types/order.go similarity index 100% rename from types/order.go rename to pkg/types/order.go diff --git a/types/orderbook.go b/pkg/types/orderbook.go similarity index 98% rename from types/orderbook.go rename to pkg/types/orderbook.go index 708247cc8..e20f80176 100644 --- a/types/orderbook.go +++ b/pkg/types/orderbook.go @@ -5,8 +5,8 @@ import ( "sort" "sync" - "github.com/c9s/bbgo/fixedpoint" - "github.com/c9s/bbgo/sigchan" + "github.com/c9s/bbgo/pkg/fixedpoint" + "github.com/c9s/bbgo/pkg/sigchan" ) type PriceVolume struct { diff --git a/types/orderbook_callbacks.go b/pkg/types/orderbook_callbacks.go similarity index 100% rename from types/orderbook_callbacks.go rename to pkg/types/orderbook_callbacks.go diff --git a/types/side.go b/pkg/types/side.go similarity index 100% rename from types/side.go rename to pkg/types/side.go diff --git a/types/standardstream_callbacks.go b/pkg/types/standardstream_callbacks.go similarity index 100% rename from types/standardstream_callbacks.go rename to pkg/types/standardstream_callbacks.go diff --git a/types/stream.go b/pkg/types/stream.go similarity index 100% rename from types/stream.go rename to pkg/types/stream.go diff --git a/types/trade.go b/pkg/types/trade.go similarity index 98% rename from types/trade.go rename to pkg/types/trade.go index e8633d64f..7637dbccf 100644 --- a/types/trade.go +++ b/pkg/types/trade.go @@ -6,7 +6,7 @@ import ( "github.com/slack-go/slack" - "github.com/c9s/bbgo/util" + "github.com/c9s/bbgo/pkg/util" ) type Trade struct { diff --git a/types/trader.go b/pkg/types/trader.go similarity index 100% rename from types/trader.go rename to pkg/types/trader.go diff --git a/util/math.go b/pkg/util/math.go similarity index 100% rename from util/math.go rename to pkg/util/math.go diff --git a/util/math_test.go b/pkg/util/math_test.go similarity index 100% rename from util/math_test.go rename to pkg/util/math_test.go diff --git a/util/rate_limit.go b/pkg/util/rate_limit.go similarity index 100% rename from util/rate_limit.go rename to pkg/util/rate_limit.go diff --git a/util/rate_limit_test.go b/pkg/util/rate_limit_test.go similarity index 100% rename from util/rate_limit_test.go rename to pkg/util/rate_limit_test.go diff --git a/util/render.go b/pkg/util/render.go similarity index 100% rename from util/render.go rename to pkg/util/render.go diff --git a/util/retry.go b/pkg/util/retry.go similarity index 100% rename from util/retry.go rename to pkg/util/retry.go diff --git a/util/retry_test.go b/pkg/util/retry_test.go similarity index 100% rename from util/retry_test.go rename to pkg/util/retry_test.go diff --git a/util/volatile_memory.go b/pkg/util/volatile_memory.go similarity index 100% rename from util/volatile_memory.go rename to pkg/util/volatile_memory.go