Revert "Move gdax message/request to new package"
This reverts commit ee3a0adf74b6861f040944abfc5e6087e4b6436f.
This commit is contained in:
parent
144ba33b48
commit
f7f51884b5
@ -1,4 +1,4 @@
|
||||
package gdax
|
||||
package tacitus
|
||||
|
||||
import (
|
||||
"github.com/shopspring/decimal"
|
@ -1,4 +1,4 @@
|
||||
package gdax
|
||||
package tacitus
|
||||
|
||||
const Subscribe = RequestType("subscribe")
|
||||
const Unsubscribe = RequestType("unsubscribe")
|
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user