kline

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Start     int64  `json:"start"`
	End       int64  `json:"end"`
	Interval  string `json:"interval"`
	Open      string `json:"open"`
	Close     string `json:"close"`
	High      string `json:"high"`
	Low       string `json:"low"`
	Volume    string `json:"volume"`
	Turnover  string `json:"turnover"`
	Confirm   bool   `json:"confirm"`
	Timestamp int64  `json:"timestamp"`
}

type Kline

type Kline interface {
	SetClient(client *client.Client) error
	Subscribe(symbols []string, interval string, callback func(response Data)) error
	Unsubscribe(topics ...string) error
	Receive() (int, []byte, error)
	Close()
	GetMessagesChan() <-chan []byte
	Stop()
}

Kline represents the interface for the kline functionality.

func New

func New(c *client.Client) (Kline, error)

New creates a new instance of KlineImpl

type Response added in v0.1.8

type Response struct {
	Topic string `json:"topic"`
	Type  string `json:"type"`
	Data  []Data `json:"data"`
	Ts    int64  `json:"ts"`
}

Jump to

Keyboard shortcuts

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