fugle_marketdata

package module
v0.0.0-...-730f7f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: MIT Imports: 6 Imported by: 0

README

fugle-marketdata-go

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.

func (*AuthEvent) GetEvent

func (e *AuthEvent) GetEvent() string

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

func UnmarshalEvent(data []byte) (IEvent, error)

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

type RestClientOption struct {
	Endpoint string `json:"endpoint"`
	APIKey   string `json:"apiKey"`
}

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

type WebSocketClient struct {
	Conn *websocket.Conn
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL