diff --git a/message.go b/gdax/message.go similarity index 98% rename from message.go rename to gdax/message.go index 86f6922..f441ef0 100644 --- a/message.go +++ b/gdax/message.go @@ -1,4 +1,4 @@ -package tacitus +package gdax import ( "github.com/shopspring/decimal" diff --git a/request.go b/gdax/request.go similarity index 96% rename from request.go rename to gdax/request.go index 890ae81..579ca93 100644 --- a/request.go +++ b/gdax/request.go @@ -1,4 +1,4 @@ -package tacitus +package gdax const Subscribe = RequestType("subscribe") const Unsubscribe = RequestType("unsubscribe") diff --git a/websocket/client.go b/websocket/client.go index 1ed545e..2869001 100644 --- a/websocket/client.go +++ b/websocket/client.go @@ -1,7 +1,7 @@ package websocket import ( - "github.com/kcotugno/tacitus" + "github.com/kcotugno/tacitus/gdax" "github.com/gorilla/websocket" ) @@ -9,9 +9,9 @@ import ( const ENDPOINT = "wss://ws-feed.gdax.com" type Client struct { - msgs chan tacitus.Message + msgs chan gdax.Message err chan error - writer chan tacitus.Request + writer chan gdax.Request conn *websocket.Conn connected bool @@ -20,9 +20,9 @@ type Client struct { func NewClient() *Client { c := Client{} - c.msgs = make(chan tacitus.Message, 1024) + c.msgs = make(chan gdax.Message, 1024) c.err = make(chan error) - c.writer = make(chan tacitus.Request) + c.writer = make(chan gdax.Request) c.close = make(chan bool) return &c @@ -42,7 +42,7 @@ func (c *Client) Open() error { select { case <- c.close: default: - var msg tacitus.Message + var msg gdax.Message err := c.conn.ReadJSON(&msg) if err != nil { @@ -78,13 +78,13 @@ func (c *Client) Close() { c.conn.Close() } -func (c *Client) Send(msg tacitus.Request) { +func (c *Client) Send(msg gdax.Request) { if c.connected { c.writer <- msg } } -func (c *Client) MessageStream() <- chan tacitus.Message { +func (c *Client) MessageStream() <- chan gdax.Message { return c.msgs }