realtime

package
v0.0.0-...-3bddcd1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 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"
	BCCJPY = "bcc_jpy"
	MNAJPY = "mona_jpy"

	ETHBTC = "eth_btc"
	LTCBTC = "ltc_btc"
	MNABTC = "mona_btc"
	BCCBTC = "bcc_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) 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 Request

type Request struct {
	// contains filtered or unexported fields
}

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