Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusConnected = "connected" StatusAuthSuccess = "auth_success" StatusAuthRequired = "auth_required" StatusSuccess = "success" StatusError = "error" )
View Source
const ( WsUrl = "wss://socket.polygon.io/forex" MaxWsFrameSize = 1024 * 1024 * 4 // 4mb )
Variables ¶
View Source
var ( ErrNilHandler = errors.New("nil handler") ErrFrameTooBig = errors.New("frame too big") )
Functions ¶
This section is empty.
Types ¶
type StatusCodeError ¶
type StatusCodeError struct {
Code int
}
func (StatusCodeError) Error ¶
func (s StatusCodeError) Error() string
type WS ¶
type WS struct {
// contains filtered or unexported fields
}
func (*WS) SubscribeAggregates ¶
func (ws *WS) SubscribeAggregates(ticker string, handler WsAggregateHandler) (*WsAggregateSubscription, error)
func (*WS) SubscribeQuotes ¶
func (ws *WS) SubscribeQuotes(ticker string, handler WsQuoteHandler) (*WsQuoteSubscription, error)
type WsAggregate ¶
type WsAggregate struct { Open float64 `json:"o"` // The open price for this aggregate window. High float64 `json:"h"` // The high price for this aggregate window. Low float64 `json:"l"` // The low price for this aggregate window. Close float64 `json:"ws"` // The close price for this aggregate window. Volume int64 `json:"v"` // The volume of trades during this aggregate window. Start int64 `json:"s"` // The start time for this aggregate window in Unix Milliseconds. End int64 `json:"e"` // The end time for this aggregate window in Unix Milliseconds. }
type WsAggregateHandler ¶
type WsAggregateHandler func(q WsAggregate)
type WsAggregateSubscription ¶
type WsAggregateSubscription struct {
// contains filtered or unexported fields
}
func (*WsAggregateSubscription) Name ¶
func (s *WsAggregateSubscription) Name() string
func (*WsAggregateSubscription) Unsubscribe ¶
func (s *WsAggregateSubscription) Unsubscribe()
type WsQuoteHandler ¶
type WsQuoteHandler func(q WsQuote)
type WsQuoteSubscription ¶
type WsQuoteSubscription struct {
// contains filtered or unexported fields
}
func (*WsQuoteSubscription) Name ¶
func (s *WsQuoteSubscription) Name() string
func (*WsQuoteSubscription) Unsubscribe ¶
func (s *WsQuoteSubscription) Unsubscribe()
Click to show internal directories.
Click to hide internal directories.