realtime

package
v0.0.0-...-dc0a48c Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeartbeatIntervalSecond time.Duration = 25
	ReadTimeoutSecond       time.Duration = 300
	WriteTimeoutSecond      time.Duration = 5
)
View Source
const (
	// Channel prefix
	ChTicker       = "ticker_"
	ChDepth        = "depth_"
	ChTransactions = "transactions_"
	ChCandlestick  = "candlestick_"

	// Channel depth all or diff
	DepthAll  = "whole_"
	DepthDiff = "diff_"

	// Pairs btc_jpy, xrp_jpy, ltc_btc, eth_btc, mona_jpy, mona_btc, bcc_jpy, bcc_btc
	BTCJPY  = "btc_jpy"
	XRPJPY  = "xrp_jpy"
	LTCJPY  = "ltc_jpy"
	BCCJPY  = "bcc_jpy"
	ADAJPY  = "ada_jpy"
	LINKJPY = "link_jpy"
	MATCJPY = "matic_jpy"
	MNAJPY  = "mona_jpy"

	ETHBTC  = "eth_btc"
	XRPBTC  = "xrp_btc"
	LTCBTC  = "ltc_btc"
	BCCBTC  = "bcc_btc"
	LINKBTC = "link_btc"
	MATCBTC = "matic_btc"
	MNABTC  = "mona_btc"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// old↓
	// Subscriber chan interface{}
	// New↓
	Subscriber chan Recive
	Done       chan error
	// contains filtered or unexported fields
}

func Connect

func Connect(isPublic bool) (*Client, error)

func (*Client) Close

func (p *Client) Close() error

func (*Client) Ping

func (ws *Client) Ping() error

func (*Client) Realtime

func (p *Client) Realtime(chs, pairs []string)

func (*Client) SetSubscribes

func (ws *Client) SetSubscribes(chs, pairs []string) error

SetSubscribes sets to ws write

func (*Client) SubscribeDiffDepth

func (ws *Client) SubscribeDiffDepth(pair string) error

func (*Client) SubscribeTicker

func (ws *Client) SubscribeTicker(pair string) error

func (*Client) SubscribeTransactions

func (ws *Client) SubscribeTransactions(pair string) error

func (*Client) SubscribeWholeDepth

func (ws *Client) SubscribeWholeDepth(pair string) error

type Pairs

type Pairs int
const (
	// Pairs btc_jpy, xrp_jpy, ltc_btc, eth_btc, mona_jpy, mona_btc, bcc_jpy, bcc_btc
	PairBTCJPY Pairs = iota
	PairXRPJPY
	PairBCCJPY
	PairMNAJPY

	PairETHBTC
	PairLTCBTC
	PairMNABTC
	PairBCCBTC
)

type Recive

type Recive struct {
	Types Types // int
	Pairs Pairs // int

	Transactions transaction.Transactions
	Depth        depth.Depth
	Tickers      ticker.Ticker
	OHLCV        ohlcv.OHLCVs
	Error        error
}

type Types

type Types int
const (
	// Channel prefix
	TypeError Types = iota
	TypeTicker
	TypeDepthAll
	TypeDepthDiff
	TypeTransactions
	TypeCandlestick
)

Jump to

Keyboard shortcuts

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