Documentation
¶
Index ¶
Constants ¶
const ConnectionSetupMessagesErrorContext = "Sending connection setup messages"
ConnectionSetupMessagesErrorContext ...
const DecodeFirstMessageErrorContext = "Decoding the first message after stablishing the connection"
DecodeFirstMessageErrorContext ...
const DecodeMessageErrorContext = "Decoding the JSON message"
DecodeMessageErrorContext ...
const DecodedMessageDoesNotIncludePayloadErrorContext = "JSON message does not include the payload"
DecodedMessageDoesNotIncludePayloadErrorContext ...
const DecodedMessageHasErrorPropertyErrorContext = "JSON message has an error message"
DecodedMessageHasErrorPropertyErrorContext ...
const FinalPayloadCantBeParsedErrorContext = "The final JSON payload of the socket message couldn't be parsed"
FinalPayloadCantBeParsedErrorContext ...
const FinalPayloadHasMissingPropertiesErrorContext = "The final JSON payload doesn't have the expected data"
FinalPayloadHasMissingPropertiesErrorContext ...
const FirstMessageWithoutSessionIdErrorContext = "Does not have 'session_id' property"
FirstMessageWithoutSessionIdErrorContext ...
const GetPayloadLengthErrorContext = "Getting the payload length"
GetPayloadLengthErrorContext ...
const InitErrorContext = "Initializing the connection"
InitErrorContext ...
const PayloadCantBeParsedErrorContext = "JSON payload couldn't be parsed"
PayloadCantBeParsedErrorContext ...
const ReadFirstMessageErrorContext = "Reading the first message after stablishing the connection"
ReadFirstMessageErrorContext
const ReadMessageErrorContext = "Error while reading new messages through the socket connection"
ReadMessageErrorContext ...
const SendKeepAliveMessageErrorContext = "Sending the keep alive message"
SendKeepAliveMessageErrorContext ...
const SendMessageErrorContext = "Sending a message"
SendMessageErrorContext ...
Variables ¶
This section is empty.
Functions ¶
func GetStringRepresentation ¶
func GetStringRepresentation(data interface{}) string
GetStringRepresentation ...
Types ¶
type OnReceiveDataCallback ¶
OnReceiveDataCallback ...
type QuoteData ¶
type QuoteData struct {
Price *float64 `mapstructure:"lp"`
Volume *float64 `mapstructure:"volume"`
Bid *float64 `mapstructure:"bid"`
Ask *float64 `mapstructure:"ask"`
High *float64 `mapstructure:"high_price"`
Low *float64 `mapstructure:"low_price"`
Open *float64 `mapstructure:"open_price"`
PreviousClose *float64 `mapstructure:"prev_close_price"`
}
QuoteData ...
type QuoteMessage ¶
type QuoteMessage struct {
Symbol string `mapstructure:"n"`
Status string `mapstructure:"s"`
Data *QuoteData `mapstructure:"v"`
}
QuoteMessage ...
type Socket ¶
type Socket struct {
OnReceiveMarketDataCallback OnReceiveDataCallback
OnErrorCallback OnErrorCallback
// contains filtered or unexported fields
}
Socket ...
func (*Socket) RemoveSymbol ¶
RemoveSymbol ...
type SocketInterface ¶
type SocketInterface interface {
AddSymbol(symbol string) error
RemoveSymbol(symbol string) error
Init() error
Close() error
}
SocketInterface ...
func Connect ¶
func Connect( onReceiveMarketDataCallback OnReceiveDataCallback, onErrorCallback OnErrorCallback, ) (socket SocketInterface, err error)
Connect - Connects and returns the trading view socket object
type SocketMessage ¶
type SocketMessage struct {
Message string `json:"m"`
Payload interface{} `json:"p"`
}
SocketMessage ...