trades

package
v0.0.0-...-629b520 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trade

type Trade struct {
	ID     uint64 `json:"t"`
	Symbol string `json:"s"`
	Price  string `json:"p"`
}

Trade is a model representing a single trade on binance.

type Watcher

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

Watcher listense to binance events.

func NewWatcher

func NewWatcher(logger logger) *Watcher

NewWatcher creates a new watcher.

func (*Watcher) Start

func (s *Watcher) Start(ctx context.Context) error

Start starts the watcher

func (*Watcher) Watch

func (s *Watcher) Watch(ctx context.Context, symbol string, out chan<- *Trade) error

Watch subscribes to symbol trades, and writes them into the channel.

Jump to

Keyboard shortcuts

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