gotrade: Index | Files

package orderrouter

import ""

Serving order New/Cancel/Replace tasks, communicates with various market connectors


Package Files

config.go orderrouter.go


const (
    // DefaultMessageBusURL is the default MessageBus URL for service communications.
    DefaultMessageBusURL        = messagebus.DefaultUrl
    DefaultServiceMessageBusURL = messagebus.DefaultUrl

type Config Uses

type Config struct {
    MessageBusURL        string `json:"or_message_bus"`      //trade and order message bus URL
    ServiceMessageBusURL string `json:"service_message_bus"` //services message bus URL, for listening to MC heartbeats
    DatabaseDriver       string `json:"database_driver"`     //database storage engine driver
    DatabaseUrl          string `json:"database_url"`        //database connection string

Config represents the configuration for base service.

func NewConfig Uses

func NewConfig() Config

NewConfig returns an instance of Config with defaults.

type OrderRequest Uses

type OrderRequest struct {
    ReplyAddr   string
    RequestType ReqType
    Request     interface{}
    OrderId     int32

type OrderRouter Uses

type OrderRouter struct {
    Config Config
    // contains filtered or unexported fields

func NewOrderRouter Uses

func NewOrderRouter(c Config) *OrderRouter

Initialise OrderRouter instance and set up topic subscribers

func (*OrderRouter) Close Uses

func (self *OrderRouter) Close()

func (*OrderRouter) Start Uses

func (self *OrderRouter) Start()

start the logic spinning code for OrderRouter, using a single pattern so there is no need to lock resources hence to avoid synchronisation issues

type ReqType Uses

type ReqType int
const (
    REQ_NEW ReqType = iota

Package orderrouter imports 10 packages (graph) and is imported by 1 packages. Updated 2016-07-20. Refresh now. Tools for package owners.