move files into pkg

This commit is contained in:
c9s 2020-10-11 16:46:15 +08:00
parent 5a3c043b43
commit 3d5507a053
71 changed files with 63 additions and 63 deletions

View File

@ -11,12 +11,12 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
"github.com/c9s/bbgo/accounting" "github.com/c9s/bbgo/pkg/accounting"
"github.com/c9s/bbgo/bbgo" "github.com/c9s/bbgo/pkg/bbgo"
"github.com/c9s/bbgo/exchange/binance" "github.com/c9s/bbgo/pkg/exchange/binance"
"github.com/c9s/bbgo/exchange/max" "github.com/c9s/bbgo/pkg/exchange/max"
"github.com/c9s/bbgo/service" "github.com/c9s/bbgo/pkg/service"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
func init() { func init() {

View File

@ -13,11 +13,11 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
"github.com/c9s/bbgo/cmd/cmdutil" "github.com/c9s/bbgo/cmd/cmdutil"
"github.com/c9s/bbgo/exchange/max" "github.com/c9s/bbgo/pkg/exchange/max"
maxapi "github.com/c9s/bbgo/exchange/max/maxapi" maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi"
"github.com/c9s/bbgo/fixedpoint" "github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
func init() { func init() {

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"os" "os"
maxapi "github.com/c9s/bbgo/exchange/max/maxapi" maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi"
) )
func main() { func main() {

View File

@ -6,7 +6,7 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type ProfitAndLossCalculator struct { type ProfitAndLossCalculator struct {

View File

@ -7,8 +7,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/slack-go/slack" "github.com/slack-go/slack"
"github.com/c9s/bbgo/slack/slackstyle" "github.com/c9s/bbgo/pkg/slack/slackstyle"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type ProfitAndLossReport struct { type ProfitAndLossReport struct {

View File

@ -4,9 +4,9 @@ import (
"context" "context"
"sync" "sync"
"github.com/c9s/bbgo/exchange/binance" "github.com/c9s/bbgo/pkg/exchange/binance"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )

View File

@ -3,8 +3,8 @@ package bbgo
import ( import (
"sync" "sync"
"github.com/c9s/bbgo/accounting" "github.com/c9s/bbgo/pkg/accounting"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type Context struct { type Context struct {

View File

@ -4,7 +4,7 @@ import (
"math" "math"
"time" "time"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type MovingAverageIndicator struct { type MovingAverageIndicator struct {

View File

@ -3,7 +3,7 @@ package bbgo
import ( import (
"testing" "testing"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
func TestCalculateMovingAverage(t *testing.T) { func TestCalculateMovingAverage(t *testing.T) {

View File

@ -6,9 +6,9 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/accounting" "github.com/c9s/bbgo/pkg/accounting"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
type BackTestStream struct { type BackTestStream struct {

View File

@ -3,7 +3,7 @@
package bbgo package bbgo
import ( import (
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
func (store *MarketDataStore) OnUpdate(cb KLineCallback) { func (store *MarketDataStore) OnUpdate(cb KLineCallback) {

View File

@ -7,8 +7,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
var ( var (

View File

@ -1,8 +1,8 @@
package bbgo package bbgo
import ( import (
"github.com/c9s/bbgo/accounting" "github.com/c9s/bbgo/pkg/accounting"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type Notifier interface { type Notifier interface {

View File

@ -8,7 +8,7 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
func zero(a float64) bool { func zero(a float64) bool {

View File

@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
func TestStockManager(t *testing.T) { func TestStockManager(t *testing.T) {

View File

@ -1,7 +1,7 @@
package bbgo package bbgo
import ( import (
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type Interval string type Interval string

View File

@ -10,11 +10,11 @@ import (
"github.com/jmoiron/sqlx" "github.com/jmoiron/sqlx"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/accounting" "github.com/c9s/bbgo/pkg/accounting"
"github.com/c9s/bbgo/bbgo/config" "github.com/c9s/bbgo/pkg/bbgo/config"
"github.com/c9s/bbgo/exchange/binance" "github.com/c9s/bbgo/pkg/exchange/binance"
"github.com/c9s/bbgo/service" "github.com/c9s/bbgo/pkg/service"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
// MarketStrategy represents the single Exchange strategy // MarketStrategy represents the single Exchange strategy

View File

@ -10,8 +10,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
var log = logrus.WithFields(logrus.Fields{ var log = logrus.WithFields(logrus.Fields{

View File

@ -9,9 +9,9 @@ import (
"github.com/adshao/go-binance" "github.com/adshao/go-binance"
"github.com/valyala/fastjson" "github.com/valyala/fastjson"
"github.com/c9s/bbgo/fixedpoint" "github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
/* /*

View File

@ -7,12 +7,12 @@ import (
"sync" "sync"
"time" "time"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
"github.com/adshao/go-binance" "github.com/adshao/go-binance"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type StreamRequest struct { type StreamRequest struct {

View File

@ -10,9 +10,9 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
maxapi "github.com/c9s/bbgo/exchange/max/maxapi" maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
type Exchange struct { type Exchange struct {

View File

@ -11,7 +11,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/valyala/fastjson" "github.com/valyala/fastjson"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type PublicService struct { type PublicService struct {

View File

@ -7,8 +7,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/valyala/fastjson" "github.com/valyala/fastjson"
"github.com/c9s/bbgo/fixedpoint" "github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
var ErrIncorrectBookEntryElementLength = errors.New("incorrect book entry element length") var ErrIncorrectBookEntryElementLength = errors.New("incorrect book entry element length")

View File

@ -4,8 +4,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/valyala/fastjson" "github.com/valyala/fastjson"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
type BaseEvent struct { type BaseEvent struct {

View File

@ -5,8 +5,8 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
max "github.com/c9s/bbgo/exchange/max/maxapi" max "github.com/c9s/bbgo/pkg/exchange/max/maxapi"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
var logger = log.WithField("exchange", "max") var logger = log.WithField("exchange", "max")

View File

@ -8,9 +8,9 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/slack-go/slack" "github.com/slack-go/slack"
"github.com/c9s/bbgo/accounting" "github.com/c9s/bbgo/pkg/accounting"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
type SlackAttachmentCreator interface { type SlackAttachmentCreator interface {

View File

@ -8,7 +8,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/types" "github.com/c9s/bbgo/pkg/types"
) )
type TradeSync struct { type TradeSync struct {

View File

@ -7,7 +7,7 @@ import (
"github.com/slack-go/slack" "github.com/slack-go/slack"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
type KLineOrWindow interface { type KLineOrWindow interface {

View File

@ -5,8 +5,8 @@ import (
"sort" "sort"
"sync" "sync"
"github.com/c9s/bbgo/fixedpoint" "github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/sigchan" "github.com/c9s/bbgo/pkg/sigchan"
) )
type PriceVolume struct { type PriceVolume struct {

View File

@ -6,7 +6,7 @@ import (
"github.com/slack-go/slack" "github.com/slack-go/slack"
"github.com/c9s/bbgo/util" "github.com/c9s/bbgo/pkg/util"
) )
type Trade struct { type Trade struct {