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