server

package
v0.0.0-...-040f69b Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyncHistory

func SyncHistory(server *Server, ex exchange.Exchange, pair *currency.Pair, keepSyncing bool) error

SyncHistory - Syncs server trades history. Should be ran in a separate goroutine, should never exit. Syncs history every 60 seconds.

Types

type Iterator

type Iterator struct {
	iterator.Iterator
}

Iterator - Trades iterator.

func (*Iterator) Trade

func (iter *Iterator) Trade() (res *order.Trade, err error)

Trade - Unmarshals trade.

type Server

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

Server - Orderbook service server.

func New

func New(path string) (server *Server, err error)

New - Constructs new orderbook service server. Opens on-disk LevelDB database and syncs in-memory databases.

func (*Server) Close

func (server *Server) Close() (err error)

Close - Closes server database.

func (*Server) Compact

func (server *Server) Compact(ex exchange.Exchange, pair *currency.Pair) (err error)

Compact - Compacts exchange and currency pair database.

func (*Server) NewIterator

func (server *Server) NewIterator(ex exchange.Exchange, pair *currency.Pair) (_ *Iterator, err error)

NewIterator - Creates a new iterator for given currency pair on exchange.

func (*Server) Read

func (server *Server) Read(req *orderbook.ReadRequest, res orderbook.OrderBook_ReadServer) (err error)

Read - Starts streaming real-time updates of an order book, and all trades happening in real-time. Batches are sent in `MaxBatchSize` when reading from history, or in received size in real-time when live streaming.

Jump to

Keyboard shortcuts

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