fugle_marketdata

package module
v0.0.0-...-20c321e Latest Latest
Warning

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

Go to latest
Published: Apr 21, 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 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 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 Dial

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.

Jump to

Keyboard shortcuts

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