소스 검색

MarketConnection

Alexey Kim 6 달 전
부모
커밋
e6f6703e32
2개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      market.go
  2. 10 0
      market_connection.go

+ 1 - 2
market.go

@@ -3,9 +3,8 @@ package sentio
 import "context"
 
 type Market interface {
-	Connect(done chan struct{}) (chan int, error)
+	Connect(done chan struct{}) (chan MarketConnection, error)
 	Subscribe(symbol string) error
-
 	IsMarketOpened() bool
 
 	Buy(ctx context.Context, symbol string, amount float64) (Order, error)

+ 10 - 0
market_connection.go

@@ -0,0 +1,10 @@
+package sentio
+
+type MarketConnection int
+
+const (
+	SubscriptionGracefulStop MarketConnection = iota
+	SubscriptionConnectionError
+	SubscriptionUnexpectedError
+	SubscriptionAuthenticated
+)