Documentation ¶
Index ¶
Constants ¶
View Source
const (
TunnelSubscribe string = "subscribe"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver connexion
func (*Receiver) Close ¶
func (r *Receiver) Close()
Close shuts down the websocket connection tunnel and logs any close error.
type Tunnel ¶
type Tunnel interface { //Subscribe sends a subscribe request to the coinbase channel's websocket, using trading pairs (productIDs). Subscribe(tradingPairs []string) error // Read receives data points from the coinbase and passes them to the receiver channel. Read(ctx context.Context, receiver chan *models.CoinbaseResponse) // Close closes the websocket connection. Close() }
Tunnel is a coinbase websocket stream client to receive data from coinbase websocket server
func NewReceiver ¶
NewReceiver initializes a new coinbase Tunnel object and dials the coinbase websocket. It takes a coinbase ws urr, If a connection cannot be reached it returns an error. NewReceiver returns a new websocket client Tunnel.
Click to show internal directories.
Click to hide internal directories.