websocket

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWebsocketUrl        = "wss://www.avanza.se/_push/cometd"
	PingChannel                = "/meta/connect"
	QuotesSubscriptionPath     = "/quotes/%s"
	OrderDepthSubscriptionPath = "/orderdepths/%s"
	PositionsSubscriptionPath  = "/positions/%s"
	OrdersSubscriptionPath     = "/orders/%s"
	TradesSubscriptionPath     = "/trades/%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanStreamOrderDepth

type ChanStreamOrderDepth chan models.StreamOrderDepth

type ChanStreamOrders

type ChanStreamOrders chan models.StreamOrders

type ChanStreamPositions

type ChanStreamPositions chan models.StreamPositions

type ChanStreamQuotes

type ChanStreamQuotes chan models.StreamQuote

type ChanStreamTrades

type ChanStreamTrades chan models.StreamTrades

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn defines a connection to a WebSocket server.

func (*Conn) Close

func (c *Conn) Close()

func (*Conn) Collect

func (c *Conn) Collect(data chan []byte)

type WebsocketClient

type WebsocketClient struct {
	*client.Client
	Dialer *websocket.Dialer
	// contains filtered or unexported fields
}

func (*WebsocketClient) Connect

func (w *WebsocketClient) Connect(params string) (*Conn, error)

func (*WebsocketClient) StreamOrderDepth

func (w *WebsocketClient) StreamOrderDepth(ctx context.Context, params string) (*Conn, ChanStreamOrderDepth, error)

func (*WebsocketClient) StreamOrders

func (w *WebsocketClient) StreamOrders(ctx context.Context, params string) (*Conn, ChanStreamOrders, error)

func (*WebsocketClient) StreamPositions

func (w *WebsocketClient) StreamPositions(ctx context.Context, params string) (*Conn, ChanStreamPositions, error)

func (*WebsocketClient) StreamQuotes

func (w *WebsocketClient) StreamQuotes(ctx context.Context, params string) (*Conn, ChanStreamQuotes, error)

func (*WebsocketClient) StreamTrades

func (w *WebsocketClient) StreamTrades(ctx context.Context, params string) (*Conn, ChanStreamTrades, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL