Documentation
¶
Overview ¶
Types and functions to be used by services that manage orders.
Index ¶
- func GetChildOrders(ctx context.Context, id string, kafkaReaderConfig kafka.ReaderConfig, ...) (<-chan ChildOrder, error)
- func NewChildOrderUpdatesDistributor(updates <-chan ChildOrder, initialSubscriptionsBufferSize int) *childOrderUpdatesDistributor
- type ChildOrder
- type OrderCache
- type OrderStream
- type ParentOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChildOrders ¶
func GetChildOrders(ctx context.Context, id string, kafkaReaderConfig kafka.ReaderConfig, bufferSize int) (<-chan ChildOrder, error)
GetChildOrders returns a channel of orders whose originator id matches the given order id and are thus children of the order.
func NewChildOrderUpdatesDistributor ¶
func NewChildOrderUpdatesDistributor(updates <-chan ChildOrder, initialSubscriptionsBufferSize int) *childOrderUpdatesDistributor
Types ¶
type ChildOrder ¶
type OrderCache ¶
type OrderCache struct {
// contains filtered or unexported fields
}
OrderCache is an in memory cache of the latest order state for a given owner backed by a persistent store.
func NewOwnerOrderCache ¶ added in v1.4.0
func NewOwnerOrderCache(ctx context.Context, ownerId string, store orderStore) (*OrderCache, error)
func (*OrderCache) Close ¶
func (oc *OrderCache) Close()
type OrderStream ¶ added in v1.4.0
type ParentOrder ¶
type ParentOrder struct { model.Order ChildOrders map[string]*model.Order // contains filtered or unexported fields }
ParentOrder has a one-to-many relationship to its child orders. The parent order aggregates and summarises state across its children.
func NewParentOrder ¶
func NewParentOrder(order model.Order) *ParentOrder
func (*ParentOrder) OnChildOrderUpdate ¶
func (po *ParentOrder) OnChildOrderUpdate(childOrder *model.Order) error
Click to show internal directories.
Click to hide internal directories.