Documentation
¶
Index ¶
Constants ¶
View Source
const TopicName = "orderbook.v1.event"
Variables ¶
View Source
var ReservedTypeValues = []any{"orderBookUpdated"}
View Source
var ValuesToReservedType = map[any]ReservedType{ ReservedTypeValues[ReservedTypeOrderBookUpdated]: ReservedTypeOrderBookUpdated, }
Functions ¶
func GetAvroSchema ¶
func GetAvroSchema() string
func GetDereferencedJsonSchema ¶
func GetDereferencedJsonSchema() string
func GetJsonSchema ¶
func GetJsonSchema() string
Types ¶
type Consumer ¶
func NewConsumer ¶
func NewConsumer( logger *zap.SugaredLogger, subscriber Subscriber, messageConsumer messaging.MessageConsumer, timeHelper enterpriseTime.TimeHelper) Consumer
type Currency ¶
type Currency struct { Code string `json:"code"` Name string `json:"name"` MaxPrecision int32 `json:"maxPrecision"` Digital bool `json:"digital"` }
Currency represents a Currency model.
type Metadata ¶
type Metadata struct { Id uuid.UUID `json:"id"` // The unique message ID Source string `json:"source"` ReservedType ReservedType `json:"type"` Subject string `json:"subject"` Time time.Time `json:"time"` CorrelationId uuid.UUID `json:"correlationId"` Actor string `json:"actor"` }
Metadata represents a Metadata model.
type OrderBook ¶
type OrderBook struct { ExchangeId string `json:"exchangeId"` // The unique ID of the exchange BaseCurrency Currency `json:"baseCurrency"` CounterCurrency Currency `json:"counterCurrency"` Bids []OrderBookEntry `json:"bids"` Asks []OrderBookEntry `json:"asks"` AdditionalProperties *map[string]interface{} `json:"additionalProperties,omitempty"` }
OrderBook represents a OrderBook model.
type OrderBookEntry ¶
type OrderBookEntry struct { Time time.Time `json:"time"` // The order book entry timestamp Quantity Quantity `json:"quantity"` Price Quantity `json:"price"` }
OrderBookEntry represents a OrderBookEntry model.
type OrderBookEvent ¶
OrderBookEvent represents a OrderBookEvent model.
type Producer ¶
type Producer interface { Produce(ctx context.Context, key string, event OrderBookEvent) error Close() }
func NewProducer ¶
func NewProducer( logger *zap.SugaredLogger, messageProducer messaging.MessageProducer) Producer
type ReservedType ¶
type ReservedType uint
ReservedType represents an enum of ReservedType.
const (
ReservedTypeOrderBookUpdated ReservedType = iota
)
func (ReservedType) MarshalJSON ¶
func (enumVal ReservedType) MarshalJSON() ([]byte, error)
func (ReservedType) String ¶
func (enumVal ReservedType) String() string
func (*ReservedType) UnmarshalJSON ¶
func (enumVal *ReservedType) UnmarshalJSON(buffer []byte) error
type Subscriber ¶
type Subscriber interface {
Handle(ctx context.Context, event OrderBookEvent) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.