@@ -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)
@@ -0,0 +1,10 @@
+package sentio
+
+type MarketConnection int
+const (
+ SubscriptionGracefulStop MarketConnection = iota
+ SubscriptionConnectionError
+ SubscriptionUnexpectedError
+ SubscriptionAuthenticated
+)