Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultCoinbaseRateFeedWebsocketURL – WebSocket scheme/host/port of Coinbase rate feed to connect to DefaultCoinbaseRateFeedWebsocketURL = "wss://ws-feed.exchange.coinbase.com" // DefaultCoinbaseRateFeedChannel – default channel with transactions DefaultCoinbaseRateFeedChannel = "matches" // TypeSubscribe – request type for subscribing TypeSubscribe = "subscribe" // TypeUnsubscribe – request type for unsubscribing TypeUnsubscribe = "unsubscribe" )
Variables ¶
View Source
var ( // CommandTimeout – maximum timeout for waiting for the command response CommandTimeout = 500 * time.Millisecond // ErrBadConfiguration – wrong configuration of service ErrBadConfiguration = errors.New("bad configuration") // ErrBadJSON – could not parse JSON from Coinbase rate feed WebSocket ErrBadJSON = errors.New("could not parse JSON") // ErrFailedToDeserialize – failed to deserialize data from JSON to corresponding entity ErrFailedToDeserialize = errors.New("failed to deserialize") // ErrUnsupportedMessageType – received message of unknown type ErrUnsupportedMessageType = errors.New("skipping unsupported message with unknown type") )
View Source
var ( // ErrWSCanceled – connection cancelled ErrWSCanceled = errors.New("cancelled") // ErrWSOutputChannelClosed – trying to send message to the closed output channel ErrWSOutputChannelClosed = errors.New("output channel closed") // ErrWSControlChannelClosed – trying to send message to the closed control channel ErrWSControlChannelClosed = errors.New("control channel closed") )
Functions ¶
This section is empty.
Types ¶
type CoinbaseRateFeedInterface ¶
type CoinbaseRateFeedInterface interface { RegisterMatchConsumer(consumer consumers.Consumer) Run() Stop() }
CoinbaseRateFeedInterface – interface of Coinbase rate feed client
func NewCoinbaseRateFeed ¶
func NewCoinbaseRateFeed(logger *log.Logger, wg *sync.WaitGroup, config *entity.Config) (CoinbaseRateFeedInterface, error)
NewCoinbaseRateFeed – create WebSocket client for Coinbase rate feed
type WSCommand ¶
type WSCommand byte
WSCommand – type for sending commands
type WSMachine ¶
type WSMachine struct {
// contains filtered or unexported fields
}
WSMachine – WebSocket state machine structure
func NewWebSocket ¶
NewWebSocket – constructor of WebSocket state machine
type WSState ¶
type WSState byte
WSState – type for holding states
Click to show internal directories.
Click to hide internal directories.