Documentation ¶
Index ¶
- func AddConnection(tx *gorm.DB, conn *Connection) error
- func AddProductBroker(tx *gorm.DB, pb *ProductBroker) error
- func AddProductData(tx *gorm.DB, ts *ProductData) error
- func AddTradingSystem(tx *gorm.DB, ts *TradingSystem) error
- func GetConnections(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]Connection, error)
- func GetCurrencies(tx *gorm.DB) (*[]Currency, error)
- func GetExchanges(tx *gorm.DB) (*[]Exchange, error)
- func GetInstrumentsByBrokerId(tx *gorm.DB, id uint) (*[]InstrumentBroker, error)
- func GetInstrumentsByDataId(tx *gorm.DB, id uint) (*[]InstrumentData, error)
- func GetPortfolios(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]Portfolio, error)
- func GetProductBrokers(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]ProductBrokerFull, error)
- func GetProductBrokersFull(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]ProductBrokerFull, error)
- func GetProductData(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]ProductDataFull, error)
- func GetProductDataFull(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]ProductDataFull, error)
- func GetTradingSessions(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]TradingSession, error)
- func GetTradingSystems(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]TradingSystemFull, error)
- func GetTradingSystemsFull(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]TradingSystemFull, error)
- func InitDatabase(cfg *core.Database)
- func RunInTransaction(f func(tx *gorm.DB) error) error
- func UpdateProductBroker(tx *gorm.DB, pb *ProductBroker)
- func UpdateProductData(tx *gorm.DB, ts *ProductData)
- func UpdateTradingSystem(tx *gorm.DB, ts *TradingSystem)
- type Common
- type Connection
- type Currency
- type Exchange
- type InstrumentBroker
- type InstrumentData
- type Portfolio
- type ProductBroker
- type ProductBrokerFull
- type ProductData
- type ProductDataFull
- type TradingSession
- type TradingSystem
- type TradingSystemFull
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConnection ¶
func AddConnection(tx *gorm.DB, conn *Connection) error
func AddProductBroker ¶
func AddProductBroker(tx *gorm.DB, pb *ProductBroker) error
func AddProductData ¶
func AddProductData(tx *gorm.DB, ts *ProductData) error
func AddTradingSystem ¶
func AddTradingSystem(tx *gorm.DB, ts *TradingSystem) error
func GetConnections ¶
func GetInstrumentsByBrokerId ¶
func GetInstrumentsByBrokerId(tx *gorm.DB, id uint) (*[]InstrumentBroker, error)
func GetInstrumentsByDataId ¶
func GetInstrumentsByDataId(tx *gorm.DB, id uint) (*[]InstrumentData, error)
func GetPortfolios ¶
func GetProductBrokers ¶
func GetProductBrokersFull ¶
func GetProductData ¶
func GetProductDataFull ¶
func GetTradingSessions ¶
func GetTradingSystems ¶
func GetTradingSystemsFull ¶
func InitDatabase ¶
func UpdateProductBroker ¶
func UpdateProductBroker(tx *gorm.DB, pb *ProductBroker)
func UpdateProductData ¶
func UpdateProductData(tx *gorm.DB, ts *ProductData)
func UpdateTradingSystem ¶
func UpdateTradingSystem(tx *gorm.DB, ts *TradingSystem)
Types ¶
type Connection ¶
type Connection struct { Common Username string `json:"username"` Code string `json:"code"` Name string `json:"name"` SystemCode string `json:"systemCode"` SystemName string `json:"systemName"` SystemConfig string `json:"systemConfig"` ConnectionCode string `json:"connectionCode"` SupportsData bool `json:"supportsData"` SupportsBroker bool `json:"supportsBroker"` SupportsMultipleData bool `json:"supportsMultipleData"` SupportsInventory bool `json:"supportsInventory"` }
func GetConnectionById ¶
func GetConnectionById(tx *gorm.DB, id uint) (*Connection, error)
func (Connection) TableName ¶
func (Connection) TableName() string
type Exchange ¶
type InstrumentBroker ¶
type InstrumentBroker struct { Id uint `json:"id" gorm:"primaryKey"` ProductBrokerId uint `json:"productBrokerId"` Symbol string `json:"symbol"` Name string `json:"name"` ExpirationDate int `json:"expirationDate"` }
func (InstrumentBroker) TableName ¶
func (InstrumentBroker) TableName() string
type InstrumentData ¶
type InstrumentData struct { Id uint `json:"id" gorm:"primaryKey"` ProductDataId uint `json:"productDataId"` Symbol string `json:"symbol"` Name string `json:"name"` ExpirationDate int `json:"expirationDate,omitempty"` IsContinuous bool `json:"isContinuous"` }
func (InstrumentData) TableName ¶
func (InstrumentData) TableName() string
type Portfolio ¶
type ProductBroker ¶
type ProductBroker struct { Common ConnectionId uint `json:"connectionId"` ExchangeId uint `json:"exchangeId"` Username string `json:"username"` Symbol string `json:"symbol"` Name string `json:"name"` PointValue float32 `json:"pointValue"` CostPerTrade float32 `json:"costPerTrade"` MarginValue float32 `json:"marginValue"` MarketType string `json:"marketType"` ProductType string `json:"productType"` LocalClass string `json:"localClass"` }
func GetProductBrokerById ¶
func GetProductBrokerById(tx *gorm.DB, id uint) (*ProductBroker, error)
func (ProductBroker) TableName ¶
func (ProductBroker) TableName() string
type ProductBrokerFull ¶
type ProductBrokerFull struct { ProductBroker CurrencyCode string `json:"currencyCode,omitempty"` ConnectionCode string `json:"connectionCode,omitempty"` ExchangeCode string `json:"exchangeCode,omitempty"` }
type ProductData ¶
type ProductData struct { Common ConnectionId uint `json:"connectionId"` ExchangeId uint `json:"exchangeId"` Username string `json:"username"` Symbol string `json:"symbol"` Name string `json:"name"` Increment float64 `json:"increment"` MarketType string `json:"marketType"` ProductType string `json:"productType"` LocalClass string `json:"localClass"` }
func GetProductDataById ¶
func GetProductDataById(tx *gorm.DB, id uint) (*ProductData, error)
func (ProductData) TableName ¶
func (ProductData) TableName() string
type ProductDataFull ¶
type ProductDataFull struct { ProductData ConnectionCode string `json:"connectionCode,omitempty"` SystemCode string `json:"systemCode,omitempty"` ExchangeCode string `json:"exchangeCode,omitempty"` }
type TradingSession ¶
type TradingSession struct { Common Username string `json:"username"` Name string `json:"name"` Config string `json:"config"` }
func (TradingSession) TableName ¶
func (TradingSession) TableName() string
type TradingSystem ¶
type TradingSystem struct { Common PortfolioId uint `json:"portfolioId"` ProductDataId uint `json:"productDataId"` ProductBrokerId uint `json:"productBrokerId"` TradingSessionId uint `json:"tradingSessionId"` Username string `json:"username"` WorkspaceCode string `json:"workspaceCode"` Name string `json:"name"` }
func GetTradingSystemById ¶
func GetTradingSystemById(tx *gorm.DB, id uint) (*TradingSystem, error)
func (TradingSystem) TableName ¶
func (TradingSystem) TableName() string
type TradingSystemFull ¶
type TradingSystemFull struct { TradingSystem DataSymbol string `json:"dataSymbol,omitempty"` BrokerSymbol string `json:"brokerSymbol,omitempty"` PortfolioName string `json:"portfolioName,omitempty"` TradingSession string `json:"tradingSession,omitempty"` }
Click to show internal directories.
Click to hide internal directories.