Documentation ¶
Index ¶
- Constants
- type AccountUpdateTopicParam
- type AccountWsClient
- func (m *AccountWsClient) AddListener(event string, listener Listener) *emission.Emitter
- func (m *AccountWsClient) Close() error
- func (m *AccountWsClient) GetAccountUpdateTopic(params *AccountUpdateTopicParam) (string, error)
- func (m *AccountWsClient) GetListeners(event string, argument any) *emission.Emitter
- func (m *AccountWsClient) IsConnected() bool
- func (m *AccountWsClient) Open() error
- func (m *AccountWsClient) RemoveListener(event string, listener Listener) *emission.Emitter
- func (m *AccountWsClient) Subscribe(topic string) error
- func (m *AccountWsClient) UnSubscribe(topic string) error
- type AccountWsClientCfg
- type ActionType
- type AuthParams
- type AuthRequest
- type Listener
- type Message
Constants ¶
View Source
const ( GlobalWsBaseURL = "wss://api.huobi.pro/ws/v2" GlobalWsBaseURLForAWS = "wss://api-aws.huobi.pro/ws/v2" )
View Source
const (
MaxTryTimes = 5
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountUpdateTopicParam ¶
type AccountUpdateTopicParam struct {
Mode int `validate:"required,oneof=0 1 2"`
}
type AccountWsClient ¶
type AccountWsClient struct {
// contains filtered or unexported fields
}
func NewAccountWsClient ¶
func NewAccountWsClient(cfg *AccountWsClientCfg) (*AccountWsClient, error)
func (*AccountWsClient) AddListener ¶
func (m *AccountWsClient) AddListener(event string, listener Listener) *emission.Emitter
func (*AccountWsClient) Close ¶
func (m *AccountWsClient) Close() error
func (*AccountWsClient) GetAccountUpdateTopic ¶
func (m *AccountWsClient) GetAccountUpdateTopic(params *AccountUpdateTopicParam) (string, error)
func (*AccountWsClient) GetListeners ¶
func (m *AccountWsClient) GetListeners(event string, argument any) *emission.Emitter
func (*AccountWsClient) IsConnected ¶
func (m *AccountWsClient) IsConnected() bool
IsConnected returns the WebSocket connection state
func (*AccountWsClient) Open ¶
func (m *AccountWsClient) Open() error
func (*AccountWsClient) RemoveListener ¶
func (m *AccountWsClient) RemoveListener(event string, listener Listener) *emission.Emitter
func (*AccountWsClient) Subscribe ¶
func (m *AccountWsClient) Subscribe(topic string) error
func (*AccountWsClient) UnSubscribe ¶
func (m *AccountWsClient) UnSubscribe(topic string) error
type AccountWsClientCfg ¶
type ActionType ¶
type ActionType = string
const ( SUB ActionType = "sub" UNSUB ActionType = "unsub" REQ ActionType = "req" PING ActionType = "ping" PONG ActionType = "pong" PUSH ActionType = "push" )
type AuthParams ¶
type AuthParams struct { AuthType string `json:"authType,omitempty"` AccessKey string `json:"accessKey,omitempty"` SignatureMethod string `json:"signatureMethod,omitempty"` SignatureVersion string `json:"signatureVersion,omitempty"` Timestamp string `json:"timestamp,omitempty"` Signature string `json:"signature,omitempty"` }
type AuthRequest ¶
type AuthRequest struct { Action ActionType `json:"action,omitempty"` Channel string `json:"ch,omitempty"` Params AuthParams `json:"params,omitempty"` }
type Message ¶
type Message struct { Action ActionType `json:"action,omitempty"` Channel string `json:"ch,omitempty"` Code int `json:"code,omitempty"` Data json.RawMessage `json:"data,omitempty"` }
func (*Message) UnmarshalJSON ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.