Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthEvent ¶
type AuthEvent struct { Event string `json:"event"` Data struct { Message string `json:"message"` } `json:"data"` }
AuthEvent is a struct that represents the auth event response.
type ErrorEvent ¶
type ErrorEvent struct { Event string `json:"event"` Data struct { Message string `json:"message"` } `json:"data"` }
ErrorEvent is a struct that represents the error event response.
func (*ErrorEvent) GetEvent ¶
func (e *ErrorEvent) GetEvent() string
type ErrorHandler ¶
type ErrorHandler func(error)
ErrorHandler is a function type that represents the error handler.
type IEvent ¶
type IEvent interface { // GetEvent is a function used to get the event. GetEvent() string }
IEvent is an interface that represents the event.
func UnmarshalEvent ¶
UnmarshalEvent is a function used to unmarshal the event.
type MessageHandler ¶
type MessageHandler func(string)
MessageHandler is a function type that represents the message handler.
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
RestClient is a struct that represents the rest client.
func NewRestClient ¶
func NewRestClient(option *RestClientOption) (*RestClient, error)
NewRestClient is a function used to create a new rest client.
type RestClientOption ¶
RestClientOption is a struct that represents the rest client option.
type UnknownEvent ¶
type UnknownEvent struct { Event string `json:"event"` Data json.RawMessage `json:"data"` }
UnknownEvent is a struct that represents the unknown event.
func (*UnknownEvent) GetEvent ¶
func (e *UnknownEvent) GetEvent() string
type WebSocketClient ¶
WebSocketClient is a struct that represents the websocket client.
func NewWebSocketClient ¶
func NewWebSocketClient(option WebSocketClientOption) (*WebSocketClient, error)
NewWebSocketClient is a function used to create a new websocket client.
func (*WebSocketClient) Close ¶
func (client *WebSocketClient) Close() error
Close is a function used to close the websocket connection.
func (*WebSocketClient) Connect ¶
func (client *WebSocketClient) Connect() error
Connect is a function used to connect to the websocket server.
func (*WebSocketClient) IsConnected ¶
func (client *WebSocketClient) IsConnected() bool
IsConnected is a function used to check if the websocket client is connected.
func (*WebSocketClient) OnError ¶
func (client *WebSocketClient) OnError(handler ErrorHandler)
OnError is a function used to set the error handler.
func (*WebSocketClient) OnMessage ¶
func (client *WebSocketClient) OnMessage(handler MessageHandler)
OnMessage is a function used to set the message handler.
type WebSocketClientOption ¶
type WebSocketClientOption struct { Endpoint string `json:"endpoint"` APIKey string `json:"apiKey"` }
WebSocketClientOption is a struct that represents the websocket client option.