本文整理汇总了Golang中github.com/quickfixgo/quickfix.GroupElement函数的典型用法代码示例。如果您正苦于以下问题:Golang GroupElement函数的具体用法?Golang GroupElement怎么用?Golang GroupElement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GroupElement函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestUnmarshal_RepeatingGroups
func TestUnmarshal_RepeatingGroups(t *testing.T) {
type Group1 struct {
StringField1 string `fix:"8"`
StringField2 *string `fix:"9"`
}
type Group2 struct {
IntField1 int `fix:"1"`
IntField2 int `fix:"2"`
}
type Message struct {
FIXMsgType string `fix:"0"`
GroupField1 []Group1 `fix:"100"`
StringField string `fix:"112"`
GroupField2 []Group2 `fix:"101"`
}
fixMsg := quickfix.NewMessage()
fixMsg.Body.SetField(quickfix.Tag(112), quickfix.FIXString("world"))
group1Template := quickfix.GroupTemplate{
quickfix.GroupElement(quickfix.Tag(8)),
quickfix.GroupElement(quickfix.Tag(9)),
}
group1 := quickfix.RepeatingGroup{Tag: quickfix.Tag(100), GroupTemplate: group1Template}
group1.Add().SetField(quickfix.Tag(8), quickfix.FIXString("hello")).SetField(quickfix.Tag(9), quickfix.FIXString("world"))
group1.Add().SetField(quickfix.Tag(8), quickfix.FIXString("goodbye"))
group1.Add().SetField(quickfix.Tag(8), quickfix.FIXString("OHHAI")).SetField(quickfix.Tag(9), quickfix.FIXString("world"))
fixMsg.Body.SetGroup(group1)
var msgOut Message
quickfix.Unmarshal(fixMsg, &msgOut)
if msgOut.StringField != "world" {
t.Errorf("Expected '%v' got '%v'", "world", msgOut.StringField)
}
if len(msgOut.GroupField1) != 3 {
t.Errorf("Expected group size '%v' got '%v'", 3, len(msgOut.GroupField1))
}
if msgOut.GroupField1[0].StringField1 != "hello" {
t.Errorf("Expected %v got %v", "hello", msgOut.GroupField1[0].StringField1)
}
if *(msgOut.GroupField1[0].StringField2) != "world" {
t.Errorf("Expected %v got %v", "world", *(msgOut.GroupField1[0].StringField2))
}
if msgOut.GroupField1[1].StringField1 != "goodbye" {
t.Errorf("Expected %v got %v", "goodbye", msgOut.GroupField1[1].StringField1)
}
if msgOut.GroupField1[1].StringField2 != nil {
t.Errorf("Expected stringfield 2 to be nil, got %v", *(msgOut.GroupField1[1].StringField2))
}
}
示例2: NewNoEventsRepeatingGroup
//NewNoEventsRepeatingGroup returns an initialized, NoEventsRepeatingGroup
func NewNoEventsRepeatingGroup() NoEventsRepeatingGroup {
return NoEventsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoEvents,
quickfix.GroupTemplate{quickfix.GroupElement(tag.EventType), quickfix.GroupElement(tag.EventDate), quickfix.GroupElement(tag.EventPx), quickfix.GroupElement(tag.EventText)})}
}
示例3: NewNoNestedPartyIDsRepeatingGroup
//NewNoNestedPartyIDsRepeatingGroup returns an initialized, NoNestedPartyIDsRepeatingGroup
func NewNoNestedPartyIDsRepeatingGroup() NoNestedPartyIDsRepeatingGroup {
return NoNestedPartyIDsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoNestedPartyIDs,
quickfix.GroupTemplate{quickfix.GroupElement(tag.NestedPartyID), quickfix.GroupElement(tag.NestedPartyIDSource), quickfix.GroupElement(tag.NestedPartyRole), NewNoNestedPartySubIDsRepeatingGroup()})}
}
示例4: NewNoTradingSessionsRepeatingGroup
//NewNoTradingSessionsRepeatingGroup returns an initialized, NoTradingSessionsRepeatingGroup
func NewNoTradingSessionsRepeatingGroup() NoTradingSessionsRepeatingGroup {
return NoTradingSessionsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoTradingSessions,
quickfix.GroupTemplate{quickfix.GroupElement(tag.TradingSessionID)})}
}
示例5: NewNoMDEntryTypesRepeatingGroup
//NewNoMDEntryTypesRepeatingGroup returns an initialized, NoMDEntryTypesRepeatingGroup
func NewNoMDEntryTypesRepeatingGroup() NoMDEntryTypesRepeatingGroup {
return NoMDEntryTypesRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoMDEntryTypes,
quickfix.GroupTemplate{quickfix.GroupElement(tag.MDEntryType)})}
}
示例6: NewNoRelatedSymRepeatingGroup
//NewNoRelatedSymRepeatingGroup returns an initialized, NoRelatedSymRepeatingGroup
func NewNoRelatedSymRepeatingGroup() NoRelatedSymRepeatingGroup {
return NoRelatedSymRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoRelatedSym,
quickfix.GroupTemplate{quickfix.GroupElement(tag.Symbol), quickfix.GroupElement(tag.SymbolSfx), quickfix.GroupElement(tag.SecurityID), quickfix.GroupElement(tag.SecurityIDSource), NewNoSecurityAltIDRepeatingGroup(), quickfix.GroupElement(tag.Product), quickfix.GroupElement(tag.CFICode), quickfix.GroupElement(tag.SecurityType), quickfix.GroupElement(tag.MaturityMonthYear), quickfix.GroupElement(tag.MaturityDate), quickfix.GroupElement(tag.CouponPaymentDate), quickfix.GroupElement(tag.IssueDate), quickfix.GroupElement(tag.RepoCollateralSecurityType), quickfix.GroupElement(tag.RepurchaseTerm), quickfix.GroupElement(tag.RepurchaseRate), quickfix.GroupElement(tag.Factor), quickfix.GroupElement(tag.CreditRating), quickfix.GroupElement(tag.InstrRegistry), quickfix.GroupElement(tag.CountryOfIssue), quickfix.GroupElement(tag.StateOrProvinceOfIssue), quickfix.GroupElement(tag.LocaleOfIssue), quickfix.GroupElement(tag.RedemptionDate), quickfix.GroupElement(tag.StrikePrice), quickfix.GroupElement(tag.OptAttribute), quickfix.GroupElement(tag.ContractMultiplier), quickfix.GroupElement(tag.CouponRate), quickfix.GroupElement(tag.SecurityExchange), quickfix.GroupElement(tag.Issuer), quickfix.GroupElement(tag.EncodedIssuerLen), quickfix.GroupElement(tag.EncodedIssuer), quickfix.GroupElement(tag.SecurityDesc), quickfix.GroupElement(tag.EncodedSecurityDescLen), quickfix.GroupElement(tag.EncodedSecurityDesc), quickfix.GroupElement(tag.PrevClosePx), quickfix.GroupElement(tag.QuoteRequestType), quickfix.GroupElement(tag.QuoteType), quickfix.GroupElement(tag.TradingSessionID), quickfix.GroupElement(tag.TradingSessionSubID), quickfix.GroupElement(tag.TradeOriginationDate), NewNoStipulationsRepeatingGroup(), quickfix.GroupElement(tag.Side), quickfix.GroupElement(tag.QuantityType), quickfix.GroupElement(tag.OrderQty), quickfix.GroupElement(tag.CashOrderQty), quickfix.GroupElement(tag.SettlmntTyp), quickfix.GroupElement(tag.FutSettDate), quickfix.GroupElement(tag.OrdType), quickfix.GroupElement(tag.FutSettDate2), quickfix.GroupElement(tag.OrderQty2), quickfix.GroupElement(tag.ExpireTime), quickfix.GroupElement(tag.TransactTime), quickfix.GroupElement(tag.Currency), quickfix.GroupElement(tag.Spread), quickfix.GroupElement(tag.BenchmarkCurveCurrency), quickfix.GroupElement(tag.BenchmarkCurveName), quickfix.GroupElement(tag.BenchmarkCurvePoint), quickfix.GroupElement(tag.PriceType), quickfix.GroupElement(tag.Price), quickfix.GroupElement(tag.Price2), quickfix.GroupElement(tag.YieldType), quickfix.GroupElement(tag.Yield)})}
}
示例7: NewNoSecurityAltIDRepeatingGroup
//NewNoSecurityAltIDRepeatingGroup returns an initialized, NoSecurityAltIDRepeatingGroup
func NewNoSecurityAltIDRepeatingGroup() NoSecurityAltIDRepeatingGroup {
return NoSecurityAltIDRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoSecurityAltID,
quickfix.GroupTemplate{quickfix.GroupElement(tag.SecurityAltID), quickfix.GroupElement(tag.SecurityAltIDSource)})}
}
示例8: NewNoHopsRepeatingGroup
//NewNoHopsRepeatingGroup returns an initialized, NoHopsRepeatingGroup
func NewNoHopsRepeatingGroup() NoHopsRepeatingGroup {
return NoHopsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoHops,
quickfix.GroupTemplate{quickfix.GroupElement(tag.HopCompID), quickfix.GroupElement(tag.HopSendingTime), quickfix.GroupElement(tag.HopRefID)})}
}
示例9: NewNoBidComponentsRepeatingGroup
//NewNoBidComponentsRepeatingGroup returns an initialized, NoBidComponentsRepeatingGroup
func NewNoBidComponentsRepeatingGroup() NoBidComponentsRepeatingGroup {
return NoBidComponentsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoBidComponents,
quickfix.GroupTemplate{quickfix.GroupElement(tag.Commission), quickfix.GroupElement(tag.CommType), quickfix.GroupElement(tag.ListID), quickfix.GroupElement(tag.Country), quickfix.GroupElement(tag.Side), quickfix.GroupElement(tag.Price), quickfix.GroupElement(tag.PriceType), quickfix.GroupElement(tag.FairValue), quickfix.GroupElement(tag.NetGrossInd), quickfix.GroupElement(tag.SettlmntTyp), quickfix.GroupElement(tag.FutSettDate), quickfix.GroupElement(tag.TradingSessionID), quickfix.GroupElement(tag.Text), quickfix.GroupElement(tag.EncodedTextLen), quickfix.GroupElement(tag.EncodedText)})}
}
示例10: NewNoRoutingIDsRepeatingGroup
//NewNoRoutingIDsRepeatingGroup returns an initialized, NoRoutingIDsRepeatingGroup
func NewNoRoutingIDsRepeatingGroup() NoRoutingIDsRepeatingGroup {
return NoRoutingIDsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoRoutingIDs,
quickfix.GroupTemplate{quickfix.GroupElement(tag.RoutingType), quickfix.GroupElement(tag.RoutingID)})}
}
示例11: NewLinesOfTextRepeatingGroup
//NewLinesOfTextRepeatingGroup returns an initialized, LinesOfTextRepeatingGroup
func NewLinesOfTextRepeatingGroup() LinesOfTextRepeatingGroup {
return LinesOfTextRepeatingGroup{
quickfix.NewRepeatingGroup(tag.LinesOfText,
quickfix.GroupTemplate{quickfix.GroupElement(tag.Text), quickfix.GroupElement(tag.EncodedTextLen), quickfix.GroupElement(tag.EncodedText)})}
}
示例12: NewNoAllocsRepeatingGroup
//NewNoAllocsRepeatingGroup returns an initialized, NoAllocsRepeatingGroup
func NewNoAllocsRepeatingGroup() NoAllocsRepeatingGroup {
return NoAllocsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoAllocs,
quickfix.GroupTemplate{quickfix.GroupElement(tag.AllocAccount), quickfix.GroupElement(tag.AllocAcctIDSource), quickfix.GroupElement(tag.AllocPrice), quickfix.GroupElement(tag.IndividualAllocID), quickfix.GroupElement(tag.IndividualAllocRejCode), quickfix.GroupElement(tag.AllocText), quickfix.GroupElement(tag.EncodedAllocTextLen), quickfix.GroupElement(tag.EncodedAllocText), quickfix.GroupElement(tag.SecondaryIndividualAllocID), quickfix.GroupElement(tag.AllocCustomerCapacity), quickfix.GroupElement(tag.IndividualAllocType), quickfix.GroupElement(tag.AllocQty), NewNoNestedPartyIDsRepeatingGroup(), quickfix.GroupElement(tag.AllocPositionEffect)})}
}
示例13: NewNoBidComponentsRepeatingGroup
//NewNoBidComponentsRepeatingGroup returns an initialized, NoBidComponentsRepeatingGroup
func NewNoBidComponentsRepeatingGroup() NoBidComponentsRepeatingGroup {
return NoBidComponentsRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoBidComponents,
quickfix.GroupTemplate{quickfix.GroupElement(tag.ListID), quickfix.GroupElement(tag.Side), quickfix.GroupElement(tag.TradingSessionID), quickfix.GroupElement(tag.NetGrossInd), quickfix.GroupElement(tag.SettlmntTyp), quickfix.GroupElement(tag.FutSettDate), quickfix.GroupElement(tag.Account)})}
}
示例14: NewNoRelatedSymRepeatingGroup
//NewNoRelatedSymRepeatingGroup returns an initialized, NoRelatedSymRepeatingGroup
func NewNoRelatedSymRepeatingGroup() NoRelatedSymRepeatingGroup {
return NoRelatedSymRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoRelatedSym,
quickfix.GroupTemplate{quickfix.GroupElement(tag.RelatdSym), quickfix.GroupElement(tag.SymbolSfx), quickfix.GroupElement(tag.SecurityID), quickfix.GroupElement(tag.IDSource), quickfix.GroupElement(tag.SecurityType), quickfix.GroupElement(tag.MaturityMonthYear), quickfix.GroupElement(tag.MaturityDay), quickfix.GroupElement(tag.PutOrCall), quickfix.GroupElement(tag.StrikePrice), quickfix.GroupElement(tag.OptAttribute), quickfix.GroupElement(tag.SecurityExchange), quickfix.GroupElement(tag.Issuer), quickfix.GroupElement(tag.SecurityDesc)})}
}
示例15: NewNoIOIQualifiersRepeatingGroup
//NewNoIOIQualifiersRepeatingGroup returns an initialized, NoIOIQualifiersRepeatingGroup
func NewNoIOIQualifiersRepeatingGroup() NoIOIQualifiersRepeatingGroup {
return NoIOIQualifiersRepeatingGroup{
quickfix.NewRepeatingGroup(tag.NoIOIQualifiers,
quickfix.GroupTemplate{quickfix.GroupElement(tag.IOIQualifier)})}
}