Documentation ¶
Index ¶
- Constants
- func AddBiasAnalysis(tx *gorm.DB, ba *BiasAnalysis) error
- func AddBiasConfig(tx *gorm.DB, bc *BiasConfig) error
- func AddBrokerProduct(tx *gorm.DB, p *BrokerProduct) error
- func AddDataInstrument(tx *gorm.DB, i *DataInstrument) error
- func AddDataProduct(tx *gorm.DB, p *DataProduct) error
- func AddUploadJob(tx *gorm.DB, job *UploadJob) error
- func DeleteBiasConfig(tx *gorm.DB, id uint) error
- func GetBiasAnalyses(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]BiasAnalysisFull, error)
- func GetBiasAnalysesFull(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]BiasAnalysisFull, error)
- func GetBiasConfigsByAnalysisId(tx *gorm.DB, id uint) (*[]BiasConfig, error)
- func GetDataInstrumentsByProductId(tx *gorm.DB, pId uint) (*[]DataInstrument, error)
- func GetDataInstrumentsFull(tx *gorm.DB, filter map[string]any) (*[]DataInstrumentFull, error)
- func InitDatabase(cfg *core.Database)
- func RunInTransaction(f func(tx *gorm.DB) error) error
- func UpdateBiasAnalysis(tx *gorm.DB, ba *BiasAnalysis) error
- func UpdateBiasConfig(tx *gorm.DB, bc *BiasConfig) error
- func UpdateBrokerProduct(tx *gorm.DB, p *BrokerProduct) error
- func UpdateDataInstrument(tx *gorm.DB, i *DataInstrument) error
- func UpdateDataProduct(tx *gorm.DB, p *DataProduct) error
- func UpdateUploadJob(tx *gorm.DB, job *UploadJob) error
- type BiasAnalysis
- type BiasAnalysisFull
- type BiasConfig
- type BrokerProduct
- type Common
- type DataInstrument
- type DataInstrumentFull
- type DataProduct
- type LoadedPeriod
- type UploadJob
Constants ¶
View Source
const InstrumentStatusError = -1
View Source
const InstrumentStatusProcessing = 1
View Source
const InstrumentStatusReady = 0
View Source
const UploadJobStatusAdding = 1
View Source
const UploadJobStatusAggregating = 2
View Source
const UploadJobStatusError = -1
View Source
const UploadJobStatusReady = 3
View Source
const UploadJobStatusWaiting = 0
Variables ¶
This section is empty.
Functions ¶
func AddBiasAnalysis ¶
func AddBiasAnalysis(tx *gorm.DB, ba *BiasAnalysis) error
func AddBiasConfig ¶
func AddBiasConfig(tx *gorm.DB, bc *BiasConfig) error
func AddBrokerProduct ¶
func AddBrokerProduct(tx *gorm.DB, p *BrokerProduct) error
func AddDataInstrument ¶
func AddDataInstrument(tx *gorm.DB, i *DataInstrument) error
func AddDataProduct ¶
func AddDataProduct(tx *gorm.DB, p *DataProduct) error
func GetBiasAnalyses ¶
func GetBiasAnalysesFull ¶
func GetBiasConfigsByAnalysisId ¶
func GetBiasConfigsByAnalysisId(tx *gorm.DB, id uint) (*[]BiasConfig, error)
func GetDataInstrumentsByProductId ¶
func GetDataInstrumentsByProductId(tx *gorm.DB, pId uint) (*[]DataInstrument, error)
func GetDataInstrumentsFull ¶
func InitDatabase ¶
func UpdateBiasAnalysis ¶
func UpdateBiasAnalysis(tx *gorm.DB, ba *BiasAnalysis) error
func UpdateBiasConfig ¶
func UpdateBiasConfig(tx *gorm.DB, bc *BiasConfig) error
func UpdateBrokerProduct ¶
func UpdateBrokerProduct(tx *gorm.DB, p *BrokerProduct) error
func UpdateDataInstrument ¶
func UpdateDataInstrument(tx *gorm.DB, i *DataInstrument) error
func UpdateDataProduct ¶
func UpdateDataProduct(tx *gorm.DB, p *DataProduct) error
Types ¶
type BiasAnalysis ¶
type BiasAnalysis struct { Common Username string `json:"username"` DataInstrumentId uint `json:"dataInstrumentId"` BrokerProductId uint `json:"brokerProductId"` Name string `json:"name"` Notes string `json:"notes"` }
func GetBiasAnalysisById ¶
func GetBiasAnalysisById(tx *gorm.DB, id uint) (*BiasAnalysis, error)
func (BiasAnalysis) TableName ¶
func (BiasAnalysis) TableName() string
type BiasAnalysisFull ¶
type BiasAnalysisFull struct { BiasAnalysis DataSymbol string `json:"dataSymbol"` DataName string `json:"dataName"` BrokerSymbol string `json:"brokerSymbol"` BrokerName string `json:"brokerName"` }
type BiasConfig ¶
type BiasConfig struct { Id uint `json:"id" gorm:"primaryKey"` BiasAnalysisId uint `json:"biasAnalysisId"` StartDay int16 `json:"startDay"` StartSlot int16 `json:"startSlot"` EndDay int16 `json:"endDay"` EndSlot int16 `json:"endSlot"` Months int16 `json:"months"` Excludes string `json:"excludes"` Operation int8 `json:"operation"` GrossProfit float64 `json:"grossProfit"` NetProfit float64 `json:"netProfit"` }
func (BiasConfig) TableName ¶
func (BiasConfig) TableName() string
type BrokerProduct ¶
type BrokerProduct struct { Id uint `json:"id" gorm:"primaryKey"` Symbol string `json:"symbol"` Username string `json:"username"` Name string `json:"name"` PointValue float32 `json:"pointValue"` CostPerOperation float32 `json:"costPerOperation"` CurrencyCode string `json:"currencyCode"` }
func GetBrokerProductById ¶
func GetBrokerProductById(tx *gorm.DB, id uint) (*BrokerProduct, error)
func (BrokerProduct) TableName ¶
func (BrokerProduct) TableName() string
type DataInstrument ¶
type DataInstrument struct { Id uint `json:"id" gorm:"primaryKey"` DataProductId uint `json:"dataProductId"` Symbol string `json:"symbol"` Name string `json:"name"` ExpirationDate int `json:"expirationDate,omitempty"` IsContinuous bool `json:"isContinuous"` Status int8 `json:"status"` DataFrom int `json:"dataFrom"` DataTo int `json:"dataTo"` }
func GetDataInstrumentById ¶
func GetDataInstrumentById(tx *gorm.DB, id uint) (*DataInstrument, error)
func (DataInstrument) TableName ¶
func (DataInstrument) TableName() string
type DataInstrumentFull ¶
type DataInstrumentFull struct { DataInstrument ProductSymbol string `json:"productSymbol"` SystemCode string `json:"systemCode"` ConnectionCode string `json:"connectionCode"` }
type DataProduct ¶
type DataProduct struct { Id uint `json:"id" gorm:"primaryKey"` Symbol string `json:"symbol"` Username string `json:"username"` SystemCode string `json:"systemCode"` ConnectionCode string `json:"connectionCode"` SupportsMultipleData bool `json:"supportsMultipleData"` Timezone string `json:"timezone"` }
func GetDataProductById ¶
func GetDataProductById(tx *gorm.DB, id uint) (*DataProduct, error)
func (DataProduct) TableName ¶
func (DataProduct) TableName() string
type LoadedPeriod ¶
type LoadedPeriod struct { Id uint `json:"id" gorm:"primaryKey"` DataInstrumentId uint `json:"dataInstrumentId"` Day int `json:"day"` Status int `json:"status"` }
func (LoadedPeriod) TableName ¶
func (LoadedPeriod) TableName() string
type UploadJob ¶
type UploadJob struct { Id uint `json:"id" gorm:"primaryKey"` DataInstrumentId uint `json:"dataInstrumentId"` Status int8 `json:"status"` Filename string `json:"filename"` Error string `json:"error"` Progress int8 `json:"progress"` Records int `json:"records"` Bytes int64 `json:"bytes"` Timezone string `json:"timezone"` Parser string `json:"parser"` }
Click to show internal directories.
Click to hide internal directories.