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 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 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 Dial ¶
func Dial(option *WebSocketClientOption) (*WebSocketClient, error)
Dial is a function used to create a new websocket client.
func DialWithContext ¶
func DialWithContext(ctx context.Context, option *WebSocketClientOption) (*WebSocketClient, error)
DialWithContext is a function used to create a new websocket client.
func (*WebSocketClient) Auth ¶
func (c *WebSocketClient) Auth() error
Auth sends an authentication message to the Fugle API.
func (*WebSocketClient) AuthWithKey ¶
func (c *WebSocketClient) AuthWithKey(key string) error
AuthWithKey sends an authentication message to the Fugle API.
func (*WebSocketClient) ReadMessage ¶
func (c *WebSocketClient) ReadMessage() (ch chan IEvent, err error)
ReadMessage reads a message from the Fugle API.
type WebSocketClientOption ¶
type WebSocketClientOption struct { Endpoint string `json:"endpoint"` APIKey string `json:"apiKey"` }
WebSocketClientOption is a struct that represents the websocket client option.