orderbook

package
v0.0.0-...-38fc69b Latest Latest
Warning

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

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

Documentation

Overview

Package orderbook is a generated protocol buffer package.

It is generated from these files:

github.com/crypto-bank/proto/orderbook/orderbook.proto
github.com/crypto-bank/proto/orderbook/event.proto

It has these top-level messages:

ReadRequest
Event
BatchEvents

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvent   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthOrderbook = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOrderbook   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterOrderBookServer

func RegisterOrderBookServer(s *grpc.Server, srv OrderBookServer)

Types

type BatchEvents

type BatchEvents struct {
	// Events - Batch of events.
	Events []*Event `protobuf:"bytes,1,rep,name=events" json:"events,omitempty"`
}

BatchEvents - Batch of events.

func (*BatchEvents) Descriptor

func (*BatchEvents) Descriptor() ([]byte, []int)

func (*BatchEvents) Equal

func (this *BatchEvents) Equal(that interface{}) bool

func (*BatchEvents) GetEvents

func (m *BatchEvents) GetEvents() []*Event

func (*BatchEvents) Marshal

func (m *BatchEvents) Marshal() (dAtA []byte, err error)

func (*BatchEvents) MarshalTo

func (m *BatchEvents) MarshalTo(dAtA []byte) (int, error)

func (*BatchEvents) ProtoMessage

func (*BatchEvents) ProtoMessage()

func (*BatchEvents) Reset

func (m *BatchEvents) Reset()

func (*BatchEvents) Size

func (m *BatchEvents) Size() (n int)

func (*BatchEvents) String

func (m *BatchEvents) String() string

func (*BatchEvents) Unmarshal

func (m *BatchEvents) Unmarshal(dAtA []byte) error

type Event

type Event struct {
	// Id - Identifier of this event.
	// It can be for example `seq` number as in `Poloniex`.
	ID int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// Event - Inner event, it can be order update or a trade.
	//
	// Types that are valid to be assigned to Event:
	//	*Event_Order
	//	*Event_Trade
	Event isEvent_Event `protobuf_oneof:"event"`
}

Event - Order or Trade event.

func NewEvent

func NewEvent(id int64, ev interface{}) *Event

NewEvent - Creates new event structure containing event.

func (*Event) Descriptor

func (*Event) Descriptor() ([]byte, []int)

func (*Event) Equal

func (this *Event) Equal(that interface{}) bool

func (*Event) GetEvent

func (m *Event) GetEvent() isEvent_Event

func (*Event) GetID

func (m *Event) GetID() int64

func (*Event) GetOrder

func (m *Event) GetOrder() *order.Order

func (*Event) GetTrade

func (m *Event) GetTrade() *order.Trade

func (*Event) Inner

func (event *Event) Inner() interface{}

Inner - Returns inner event.

func (*Event) Marshal

func (m *Event) Marshal() (dAtA []byte, err error)

func (*Event) MarshalTo

func (m *Event) MarshalTo(dAtA []byte) (int, error)

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) Size

func (m *Event) Size() (n int)

func (*Event) String

func (m *Event) String() string

func (*Event) Unmarshal

func (m *Event) Unmarshal(dAtA []byte) error

func (*Event) XXX_OneofFuncs

func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Event_Order

type Event_Order struct {
	Order *order.Order `protobuf:"bytes,2,opt,name=order,oneof"`
}

func (*Event_Order) Equal

func (this *Event_Order) Equal(that interface{}) bool

func (*Event_Order) MarshalTo

func (m *Event_Order) MarshalTo(dAtA []byte) (int, error)

func (*Event_Order) Size

func (m *Event_Order) Size() (n int)

type Event_Trade

type Event_Trade struct {
	Trade *order.Trade `protobuf:"bytes,3,opt,name=trade,oneof"`
}

func (*Event_Trade) Equal

func (this *Event_Trade) Equal(that interface{}) bool

func (*Event_Trade) MarshalTo

func (m *Event_Trade) MarshalTo(dAtA []byte) (int, error)

func (*Event_Trade) Size

func (m *Event_Trade) Size() (n int)

type OrderBookClient

type OrderBookClient interface {
	// 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.
	Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (OrderBook_ReadClient, error)
}

func NewOrderBookClient

func NewOrderBookClient(cc *grpc.ClientConn) OrderBookClient

type OrderBookServer

type OrderBookServer interface {
	// 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.
	Read(*ReadRequest, OrderBook_ReadServer) error
}

type OrderBook_ReadClient

type OrderBook_ReadClient interface {
	Recv() (*BatchEvents, error)
	grpc.ClientStream
}

type OrderBook_ReadServer

type OrderBook_ReadServer interface {
	Send(*BatchEvents) error
	grpc.ServerStream
}

type ReadRequest

type ReadRequest struct {
	// Pair - Currency pair.
	Pair *currency.Pair `protobuf:"bytes,1,opt,name=pair" json:"pair,omitempty"`
	// Exchange - Identifier of an exchange.
	Exchange exchange.Exchange `protobuf:"varint,2,opt,name=exchange,proto3,enum=exchange.Exchange" json:"exchange,omitempty"`
	// Start - Time of a first order to read.
	// If it is zero it will start reading from first record.
	Start *google_protobuf1.Timestamp `protobuf:"bytes,3,opt,name=start" json:"start,omitempty"`
	// End - Time of a last order to read.
	// `Zero` will indicate we want to read until the end,
	// in case of historical data it will be last existing trade,
	// in case of real-time data it will stream updates forever.
	End *google_protobuf1.Timestamp `protobuf:"bytes,4,opt,name=end" json:"end,omitempty"`
	// MaxBatchSize - Maximum size of a single batch sent.
	MaxBatchSize int64 `protobuf:"varint,5,opt,name=max_batch_size,proto3" json:"max_batch_size,omitempty"`
}

ReadRequest - Order book read request. It can be a real-time or historical data request.

func (*ReadRequest) Descriptor

func (*ReadRequest) Descriptor() ([]byte, []int)

func (*ReadRequest) Equal

func (this *ReadRequest) Equal(that interface{}) bool

func (*ReadRequest) GetEnd

func (m *ReadRequest) GetEnd() *google_protobuf1.Timestamp

func (*ReadRequest) GetExchange

func (m *ReadRequest) GetExchange() exchange.Exchange

func (*ReadRequest) GetMaxBatchSize

func (m *ReadRequest) GetMaxBatchSize() int64

func (*ReadRequest) GetPair

func (m *ReadRequest) GetPair() *currency.Pair

func (*ReadRequest) GetStart

func (m *ReadRequest) GetStart() *google_protobuf1.Timestamp

func (*ReadRequest) Marshal

func (m *ReadRequest) Marshal() (dAtA []byte, err error)

func (*ReadRequest) MarshalTo

func (m *ReadRequest) MarshalTo(dAtA []byte) (int, error)

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) Reset

func (m *ReadRequest) Reset()

func (*ReadRequest) Size

func (m *ReadRequest) Size() (n int)

func (*ReadRequest) String

func (m *ReadRequest) String() string

func (*ReadRequest) Unmarshal

func (m *ReadRequest) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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